From 61a189e9c62359cd12b2aa3bd6ab9cffa6cf2745 Mon Sep 17 00:00:00 2001 From: Ryusuke Konishi Date: Wed, 18 Nov 2009 17:25:12 +0900 Subject: nilfs2: move routine marking segment usage dirty into sufile This adds nilfs_sufile_mark_dirty() function in sufile to replace nilfs_touch_segusage() function in log writer code. This is a preparation for the further cleanup which will move out low level sufile operations in the log writer. Signed-off-by: Ryusuke Konishi --- fs/nilfs2/sufile.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'fs/nilfs2/sufile.c') diff --git a/fs/nilfs2/sufile.c b/fs/nilfs2/sufile.c index 5f18acab9dd..d560f882a86 100644 --- a/fs/nilfs2/sufile.c +++ b/fs/nilfs2/sufile.c @@ -501,6 +501,25 @@ void nilfs_sufile_put_segment_usage(struct inode *sufile, __u64 segnum, brelse(bh); } +/** + * nilfs_sufile_mark_dirty - mark the buffer having a segment usage dirty + * @sufile: inode of segment usage file + * @segnum: segment number + */ +int nilfs_sufile_mark_dirty(struct inode *sufile, __u64 segnum) +{ + struct buffer_head *bh; + int ret; + + ret = nilfs_sufile_get_segment_usage_block(sufile, segnum, 0, &bh); + if (!ret) { + nilfs_mdt_mark_buffer_dirty(bh); + nilfs_mdt_mark_dirty(sufile); + brelse(bh); + } + return ret; +} + /** * nilfs_sufile_get_stat - get segment usage statistics * @sufile: inode of segment usage file -- cgit v1.2.3-70-g09d2