diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2009-12-16 10:55:40 -0500 |
---|---|---|
committer | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2010-02-12 22:26:03 -0500 |
commit | d1c6b72a7224f6cd6924f7079f79580cde696d68 (patch) | |
tree | 0046a65c661f0bdade1e6afe1d995ea624ede7cb /fs/nilfs2/segbuf.c | |
parent | e605f0a7249d8002c660af379f884896cbaa45ae (diff) |
nilfs2: move iterator to write log into segment buffer
This moves iterator to submit write requests for a series of logs into
segbuf.c, and hides nilfs_segbuf_write() and nilfs_segbuf_wait() in
the file.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/segbuf.c')
-rw-r--r-- | fs/nilfs2/segbuf.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/nilfs2/segbuf.c b/fs/nilfs2/segbuf.c index 645c78656aa0..ab56fe44e377 100644 --- a/fs/nilfs2/segbuf.c +++ b/fs/nilfs2/segbuf.c | |||
@@ -40,6 +40,11 @@ struct nilfs_write_info { | |||
40 | }; | 40 | }; |
41 | 41 | ||
42 | 42 | ||
43 | static int nilfs_segbuf_write(struct nilfs_segment_buffer *segbuf, | ||
44 | struct the_nilfs *nilfs); | ||
45 | static int nilfs_segbuf_wait(struct nilfs_segment_buffer *segbuf); | ||
46 | |||
47 | |||
43 | static struct kmem_cache *nilfs_segbuf_cachep; | 48 | static struct kmem_cache *nilfs_segbuf_cachep; |
44 | 49 | ||
45 | static void nilfs_segbuf_init_once(void *obj) | 50 | static void nilfs_segbuf_init_once(void *obj) |
@@ -302,6 +307,19 @@ void nilfs_truncate_logs(struct list_head *logs, | |||
302 | } | 307 | } |
303 | } | 308 | } |
304 | 309 | ||
310 | int nilfs_write_logs(struct list_head *logs, struct the_nilfs *nilfs) | ||
311 | { | ||
312 | struct nilfs_segment_buffer *segbuf; | ||
313 | int ret = 0; | ||
314 | |||
315 | list_for_each_entry(segbuf, logs, sb_list) { | ||
316 | ret = nilfs_segbuf_write(segbuf, nilfs); | ||
317 | if (ret) | ||
318 | break; | ||
319 | } | ||
320 | return ret; | ||
321 | } | ||
322 | |||
305 | int nilfs_wait_on_logs(struct list_head *logs) | 323 | int nilfs_wait_on_logs(struct list_head *logs) |
306 | { | 324 | { |
307 | struct nilfs_segment_buffer *segbuf; | 325 | struct nilfs_segment_buffer *segbuf; |