diff options
Diffstat (limited to 'fs/gfs2/rgrp.h')
-rw-r--r-- | fs/gfs2/rgrp.h | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/fs/gfs2/rgrp.h b/fs/gfs2/rgrp.h index 0b0e9cc7e3d9..c98f6af07e1c 100644 --- a/fs/gfs2/rgrp.h +++ b/fs/gfs2/rgrp.h | |||
@@ -46,7 +46,7 @@ extern int gfs2_alloc_blocks(struct gfs2_inode *ip, u64 *bn, unsigned int *n, | |||
46 | bool dinode, u64 *generation); | 46 | bool dinode, u64 *generation); |
47 | 47 | ||
48 | extern int gfs2_rs_alloc(struct gfs2_inode *ip); | 48 | extern int gfs2_rs_alloc(struct gfs2_inode *ip); |
49 | extern void gfs2_rs_deltree(struct gfs2_blkreserv *rs); | 49 | extern void gfs2_rs_deltree(struct gfs2_inode *ip, struct gfs2_blkreserv *rs); |
50 | extern void gfs2_rs_delete(struct gfs2_inode *ip); | 50 | extern void gfs2_rs_delete(struct gfs2_inode *ip); |
51 | extern void __gfs2_free_blocks(struct gfs2_inode *ip, u64 bstart, u32 blen, int meta); | 51 | extern void __gfs2_free_blocks(struct gfs2_inode *ip, u64 bstart, u32 blen, int meta); |
52 | extern void gfs2_free_meta(struct gfs2_inode *ip, u64 bstart, u32 blen); | 52 | extern void gfs2_free_meta(struct gfs2_inode *ip, u64 bstart, u32 blen); |
@@ -73,22 +73,16 @@ extern int gfs2_rgrp_send_discards(struct gfs2_sbd *sdp, u64 offset, | |||
73 | const struct gfs2_bitmap *bi, unsigned minlen, u64 *ptrimmed); | 73 | const struct gfs2_bitmap *bi, unsigned minlen, u64 *ptrimmed); |
74 | extern int gfs2_fitrim(struct file *filp, void __user *argp); | 74 | extern int gfs2_fitrim(struct file *filp, void __user *argp); |
75 | 75 | ||
76 | /* This is how to tell if a multi-block reservation is in the rgrp tree: */ | 76 | /* This is how to tell if a reservation is in the rgrp tree: */ |
77 | static inline int gfs2_rs_active(struct gfs2_blkreserv *rs) | 77 | static inline bool gfs2_rs_active(struct gfs2_blkreserv *rs) |
78 | { | 78 | { |
79 | if (rs && rs->rs_bi) | 79 | return rs && !RB_EMPTY_NODE(&rs->rs_node); |
80 | return 1; | ||
81 | return 0; | ||
82 | } | 80 | } |
83 | 81 | ||
82 | |||
84 | static inline u32 gfs2_bi2rgd_blk(const struct gfs2_bitmap *bi, u32 blk) | 83 | static inline u32 gfs2_bi2rgd_blk(const struct gfs2_bitmap *bi, u32 blk) |
85 | { | 84 | { |
86 | return (bi->bi_start * GFS2_NBBY) + blk; | 85 | return (bi->bi_start * GFS2_NBBY) + blk; |
87 | } | 86 | } |
88 | 87 | ||
89 | static inline u64 gfs2_rs_startblk(const struct gfs2_blkreserv *rs) | ||
90 | { | ||
91 | return gfs2_bi2rgd_blk(rs->rs_bi, rs->rs_biblk) + rs->rs_rgd->rd_data0; | ||
92 | } | ||
93 | |||
94 | #endif /* __RGRP_DOT_H__ */ | 88 | #endif /* __RGRP_DOT_H__ */ |