diff options
author | Bob Peterson <rpeterso@redhat.com> | 2012-11-12 13:03:29 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2012-11-13 04:55:26 -0500 |
commit | 4327a9bf71f4b021b675e01f24fefc647cff7513 (patch) | |
tree | 04a8fa4b934fbbe569e693111fad16fcd8c31712 /fs/gfs2/inode.c | |
parent | 343cd8f0d78515da38e41e9351f5ba306cdec84a (diff) |
GFS2: Eliminate redundant buffer_head manipulation in gfs2_unlink_inode
Since we now have a dirty_inode that takes care of manipulating the
inode buffer and writing from the inode to the buffer, we can
eliminate some unnecessary buffer manipulations in gfs2_unlink_inode
that are now redundant.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r-- | fs/gfs2/inode.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index ef3ce00bb528..e321333f0b4c 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
@@ -995,7 +995,6 @@ static int gfs2_unlink_ok(struct gfs2_inode *dip, const struct qstr *name, | |||
995 | * gfs2_unlink_inode - Removes an inode from its parent dir and unlinks it | 995 | * gfs2_unlink_inode - Removes an inode from its parent dir and unlinks it |
996 | * @dip: The parent directory | 996 | * @dip: The parent directory |
997 | * @name: The name of the entry in the parent directory | 997 | * @name: The name of the entry in the parent directory |
998 | * @bh: The inode buffer for the inode to be removed | ||
999 | * @inode: The inode to be removed | 998 | * @inode: The inode to be removed |
1000 | * | 999 | * |
1001 | * Called with all the locks and in a transaction. This will only be | 1000 | * Called with all the locks and in a transaction. This will only be |
@@ -1005,8 +1004,7 @@ static int gfs2_unlink_ok(struct gfs2_inode *dip, const struct qstr *name, | |||
1005 | */ | 1004 | */ |
1006 | 1005 | ||
1007 | static int gfs2_unlink_inode(struct gfs2_inode *dip, | 1006 | static int gfs2_unlink_inode(struct gfs2_inode *dip, |
1008 | const struct dentry *dentry, | 1007 | const struct dentry *dentry) |
1009 | struct buffer_head *bh) | ||
1010 | { | 1008 | { |
1011 | struct inode *inode = dentry->d_inode; | 1009 | struct inode *inode = dentry->d_inode; |
1012 | struct gfs2_inode *ip = GFS2_I(inode); | 1010 | struct gfs2_inode *ip = GFS2_I(inode); |
@@ -1046,7 +1044,6 @@ static int gfs2_unlink(struct inode *dir, struct dentry *dentry) | |||
1046 | struct gfs2_sbd *sdp = GFS2_SB(dir); | 1044 | struct gfs2_sbd *sdp = GFS2_SB(dir); |
1047 | struct inode *inode = dentry->d_inode; | 1045 | struct inode *inode = dentry->d_inode; |
1048 | struct gfs2_inode *ip = GFS2_I(inode); | 1046 | struct gfs2_inode *ip = GFS2_I(inode); |
1049 | struct buffer_head *bh; | ||
1050 | struct gfs2_holder ghs[3]; | 1047 | struct gfs2_holder ghs[3]; |
1051 | struct gfs2_rgrpd *rgd; | 1048 | struct gfs2_rgrpd *rgd; |
1052 | int error; | 1049 | int error; |
@@ -1095,14 +1092,9 @@ static int gfs2_unlink(struct inode *dir, struct dentry *dentry) | |||
1095 | 1092 | ||
1096 | error = gfs2_trans_begin(sdp, 2*RES_DINODE + 3*RES_LEAF + RES_RG_BIT, 0); | 1093 | error = gfs2_trans_begin(sdp, 2*RES_DINODE + 3*RES_LEAF + RES_RG_BIT, 0); |
1097 | if (error) | 1094 | if (error) |
1098 | goto out_gunlock; | ||
1099 | |||
1100 | error = gfs2_meta_inode_buffer(ip, &bh); | ||
1101 | if (error) | ||
1102 | goto out_end_trans; | 1095 | goto out_end_trans; |
1103 | 1096 | ||
1104 | error = gfs2_unlink_inode(dip, dentry, bh); | 1097 | error = gfs2_unlink_inode(dip, dentry); |
1105 | brelse(bh); | ||
1106 | 1098 | ||
1107 | out_end_trans: | 1099 | out_end_trans: |
1108 | gfs2_trans_end(sdp); | 1100 | gfs2_trans_end(sdp); |
@@ -1402,14 +1394,8 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry, | |||
1402 | 1394 | ||
1403 | /* Remove the target file, if it exists */ | 1395 | /* Remove the target file, if it exists */ |
1404 | 1396 | ||
1405 | if (nip) { | 1397 | if (nip) |
1406 | struct buffer_head *bh; | 1398 | error = gfs2_unlink_inode(ndip, ndentry); |
1407 | error = gfs2_meta_inode_buffer(nip, &bh); | ||
1408 | if (error) | ||
1409 | goto out_end_trans; | ||
1410 | error = gfs2_unlink_inode(ndip, ndentry, bh); | ||
1411 | brelse(bh); | ||
1412 | } | ||
1413 | 1399 | ||
1414 | if (dir_rename) { | 1400 | if (dir_rename) { |
1415 | error = gfs2_dir_mvino(ip, &gfs2_qdotdot, ndip, DT_DIR); | 1401 | error = gfs2_dir_mvino(ip, &gfs2_qdotdot, ndip, DT_DIR); |