aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2011-05-09 07:08:36 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2011-05-09 11:35:25 -0400
commit2baee03fb916563d7cc597e5460e4cb938815c52 (patch)
tree7fb2318e11be52f956c0b2af44a62a4746d034ab /fs/gfs2
parent588da3b3be8b3225c2dd192aa782bf6c5c32eb84 (diff)
GFS2: Don't use gfs2_change_nlink in link syscall
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>
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/ops_inode.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c
index 1005f9eb456..acb6f69b02e 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,
145 struct inode *inode = old_dentry->d_inode; 145 struct inode *inode = old_dentry->d_inode;
146 struct gfs2_inode *ip = GFS2_I(inode); 146 struct gfs2_inode *ip = GFS2_I(inode);
147 struct gfs2_holder ghs[2]; 147 struct gfs2_holder ghs[2];
148 struct buffer_head *dibh;
148 int alloc_required; 149 int alloc_required;
149 int error; 150 int error;
150 151
@@ -230,12 +231,22 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
230 goto out_ipres; 231 goto out_ipres;
231 } 232 }
232 233
233 error = gfs2_dir_add(dir, &dentry->d_name, ip, IF2DT(inode->i_mode)); 234 error = gfs2_meta_inode_buffer(ip, &dibh);
234 if (error) 235 if (error)
235 goto out_end_trans; 236 goto out_end_trans;
236 237
237 error = gfs2_change_nlink(ip, +1); 238 error = gfs2_dir_add(dir, &dentry->d_name, ip, IF2DT(inode->i_mode));
239 if (error)
240 goto out_brelse;
241
242 gfs2_trans_add_bh(ip->i_gl, dibh, 1);
243 inc_nlink(&ip->i_inode);
244 ip->i_inode.i_ctime = CURRENT_TIME;
245 gfs2_dinode_out(ip, dibh->b_data);
246 mark_inode_dirty(&ip->i_inode);
238 247
248out_brelse:
249 brelse(dibh);
239out_end_trans: 250out_end_trans:
240 gfs2_trans_end(sdp); 251 gfs2_trans_end(sdp);
241out_ipres: 252out_ipres: