diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2012-07-30 14:53:19 +0100 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2012-09-24 10:46:54 +0100 |
commit | 71f890f7f758f340215d48fed5223f9cce05b652 (patch) | |
tree | e0a274e17e9a6e2a623fceaa47b9faf1635d7343 /fs/gfs2/inode.c | |
parent | 1f981697432daea3c0abf938b39174dcfb29340e (diff) | |
download | linux-exynos-71f890f7f758f340215d48fed5223f9cce05b652.tar.gz linux-exynos-71f890f7f758f340215d48fed5223f9cce05b652.tar.bz2 linux-exynos-71f890f7f758f340215d48fed5223f9cce05b652.zip |
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.c | 9 |
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, brelse(bh); gfs2_trans_end(sdp); - /* Check if we reserved space in the rgrp. Function link_dinode may - not, depending on whether alloc is required. */ - if (gfs2_mb_reserved(dip)) - gfs2_inplace_release(dip); + gfs2_inplace_release(dip); gfs2_quota_unlock(dip); mark_inode_dirty(inode); gfs2_glock_dq_uninit_m(2, ghs); @@ -897,7 +894,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir, goto out_gunlock_q; error = gfs2_trans_begin(sdp, sdp->sd_max_dirres + - gfs2_rg_blocks(dip) + + gfs2_rg_blocks(dip, sdp->sd_max_dirres) + 2 * RES_DINODE + RES_STATFS + RES_QUOTA, 0); if (error) @@ -1378,7 +1375,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry, goto out_gunlock_q; error = gfs2_trans_begin(sdp, sdp->sd_max_dirres + - gfs2_rg_blocks(ndip) + + gfs2_rg_blocks(ndip, sdp->sd_max_dirres) + 4 * RES_DINODE + 4 * RES_LEAF + RES_STATFS + RES_QUOTA + 4, 0); if (error) |