From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 1/8] GFS2: Don't use gfs2_change_nlink in link syscall
Date: Mon, 9 May 2011 17:32:22 +0100 [thread overview]
Message-ID: <1304958749-15194-2-git-send-email-swhiteho@redhat.com> (raw)
In-Reply-To: <1304958749-15194-1-git-send-email-swhiteho@redhat.com>
There are three users of gfs2_change_nlink which add to the link
count. Two of these are about to be removed in later patches, so
this means that there will no callers, when that happens allowing
removal of that function, also in a later patch.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c
index 1005f9e..acb6f69 100644
--- a/fs/gfs2/ops_inode.c
+++ b/fs/gfs2/ops_inode.c
@@ -145,6 +145,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
struct inode *inode = old_dentry->d_inode;
struct gfs2_inode *ip = GFS2_I(inode);
struct gfs2_holder ghs[2];
+ struct buffer_head *dibh;
int alloc_required;
int error;
@@ -230,12 +231,22 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
goto out_ipres;
}
- error = gfs2_dir_add(dir, &dentry->d_name, ip, IF2DT(inode->i_mode));
+ error = gfs2_meta_inode_buffer(ip, &dibh);
if (error)
goto out_end_trans;
- error = gfs2_change_nlink(ip, +1);
+ error = gfs2_dir_add(dir, &dentry->d_name, ip, IF2DT(inode->i_mode));
+ if (error)
+ goto out_brelse;
+
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
+ inc_nlink(&ip->i_inode);
+ ip->i_inode.i_ctime = CURRENT_TIME;
+ gfs2_dinode_out(ip, dibh->b_data);
+ mark_inode_dirty(&ip->i_inode);
+out_brelse:
+ brelse(dibh);
out_end_trans:
gfs2_trans_end(sdp);
out_ipres:
--
1.7.4
next prev parent reply other threads:[~2011-05-09 16:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-09 16:32 [Cluster-devel] GFS2: Inode/link count patch set Steven Whitehouse
2011-05-09 16:32 ` Steven Whitehouse [this message]
2011-05-09 16:32 ` [Cluster-devel] [PATCH 2/8] GFS2: Make gfs2_dir_del update link count when required Steven Whitehouse
2011-05-09 16:32 ` [Cluster-devel] [PATCH 3/8] GFS2: When adding a new dir entry, inc link count if it is a subdir Steven Whitehouse
2011-05-09 16:32 ` [Cluster-devel] [PATCH 4/8] GFS2: Remove gfs2_dinode_print() function Steven Whitehouse
2011-05-09 16:32 ` [Cluster-devel] [PATCH 5/8] GFS2: Move gfs2_refresh_inode() and friends into glops.c Steven Whitehouse
2011-05-09 16:32 ` [Cluster-devel] [PATCH 6/8] GFS2: Move most of the remaining inode.c into ops_inode.c Steven Whitehouse
2011-05-09 16:32 ` [Cluster-devel] [PATCH 7/8] GFS2: Move final part of inode.c into super.c Steven Whitehouse
2011-05-09 16:32 ` [Cluster-devel] [PATCH 8/8] GFS2: Remove inode.c and rename ops_inode.c to inode.c Steven Whitehouse
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=1304958749-15194-2-git-send-email-swhiteho@redhat.com \
--to=swhiteho@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).