aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/rgrp.h
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2011-08-31 11:38:29 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2011-10-21 07:39:33 -0400
commit8339ee543ece6e2dcc1bbd97d5350163c198cf00 (patch)
tree80b3d4b990a8ab5f8b7c28945f694b01301c05c6 /fs/gfs2/rgrp.h
parent7c9ca621137cde26be05448133fc1a554345f4f8 (diff)
GFS2: Make resource groups "append only" during life of fs
Since we have ruled out supporting online filesystem shrink, it is possible to make the resource group list append only during the life of a super block. This gives several benefits: Firstly, we only need to read new rindex elements as they are added rather than needing to reread the whole rindex file each time one element is added. Secondly, the rindex glock can be held for much shorter periods of time, and is completely removed from the fast path for allocations. The lock is taken in shared mode only when updating the resource groups when the first allocation occurs, and after a grow has taken place. Thirdly, this results in a reduction in code size, and everything gets a lot simpler to understand in this area. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/rgrp.h')
-rw-r--r--fs/gfs2/rgrp.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/fs/gfs2/rgrp.h b/fs/gfs2/rgrp.h
index 59b950f43ccf..0439fca18f08 100644
--- a/fs/gfs2/rgrp.h
+++ b/fs/gfs2/rgrp.h
@@ -18,13 +18,13 @@ struct gfs2_holder;
18 18
19extern void gfs2_rgrp_verify(struct gfs2_rgrpd *rgd); 19extern void gfs2_rgrp_verify(struct gfs2_rgrpd *rgd);
20 20
21struct gfs2_rgrpd *gfs2_blk2rgrpd(struct gfs2_sbd *sdp, u64 blk); 21extern struct gfs2_rgrpd *gfs2_blk2rgrpd(struct gfs2_sbd *sdp, u64 blk);
22struct gfs2_rgrpd *gfs2_rgrpd_get_first(struct gfs2_sbd *sdp); 22extern struct gfs2_rgrpd *gfs2_rgrpd_get_first(struct gfs2_sbd *sdp);
23struct gfs2_rgrpd *gfs2_rgrpd_get_next(struct gfs2_rgrpd *rgd); 23extern struct gfs2_rgrpd *gfs2_rgrpd_get_next(struct gfs2_rgrpd *rgd);
24 24
25extern void gfs2_clear_rgrpd(struct gfs2_sbd *sdp); 25extern void gfs2_clear_rgrpd(struct gfs2_sbd *sdp);
26extern int gfs2_rindex_hold(struct gfs2_sbd *sdp, struct gfs2_holder *ri_gh); 26extern int gfs2_rindex_update(struct gfs2_sbd *sdp);
27 27extern void gfs2_free_clones(struct gfs2_rgrpd *rgd);
28extern int gfs2_rgrp_go_lock(struct gfs2_holder *gh); 28extern int gfs2_rgrp_go_lock(struct gfs2_holder *gh);
29extern void gfs2_rgrp_go_unlock(struct gfs2_holder *gh); 29extern void gfs2_rgrp_go_unlock(struct gfs2_holder *gh);
30 30
@@ -36,16 +36,13 @@ static inline void gfs2_alloc_put(struct gfs2_inode *ip)
36 ip->i_alloc = NULL; 36 ip->i_alloc = NULL;
37} 37}
38 38
39extern int gfs2_inplace_reserve_i(struct gfs2_inode *ip, int hold_rindex, 39extern int gfs2_inplace_reserve_i(struct gfs2_inode *ip,
40 char *file, unsigned int line); 40 char *file, unsigned int line);
41#define gfs2_inplace_reserve(ip) \ 41#define gfs2_inplace_reserve(ip) \
42 gfs2_inplace_reserve_i((ip), 1, __FILE__, __LINE__) 42 gfs2_inplace_reserve_i((ip), __FILE__, __LINE__)
43#define gfs2_inplace_reserve_ri(ip) \
44 gfs2_inplace_reserve_i((ip), 0, __FILE__, __LINE__)
45 43
46extern void gfs2_inplace_release(struct gfs2_inode *ip); 44extern void gfs2_inplace_release(struct gfs2_inode *ip);
47 45
48extern int gfs2_ri_update(struct gfs2_inode *ip);
49extern int gfs2_alloc_block(struct gfs2_inode *ip, u64 *bn, unsigned int *n); 46extern int gfs2_alloc_block(struct gfs2_inode *ip, u64 *bn, unsigned int *n);
50extern int gfs2_alloc_di(struct gfs2_inode *ip, u64 *bn, u64 *generation); 47extern int gfs2_alloc_di(struct gfs2_inode *ip, u64 *bn, u64 *generation);
51 48