summaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/segbuf.h
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2009-11-29 16:51:16 +0900
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2009-11-30 21:06:35 +0900
commite29df395bc6d2d0c89b3d8a5939a24b1b43c2fb6 (patch)
tree6d6f570d8158d7a18570492d9f5f5edf843ed28c /fs/nilfs2/segbuf.h
parent9c965bac169f786cc6cca8ff81d3b636e923c960 (diff)
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>
Diffstat (limited to 'fs/nilfs2/segbuf.h')
-rw-r--r--fs/nilfs2/segbuf.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/fs/nilfs2/segbuf.h b/fs/nilfs2/segbuf.h
index 241a00dc498..7fbaf5eee01 100644
--- a/fs/nilfs2/segbuf.h
+++ b/fs/nilfs2/segbuf.h
@@ -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 */