Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196016
b: refs/heads/master
c: 50614bc
h: refs/heads/master
v: v3
  • Loading branch information
Ryusuke Konishi committed May 10, 2010
1 parent b876d7e commit 53d611b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 4 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: 9f130263f30233a44a3175db3218dd89af143d64
refs/heads/master: 50614bcf29d0cec6df5b84c0d8331e8b8c7d72a7
2 changes: 2 additions & 0 deletions trunk/fs/nilfs2/recovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ static void store_segsum_info(struct nilfs_segsum_info *ssi,

ssi->nsumblk = DIV_ROUND_UP(ssi->sumbytes, blocksize);
ssi->nfileblk = ssi->nblocks - ssi->nsumblk - !!NILFS_SEG_HAS_SR(ssi);

/* need to verify ->ss_bytes field if read ->ss_cno */
}

/**
Expand Down
4 changes: 3 additions & 1 deletion trunk/fs/nilfs2/segbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ int nilfs_segbuf_extend_payload(struct nilfs_segment_buffer *segbuf,
}

int nilfs_segbuf_reset(struct nilfs_segment_buffer *segbuf, unsigned flags,
time_t ctime)
time_t ctime, __u64 cno)
{
int err;

Expand All @@ -147,6 +147,7 @@ int nilfs_segbuf_reset(struct nilfs_segment_buffer *segbuf, unsigned flags,
segbuf->sb_sum.sumbytes = sizeof(struct nilfs_segment_summary);
segbuf->sb_sum.nfinfo = segbuf->sb_sum.nfileblk = 0;
segbuf->sb_sum.ctime = ctime;
segbuf->sb_sum.cno = cno;
return 0;
}

Expand All @@ -172,6 +173,7 @@ void nilfs_segbuf_fill_in_segsum(struct nilfs_segment_buffer *segbuf)
raw_sum->ss_nfinfo = cpu_to_le32(segbuf->sb_sum.nfinfo);
raw_sum->ss_sumbytes = cpu_to_le32(segbuf->sb_sum.sumbytes);
raw_sum->ss_pad = 0;
raw_sum->ss_cno = cpu_to_le64(segbuf->sb_sum.cno);
}

/*
Expand Down
4 changes: 3 additions & 1 deletion trunk/fs/nilfs2/segbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* @sumbytes: Byte count of segment summary
* @nfileblk: Total number of file blocks
* @seg_seq: Segment sequence number
* @cno: Checkpoint number
* @ctime: Creation time
* @next: Block number of the next full segment
*/
Expand All @@ -48,6 +49,7 @@ struct nilfs_segsum_info {
unsigned long sumbytes;
unsigned long nfileblk;
u64 seg_seq;
__u64 cno;
time_t ctime;
sector_t next;
};
Expand Down Expand Up @@ -135,7 +137,7 @@ void nilfs_segbuf_map_cont(struct nilfs_segment_buffer *segbuf,
struct nilfs_segment_buffer *prev);
void nilfs_segbuf_set_next_segnum(struct nilfs_segment_buffer *, __u64,
struct the_nilfs *);
int nilfs_segbuf_reset(struct nilfs_segment_buffer *, unsigned, time_t);
int nilfs_segbuf_reset(struct nilfs_segment_buffer *, unsigned, time_t, __u64);
int nilfs_segbuf_extend_segsum(struct nilfs_segment_buffer *);
int nilfs_segbuf_extend_payload(struct nilfs_segment_buffer *,
struct buffer_head **);
Expand Down
3 changes: 2 additions & 1 deletion trunk/fs/nilfs2/segment.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ static int nilfs_segctor_reset_segment_buffer(struct nilfs_sc_info *sci)

if (nilfs_doing_gc())
flags = NILFS_SS_GC;
err = nilfs_segbuf_reset(segbuf, flags, sci->sc_seg_ctime);
err = nilfs_segbuf_reset(segbuf, flags, sci->sc_seg_ctime,
sci->sc_sbi->s_nilfs->ns_cno);
if (unlikely(err))
return err;

Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/nilfs2_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ union nilfs_binfo {
* @ss_nfinfo: number of finfo structures
* @ss_sumbytes: total size of segment summary in bytes
* @ss_pad: padding
* @ss_cno: checkpoint number
*/
struct nilfs_segment_summary {
__le32 ss_datasum;
Expand All @@ -391,6 +392,7 @@ struct nilfs_segment_summary {
__le32 ss_nfinfo;
__le32 ss_sumbytes;
__le32 ss_pad;
__le64 ss_cno;
/* array of finfo structures */
};

Expand Down

0 comments on commit 53d611b

Please sign in to comment.