Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142641
b: refs/heads/master
c: c96fa46
h: refs/heads/master
i:
  142639: 9db4f78
v: v3
  • Loading branch information
Ryusuke Konishi authored and Linus Torvalds committed Apr 7, 2009
1 parent b7cbc15 commit 066b269
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 458c5b0822a669d170fdb7bb16c9145f652ebe06
refs/heads/master: c96fa464a567a2a8796009af0e79bc68af73f485
9 changes: 9 additions & 0 deletions trunk/fs/nilfs2/segment.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,9 @@ static void nilfs_segctor_begin_finfo(struct nilfs_sc_info *sci,
sci->sc_binfo_ptr = sci->sc_finfo_ptr;
nilfs_segctor_map_segsum_entry(
sci, &sci->sc_binfo_ptr, sizeof(struct nilfs_finfo));

if (inode->i_sb && !test_bit(NILFS_SC_HAVE_DELTA, &sci->sc_flags))
set_bit(NILFS_SC_HAVE_DELTA, &sci->sc_flags);
/* skip finfo */
}

Expand Down Expand Up @@ -887,6 +890,11 @@ static int nilfs_segctor_fill_in_checkpoint(struct nilfs_sc_info *sci)
raw_cp->cp_create = cpu_to_le64(sci->sc_seg_ctime);
raw_cp->cp_cno = cpu_to_le64(nilfs->ns_cno);

if (test_bit(NILFS_SC_HAVE_DELTA, &sci->sc_flags))
nilfs_checkpoint_clear_minor(raw_cp);
else
nilfs_checkpoint_set_minor(raw_cp);

nilfs_write_inode_common(sbi->s_ifile, &raw_cp->cp_ifile_inode, 1);
nilfs_cpfile_put_checkpoint(nilfs->ns_cpfile, nilfs->ns_cno, bh_cp);
return 0;
Expand Down Expand Up @@ -2091,6 +2099,7 @@ static void nilfs_segctor_complete_write(struct nilfs_sc_info *sci)
nilfs_set_last_segment(nilfs, segbuf->sb_pseg_start,
segbuf->sb_sum.seg_seq, nilfs->ns_cno);

clear_bit(NILFS_SC_HAVE_DELTA, &sci->sc_flags);
clear_bit(NILFS_SC_DIRTY, &sci->sc_flags);
set_bit(NILFS_SC_SUPER_ROOT, &sci->sc_flags);
} else
Expand Down
3 changes: 3 additions & 0 deletions trunk/fs/nilfs2/segment.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ enum {
NILFS_SC_SUPER_ROOT, /* The latest segment has a super root */
NILFS_SC_PRIOR_FLUSH, /* Requesting immediate flush without making a
checkpoint */
NILFS_SC_HAVE_DELTA, /* Next checkpoint will have update of files
other than DAT, cpfile, sufile, or files
moved by GC */
};

/* sc_state */
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/nilfs2_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ enum {
NILFS_CHECKPOINT_SNAPSHOT,
NILFS_CHECKPOINT_INVALID,
NILFS_CHECKPOINT_SKETCH,
NILFS_CHECKPOINT_MINOR,
};

#define NILFS_CHECKPOINT_FNS(flag, name) \
Expand All @@ -494,6 +495,7 @@ nilfs_checkpoint_##name(const struct nilfs_checkpoint *cp) \

NILFS_CHECKPOINT_FNS(SNAPSHOT, snapshot)
NILFS_CHECKPOINT_FNS(INVALID, invalid)
NILFS_CHECKPOINT_FNS(MINOR, minor)

/**
* struct nilfs_cpinfo - checkpoint information
Expand Down Expand Up @@ -526,6 +528,7 @@ nilfs_cpinfo_##name(const struct nilfs_cpinfo *cpinfo) \

NILFS_CPINFO_FNS(SNAPSHOT, snapshot)
NILFS_CPINFO_FNS(INVALID, invalid)
NILFS_CPINFO_FNS(MINOR, minor)


/**
Expand Down

0 comments on commit 066b269

Please sign in to comment.