Hi,
Looks good to me except for a few nits:
(snip)
Just a suggestion, but can you add a function comment at the start of this
function?
> +static int gfs2_exchange(struct inode *odir, struct dentry *odentry,
> + struct inode *ndir, struct dentry *ndentry,
> + unsigned int flags)
> +{
> + struct gfs2_inode *odip = GFS2_I(odir);
> + struct gfs2_inode *ndip = GFS2_I(ndir);
> + struct gfs2_inode *oip = GFS2_I(odentry->d_inode);
> + struct gfs2_inode *nip = GFS2_I(ndentry->d_inode);
> + struct gfs2_sbd *sdp = GFS2_SB(odir);
> + struct gfs2_holder ghs[5], r_gh = { .gh_gl = NULL, };
> + unsigned int num_gh;
> + unsigned int x;
> + umode_t old_mode = oip->i_inode.i_mode;
> + umode_t new_mode = nip->i_inode.i_mode;
> + int error;
> +
> + error = gfs2_rindex_update(sdp);
> + if (error)
> + return error;
> +
> + if (odip != ndip) {
> + error = gfs2_glock_nq_init(sdp->sd_rename_gl, LM_ST_EXCLUSIVE,
> + 0, &r_gh);
> + if (error)
> + goto out;
> +
> + if (S_ISDIR(old_mode)) {
> + /* don't move a dirctory into it's subdir */
> + error = gfs2_ok_to_move(oip, ndip);
> + if (error)
> + goto out_gunlock_r;
> + }
> +
> + if (S_ISDIR(new_mode)) {
> + /* don't move a dirctory into it's subdir */
Nit: I know this was likely copied from the existing rename code, but can you:
s/dirctory/directory/ and s/it's/its/
Regards,
Bob Peterson
Red Hat File Systems