From: Bob Peterson <rpeterso@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] GFS2: add support for rename2 and RENAME_EXCHANGE
Date: Wed, 15 Apr 2015 15:14:23 -0400 (EDT) [thread overview]
Message-ID: <447600804.508063.1429125263425.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1429124229-20506-1-git-send-email-bmarzins@redhat.com>
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
next prev parent reply other threads:[~2015-04-15 19:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-15 18:57 [Cluster-devel] [PATCH] GFS2: add support for rename2 and RENAME_EXCHANGE Benjamin Marzinski
2015-04-15 19:14 ` Bob Peterson [this message]
2015-05-05 18:41 ` [Cluster-devel] [PATCH v2] " Bob Peterson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=447600804.508063.1429125263425.JavaMail.zimbra@redhat.com \
--to=rpeterso@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).