nilfs2: add iterator for segment buffers
This adds a few iterator functions for segment buffers to make it easy to handle multiple series of logs. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
This commit is contained in:
@@ -164,16 +164,18 @@ nilfs_segbuf_add_file_buffer(struct nilfs_segment_buffer *segbuf,
|
||||
segbuf->sb_sum.nfileblk++;
|
||||
}
|
||||
|
||||
void nilfs_release_buffers(struct list_head *);
|
||||
|
||||
static inline void nilfs_segbuf_clear(struct nilfs_segment_buffer *segbuf)
|
||||
{
|
||||
nilfs_release_buffers(&segbuf->sb_segsum_buffers);
|
||||
nilfs_release_buffers(&segbuf->sb_payload_buffers);
|
||||
}
|
||||
|
||||
int nilfs_segbuf_write(struct nilfs_segment_buffer *segbuf,
|
||||
struct the_nilfs *nilfs);
|
||||
int nilfs_segbuf_wait(struct nilfs_segment_buffer *segbuf);
|
||||
|
||||
void nilfs_clear_logs(struct list_head *logs);
|
||||
void nilfs_truncate_logs(struct list_head *logs,
|
||||
struct nilfs_segment_buffer *last);
|
||||
int nilfs_wait_on_logs(struct list_head *logs);
|
||||
|
||||
static inline void nilfs_destroy_logs(struct list_head *logs)
|
||||
{
|
||||
nilfs_truncate_logs(logs, NULL);
|
||||
}
|
||||
|
||||
#endif /* _NILFS_SEGBUF_H */
|
||||
|
Reference in New Issue
Block a user