Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 174710
b: refs/heads/master
c: 61a189e
h: refs/heads/master
v: v3
  • Loading branch information
Ryusuke Konishi committed Nov 20, 2009
1 parent 09e6ad8 commit bff6cc5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 70622a2091647840013c1e982e56a8808768847e
refs/heads/master: 61a189e9c62359cd12b2aa3bd6ab9cffa6cf2745
19 changes: 2 additions & 17 deletions trunk/fs/nilfs2/segment.c
Original file line number Diff line number Diff line change
Expand Up @@ -1273,21 +1273,6 @@ static int nilfs_segctor_collect_blocks(struct nilfs_sc_info *sci, int mode)
return err;
}

static int nilfs_touch_segusage(struct inode *sufile, __u64 segnum)
{
struct buffer_head *bh_su;
struct nilfs_segment_usage *raw_su;
int err;

err = nilfs_sufile_get_segment_usage(sufile, segnum, &raw_su, &bh_su);
if (unlikely(err))
return err;
nilfs_mdt_mark_buffer_dirty(bh_su);
nilfs_mdt_mark_dirty(sufile);
nilfs_sufile_put_segment_usage(sufile, segnum, bh_su);
return 0;
}

static int nilfs_segctor_begin_construction(struct nilfs_sc_info *sci,
struct the_nilfs *nilfs)
{
Expand All @@ -1312,7 +1297,7 @@ static int nilfs_segctor_begin_construction(struct nilfs_sc_info *sci,
}
sci->sc_segbuf_nblocks = segbuf->sb_rest_blocks;

err = nilfs_touch_segusage(nilfs->ns_sufile, segbuf->sb_segnum);
err = nilfs_sufile_mark_dirty(nilfs->ns_sufile, segbuf->sb_segnum);
if (unlikely(err))
return err;

Expand Down Expand Up @@ -1352,7 +1337,7 @@ static int nilfs_segctor_extend_segments(struct nilfs_sc_info *sci,
* not be dirty. The following call ensures that the buffer is dirty
* and will pin the buffer on memory until the sufile is written.
*/
err = nilfs_touch_segusage(sufile, prev->sb_nextnum);
err = nilfs_sufile_mark_dirty(sufile, prev->sb_nextnum);
if (unlikely(err))
return err;

Expand Down
19 changes: 19 additions & 0 deletions trunk/fs/nilfs2/sufile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/nilfs2/sufile.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ int nilfs_sufile_get_segment_usage(struct inode *, __u64,
struct buffer_head **);
void nilfs_sufile_put_segment_usage(struct inode *, __u64,
struct buffer_head *);
int nilfs_sufile_mark_dirty(struct inode *sufile, __u64 segnum);
int nilfs_sufile_get_stat(struct inode *, struct nilfs_sustat *);
ssize_t nilfs_sufile_get_suinfo(struct inode *, __u64, void *, unsigned,
size_t);
Expand Down

0 comments on commit bff6cc5

Please sign in to comment.