aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2012-07-30 09:53:19 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2012-09-24 05:46:54 -0400
commit71f890f7f758f340215d48fed5223f9cce05b652 (patch)
treee0a274e17e9a6e2a623fceaa47b9faf1635d7343 /fs/gfs2/inode.c
parent1f981697432daea3c0abf938b39174dcfb29340e (diff)
GFS2: Remove rs_requested field from reservations
The rs_requested field is left over from the original allocation code, however this should have been a parameter passed to the various functions from gfs2_inplace_reserve() and not a member of the reservation structure as the value is not required after the initial allocation. This also helps simplify the code since we no longer need to set the rs_requested to zero. Also the gfs2_inplace_release() function can also be simplified since the reservation structure will always be defined when it is called, and the only remaining task is to unlock the rgrp if required. It can also now be called unconditionally too, resulting in a further simplification. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r--fs/gfs2/inode.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 753af3d86bbc..f2709ea887da 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -737,10 +737,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
737 brelse(bh); 737 brelse(bh);
738 738
739 gfs2_trans_end(sdp); 739 gfs2_trans_end(sdp);
740 /* Check if we reserved space in the rgrp. Function link_dinode may 740 gfs2_inplace_release(dip);
741 not, depending on whether alloc is required. */
742 if (gfs2_mb_reserved(dip))
743 gfs2_inplace_release(dip);
744 gfs2_quota_unlock(dip); 741 gfs2_quota_unlock(dip);
745 mark_inode_dirty(inode); 742 mark_inode_dirty(inode);
746 gfs2_glock_dq_uninit_m(2, ghs); 743 gfs2_glock_dq_uninit_m(2, ghs);
@@ -897,7 +894,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
897 goto out_gunlock_q; 894 goto out_gunlock_q;
898 895
899 error = gfs2_trans_begin(sdp, sdp->sd_max_dirres + 896 error = gfs2_trans_begin(sdp, sdp->sd_max_dirres +
900 gfs2_rg_blocks(dip) + 897 gfs2_rg_blocks(dip, sdp->sd_max_dirres) +
901 2 * RES_DINODE + RES_STATFS + 898 2 * RES_DINODE + RES_STATFS +
902 RES_QUOTA, 0); 899 RES_QUOTA, 0);
903 if (error) 900 if (error)
@@ -1378,7 +1375,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
1378 goto out_gunlock_q; 1375 goto out_gunlock_q;
1379 1376
1380 error = gfs2_trans_begin(sdp, sdp->sd_max_dirres + 1377 error = gfs2_trans_begin(sdp, sdp->sd_max_dirres +
1381 gfs2_rg_blocks(ndip) + 1378 gfs2_rg_blocks(ndip, sdp->sd_max_dirres) +
1382 4 * RES_DINODE + 4 * RES_LEAF + 1379 4 * RES_DINODE + 4 * RES_LEAF +
1383 RES_STATFS + RES_QUOTA + 4, 0); 1380 RES_STATFS + RES_QUOTA + 4, 0);
1384 if (error) 1381 if (error)