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/trans.h | |
parent | 1f981697432daea3c0abf938b39174dcfb29340e (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/trans.h')
-rw-r--r-- | fs/gfs2/trans.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/gfs2/trans.h b/fs/gfs2/trans.h index 41f42cdccbb8..bf2ae9aeee7a 100644 --- a/fs/gfs2/trans.h +++ b/fs/gfs2/trans.h @@ -28,11 +28,10 @@ struct gfs2_glock; /* reserve either the number of blocks to be allocated plus the rg header * block, or all of the blocks in the rg, whichever is smaller */ -static inline unsigned int gfs2_rg_blocks(const struct gfs2_inode *ip) +static inline unsigned int gfs2_rg_blocks(const struct gfs2_inode *ip, unsigned requested) { - const struct gfs2_blkreserv *rs = ip->i_res; - if (rs && rs->rs_requested < ip->i_rgd->rd_length) - return rs->rs_requested + 1; + if (requested < ip->i_rgd->rd_length) + return requested + 1; return ip->i_rgd->rd_length; } |