diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2009-05-20 05:48:47 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2009-05-20 05:48:47 -0400 |
commit | 09010978345e8883003bf411bb99753710eb5a3a (patch) | |
tree | c3a7eaf3a775649d11ad01c2be5d3549e90f6581 /fs/gfs2/rgrp.h | |
parent | ef9e8b14a5c1d0afbaf12b4c3b271188ddfc52a4 (diff) |
GFS2: Improve resource group error handling
This patch improves the error handling in the case where we
discover that the summary information in the resource group
doesn't match the bitmap information while in the process of
allocating blocks. Originally this resulted in a kernel bug,
but this patch changes that so that we return -EIO and print
some messages explaining what went wrong, and how to fix it.
We also remember locally not to try and allocate from the
same rgrp again, so that a subsequent allocation in a
different rgrp should succeed.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/rgrp.h')
-rw-r--r-- | fs/gfs2/rgrp.h | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/fs/gfs2/rgrp.h b/fs/gfs2/rgrp.h index 3181c7e624bf..1e76ff0f3e00 100644 --- a/fs/gfs2/rgrp.h +++ b/fs/gfs2/rgrp.h | |||
@@ -14,22 +14,22 @@ struct gfs2_rgrpd; | |||
14 | struct gfs2_sbd; | 14 | struct gfs2_sbd; |
15 | struct gfs2_holder; | 15 | struct gfs2_holder; |
16 | 16 | ||
17 | void gfs2_rgrp_verify(struct gfs2_rgrpd *rgd); | 17 | extern void gfs2_rgrp_verify(struct gfs2_rgrpd *rgd); |
18 | 18 | ||
19 | struct gfs2_rgrpd *gfs2_blk2rgrpd(struct gfs2_sbd *sdp, u64 blk); | 19 | struct gfs2_rgrpd *gfs2_blk2rgrpd(struct gfs2_sbd *sdp, u64 blk); |
20 | struct gfs2_rgrpd *gfs2_rgrpd_get_first(struct gfs2_sbd *sdp); | 20 | struct gfs2_rgrpd *gfs2_rgrpd_get_first(struct gfs2_sbd *sdp); |
21 | struct gfs2_rgrpd *gfs2_rgrpd_get_next(struct gfs2_rgrpd *rgd); | 21 | struct gfs2_rgrpd *gfs2_rgrpd_get_next(struct gfs2_rgrpd *rgd); |
22 | 22 | ||
23 | void gfs2_clear_rgrpd(struct gfs2_sbd *sdp); | 23 | extern void gfs2_clear_rgrpd(struct gfs2_sbd *sdp); |
24 | int gfs2_rindex_hold(struct gfs2_sbd *sdp, struct gfs2_holder *ri_gh); | 24 | extern int gfs2_rindex_hold(struct gfs2_sbd *sdp, struct gfs2_holder *ri_gh); |
25 | 25 | ||
26 | int gfs2_rgrp_bh_get(struct gfs2_rgrpd *rgd); | 26 | extern int gfs2_rgrp_bh_get(struct gfs2_rgrpd *rgd); |
27 | void gfs2_rgrp_bh_hold(struct gfs2_rgrpd *rgd); | 27 | extern void gfs2_rgrp_bh_hold(struct gfs2_rgrpd *rgd); |
28 | void gfs2_rgrp_bh_put(struct gfs2_rgrpd *rgd); | 28 | extern void gfs2_rgrp_bh_put(struct gfs2_rgrpd *rgd); |
29 | 29 | ||
30 | void gfs2_rgrp_repolish_clones(struct gfs2_rgrpd *rgd); | 30 | extern void gfs2_rgrp_repolish_clones(struct gfs2_rgrpd *rgd); |
31 | 31 | ||
32 | struct gfs2_alloc *gfs2_alloc_get(struct gfs2_inode *ip); | 32 | extern struct gfs2_alloc *gfs2_alloc_get(struct gfs2_inode *ip); |
33 | static inline void gfs2_alloc_put(struct gfs2_inode *ip) | 33 | static inline void gfs2_alloc_put(struct gfs2_inode *ip) |
34 | { | 34 | { |
35 | BUG_ON(ip->i_alloc == NULL); | 35 | BUG_ON(ip->i_alloc == NULL); |
@@ -37,22 +37,22 @@ static inline void gfs2_alloc_put(struct gfs2_inode *ip) | |||
37 | ip->i_alloc = NULL; | 37 | ip->i_alloc = NULL; |
38 | } | 38 | } |
39 | 39 | ||
40 | int gfs2_inplace_reserve_i(struct gfs2_inode *ip, | 40 | extern int gfs2_inplace_reserve_i(struct gfs2_inode *ip, char *file, |
41 | char *file, unsigned int line); | 41 | unsigned int line); |
42 | #define gfs2_inplace_reserve(ip) \ | 42 | #define gfs2_inplace_reserve(ip) \ |
43 | gfs2_inplace_reserve_i((ip), __FILE__, __LINE__) | 43 | gfs2_inplace_reserve_i((ip), __FILE__, __LINE__) |
44 | 44 | ||
45 | void gfs2_inplace_release(struct gfs2_inode *ip); | 45 | extern void gfs2_inplace_release(struct gfs2_inode *ip); |
46 | 46 | ||
47 | unsigned char gfs2_get_block_type(struct gfs2_rgrpd *rgd, u64 block); | 47 | extern unsigned char gfs2_get_block_type(struct gfs2_rgrpd *rgd, u64 block); |
48 | 48 | ||
49 | u64 gfs2_alloc_block(struct gfs2_inode *ip, unsigned int *n); | 49 | extern int gfs2_alloc_block(struct gfs2_inode *ip, u64 *bn, unsigned int *n); |
50 | u64 gfs2_alloc_di(struct gfs2_inode *ip, u64 *generation); | 50 | extern u64 gfs2_alloc_di(struct gfs2_inode *ip, u64 *generation); |
51 | 51 | ||
52 | void gfs2_free_data(struct gfs2_inode *ip, u64 bstart, u32 blen); | 52 | extern void gfs2_free_data(struct gfs2_inode *ip, u64 bstart, u32 blen); |
53 | void gfs2_free_meta(struct gfs2_inode *ip, u64 bstart, u32 blen); | 53 | extern void gfs2_free_meta(struct gfs2_inode *ip, u64 bstart, u32 blen); |
54 | void gfs2_free_di(struct gfs2_rgrpd *rgd, struct gfs2_inode *ip); | 54 | extern void gfs2_free_di(struct gfs2_rgrpd *rgd, struct gfs2_inode *ip); |
55 | void gfs2_unlink_di(struct inode *inode); | 55 | extern void gfs2_unlink_di(struct inode *inode); |
56 | 56 | ||
57 | struct gfs2_rgrp_list { | 57 | struct gfs2_rgrp_list { |
58 | unsigned int rl_rgrps; | 58 | unsigned int rl_rgrps; |
@@ -61,10 +61,11 @@ struct gfs2_rgrp_list { | |||
61 | struct gfs2_holder *rl_ghs; | 61 | struct gfs2_holder *rl_ghs; |
62 | }; | 62 | }; |
63 | 63 | ||
64 | void gfs2_rlist_add(struct gfs2_sbd *sdp, struct gfs2_rgrp_list *rlist, | 64 | extern void gfs2_rlist_add(struct gfs2_sbd *sdp, struct gfs2_rgrp_list *rlist, |
65 | u64 block); | 65 | u64 block); |
66 | void gfs2_rlist_alloc(struct gfs2_rgrp_list *rlist, unsigned int state); | 66 | extern void gfs2_rlist_alloc(struct gfs2_rgrp_list *rlist, unsigned int state); |
67 | void gfs2_rlist_free(struct gfs2_rgrp_list *rlist); | 67 | extern void gfs2_rlist_free(struct gfs2_rgrp_list *rlist); |
68 | u64 gfs2_ri_total(struct gfs2_sbd *sdp); | 68 | extern u64 gfs2_ri_total(struct gfs2_sbd *sdp); |
69 | extern int gfs2_rgrp_dump(struct seq_file *seq, const struct gfs2_glock *gl); | ||
69 | 70 | ||
70 | #endif /* __RGRP_DOT_H__ */ | 71 | #endif /* __RGRP_DOT_H__ */ |