From f7a449dced5d57994412821b9f07bb08d179b8c7 Mon Sep 17 00:00:00 2001 From: Ryusuke Konishi Date: Sat, 30 Apr 2011 18:56:12 +0900 Subject: [PATCH] --- yaml --- r: 247925 b: refs/heads/master c: 6c6de1aa65189c37cc3c9af78da756c06a99899b h: refs/heads/master i: 247923: ad9f5e3e37c9dfd0486ca30bc0282315eccb79e1 v: v3 --- [refs] | 2 +- trunk/fs/nilfs2/segbuf.c | 5 ++++- trunk/fs/nilfs2/segment.c | 2 +- trunk/include/linux/nilfs2_fs.h | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 626865b03c2b..19c38fea1d55 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1cb2d38cb3e59d58e8321a0592e84b5761afb063 +refs/heads/master: 6c6de1aa65189c37cc3c9af78da756c06a99899b diff --git a/trunk/fs/nilfs2/segbuf.c b/trunk/fs/nilfs2/segbuf.c index 410ec2b1af4f..850a7c0228fb 100644 --- a/trunk/fs/nilfs2/segbuf.c +++ b/trunk/fs/nilfs2/segbuf.c @@ -239,12 +239,15 @@ nilfs_segbuf_fill_in_super_root_crc(struct nilfs_segment_buffer *segbuf, u32 seed) { struct nilfs_super_root *raw_sr; + struct the_nilfs *nilfs = segbuf->sb_super->s_fs_info; + unsigned srsize; u32 crc; raw_sr = (struct nilfs_super_root *)segbuf->sb_super_root->b_data; + srsize = NILFS_SR_BYTES(nilfs->ns_inode_size); crc = crc32_le(seed, (unsigned char *)raw_sr + sizeof(raw_sr->sr_sum), - NILFS_SR_BYTES - sizeof(raw_sr->sr_sum)); + srsize - sizeof(raw_sr->sr_sum)); raw_sr->sr_sum = cpu_to_le32(crc); } diff --git a/trunk/fs/nilfs2/segment.c b/trunk/fs/nilfs2/segment.c index abbfab974700..8006d0cd4440 100644 --- a/trunk/fs/nilfs2/segment.c +++ b/trunk/fs/nilfs2/segment.c @@ -894,7 +894,7 @@ static void nilfs_segctor_fill_in_super_root(struct nilfs_sc_info *sci, bh_sr = NILFS_LAST_SEGBUF(&sci->sc_segbufs)->sb_super_root; raw_sr = (struct nilfs_super_root *)bh_sr->b_data; - raw_sr->sr_bytes = cpu_to_le16(NILFS_SR_BYTES); + raw_sr->sr_bytes = cpu_to_le16(NILFS_SR_BYTES(isz)); raw_sr->sr_nongc_ctime = cpu_to_le64(nilfs_doing_gc() ? nilfs->ns_nongc_ctime : sci->sc_seg_ctime); diff --git a/trunk/include/linux/nilfs2_fs.h b/trunk/include/linux/nilfs2_fs.h index 8768c469e93e..bd8678f8a421 100644 --- a/trunk/include/linux/nilfs2_fs.h +++ b/trunk/include/linux/nilfs2_fs.h @@ -107,7 +107,7 @@ struct nilfs_super_root { #define NILFS_SR_DAT_OFFSET(inode_size) NILFS_SR_MDT_OFFSET(inode_size, 0) #define NILFS_SR_CPFILE_OFFSET(inode_size) NILFS_SR_MDT_OFFSET(inode_size, 1) #define NILFS_SR_SUFILE_OFFSET(inode_size) NILFS_SR_MDT_OFFSET(inode_size, 2) -#define NILFS_SR_BYTES (sizeof(struct nilfs_super_root)) +#define NILFS_SR_BYTES(inode_size) NILFS_SR_MDT_OFFSET(inode_size, 3) /* * Maximal mount counts