23 #ifndef _NILFS_SEGBUF_H
24 #define _NILFS_SEGBUF_H
98 #define NILFS_LIST_SEGBUF(head) \
99 list_entry((head), struct nilfs_segment_buffer, sb_list)
100 #define NILFS_NEXT_SEGBUF(segbuf) NILFS_LIST_SEGBUF((segbuf)->sb_list.next)
101 #define NILFS_PREV_SEGBUF(segbuf) NILFS_LIST_SEGBUF((segbuf)->sb_list.prev)
102 #define NILFS_LAST_SEGBUF(head) NILFS_LIST_SEGBUF((head)->prev)
103 #define NILFS_FIRST_SEGBUF(head) NILFS_LIST_SEGBUF((head)->next)
104 #define NILFS_SEGBUF_IS_LAST(segbuf, head) ((segbuf)->sb_list.next == (head))
106 #define nilfs_for_each_segbuf_before(s, t, h) \
107 for ((s) = NILFS_FIRST_SEGBUF(h); (s) != (t); \
108 (s) = NILFS_NEXT_SEGBUF(s))
110 #define NILFS_SEGBUF_FIRST_BH(head) \
111 (list_entry((head)->next, struct buffer_head, b_assoc_buffers))
112 #define NILFS_SEGBUF_NEXT_BH(bh) \
113 (list_entry((bh)->b_assoc_buffers.next, struct buffer_head, \
115 #define NILFS_SEGBUF_BH_IS_LAST(bh, head) ((bh)->b_assoc_buffers.next == head)
130 struct buffer_head **);
143 return segbuf->
sb_sum.nblocks == segbuf->
sb_sum.nsumblk;
148 struct buffer_head *bh)
157 struct buffer_head *bh)
165 struct buffer_head *bh)
168 nilfs_segbuf_add_payload_buffer(segbuf, bh);
169 segbuf->
sb_sum.nfileblk++;
179 static inline void nilfs_destroy_logs(
struct list_head *
logs)