diff options
Diffstat (limited to 'fs/nilfs2/segbuf.h')
-rw-r--r-- | fs/nilfs2/segbuf.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/fs/nilfs2/segbuf.h b/fs/nilfs2/segbuf.h index 85fbb66455e2..b04f08cc2397 100644 --- a/fs/nilfs2/segbuf.h +++ b/fs/nilfs2/segbuf.h | |||
@@ -54,17 +54,6 @@ struct nilfs_segsum_info { | |||
54 | sector_t next; | 54 | sector_t next; |
55 | }; | 55 | }; |
56 | 56 | ||
57 | /* macro for the flags */ | ||
58 | #define NILFS_SEG_HAS_SR(sum) ((sum)->flags & NILFS_SS_SR) | ||
59 | #define NILFS_SEG_LOGBGN(sum) ((sum)->flags & NILFS_SS_LOGBGN) | ||
60 | #define NILFS_SEG_LOGEND(sum) ((sum)->flags & NILFS_SS_LOGEND) | ||
61 | #define NILFS_SEG_DSYNC(sum) ((sum)->flags & NILFS_SS_SYNDT) | ||
62 | #define NILFS_SEG_SIMPLEX(sum) \ | ||
63 | (((sum)->flags & (NILFS_SS_LOGBGN | NILFS_SS_LOGEND)) == \ | ||
64 | (NILFS_SS_LOGBGN | NILFS_SS_LOGEND)) | ||
65 | |||
66 | #define NILFS_SEG_EMPTY(sum) ((sum)->nblocks == (sum)->nsumblk) | ||
67 | |||
68 | /** | 57 | /** |
69 | * struct nilfs_segment_buffer - Segment buffer | 58 | * struct nilfs_segment_buffer - Segment buffer |
70 | * @sb_super: back pointer to a superblock struct | 59 | * @sb_super: back pointer to a superblock struct |
@@ -141,6 +130,19 @@ int nilfs_segbuf_extend_payload(struct nilfs_segment_buffer *, | |||
141 | struct buffer_head **); | 130 | struct buffer_head **); |
142 | void nilfs_segbuf_fill_in_segsum(struct nilfs_segment_buffer *); | 131 | void nilfs_segbuf_fill_in_segsum(struct nilfs_segment_buffer *); |
143 | 132 | ||
133 | static inline int nilfs_segbuf_simplex(struct nilfs_segment_buffer *segbuf) | ||
134 | { | ||
135 | unsigned int flags = segbuf->sb_sum.flags; | ||
136 | |||
137 | return (flags & (NILFS_SS_LOGBGN | NILFS_SS_LOGEND)) == | ||
138 | (NILFS_SS_LOGBGN | NILFS_SS_LOGEND); | ||
139 | } | ||
140 | |||
141 | static inline int nilfs_segbuf_empty(struct nilfs_segment_buffer *segbuf) | ||
142 | { | ||
143 | return segbuf->sb_sum.nblocks == segbuf->sb_sum.nsumblk; | ||
144 | } | ||
145 | |||
144 | static inline void | 146 | static inline void |
145 | nilfs_segbuf_add_segsum_buffer(struct nilfs_segment_buffer *segbuf, | 147 | nilfs_segbuf_add_segsum_buffer(struct nilfs_segment_buffer *segbuf, |
146 | struct buffer_head *bh) | 148 | struct buffer_head *bh) |