aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2011-03-08 21:05:07 -0500
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2011-03-08 21:05:07 -0500
commit574e6c3145c5754141361c695b58736c294a8ae1 (patch)
tree42fdaf8a107b8a42a1ea239675ac9461e97d0990 /fs/nilfs2
parent3b2ce58b0f3c1633750529713be0e467282abd78 (diff)
nilfs2: move parameters on nilfs_sb_info into nilfs object
This moves four parameter variables on nilfs_sb_info s_resuid, s_resgid, s_interval and s_watermark to the nilfs object. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2')
-rw-r--r--fs/nilfs2/sb.h7
-rw-r--r--fs/nilfs2/segment.c9
-rw-r--r--fs/nilfs2/super.c10
-rw-r--r--fs/nilfs2/the_nilfs.h9
4 files changed, 19 insertions, 16 deletions
diff --git a/fs/nilfs2/sb.h b/fs/nilfs2/sb.h
index d7346c949c81..0512521ba8a4 100644
--- a/fs/nilfs2/sb.h
+++ b/fs/nilfs2/sb.h
@@ -34,13 +34,6 @@ struct nilfs_sc_info;
34 * NILFS super-block data in memory 34 * NILFS super-block data in memory
35 */ 35 */
36struct nilfs_sb_info { 36struct nilfs_sb_info {
37 uid_t s_resuid;
38 gid_t s_resgid;
39
40 unsigned long s_interval; /* construction interval */
41 unsigned long s_watermark; /* threshold of data amount
42 for the segment construction */
43
44 /* Fundamental members */ 37 /* Fundamental members */
45 struct super_block *s_super; /* reverse pointer to super_block */ 38 struct super_block *s_super; /* reverse pointer to super_block */
46 struct the_nilfs *s_nilfs; 39 struct the_nilfs *s_nilfs;
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
index 851bcd3890c8..a32d9cb2842a 100644
--- a/fs/nilfs2/segment.c
+++ b/fs/nilfs2/segment.c
@@ -2676,6 +2676,7 @@ static void nilfs_segctor_kill_thread(struct nilfs_sc_info *sci)
2676static struct nilfs_sc_info *nilfs_segctor_new(struct nilfs_sb_info *sbi, 2676static struct nilfs_sc_info *nilfs_segctor_new(struct nilfs_sb_info *sbi,
2677 struct nilfs_root *root) 2677 struct nilfs_root *root)
2678{ 2678{
2679 struct the_nilfs *nilfs = sbi->s_nilfs;
2679 struct nilfs_sc_info *sci; 2680 struct nilfs_sc_info *sci;
2680 2681
2681 sci = kzalloc(sizeof(*sci), GFP_KERNEL); 2682 sci = kzalloc(sizeof(*sci), GFP_KERNEL);
@@ -2703,10 +2704,10 @@ static struct nilfs_sc_info *nilfs_segctor_new(struct nilfs_sb_info *sbi,
2703 sci->sc_mjcp_freq = HZ * NILFS_SC_DEFAULT_SR_FREQ; 2704 sci->sc_mjcp_freq = HZ * NILFS_SC_DEFAULT_SR_FREQ;
2704 sci->sc_watermark = NILFS_SC_DEFAULT_WATERMARK; 2705 sci->sc_watermark = NILFS_SC_DEFAULT_WATERMARK;
2705 2706
2706 if (sbi->s_interval) 2707 if (nilfs->ns_interval)
2707 sci->sc_interval = sbi->s_interval; 2708 sci->sc_interval = nilfs->ns_interval;
2708 if (sbi->s_watermark) 2709 if (nilfs->ns_watermark)
2709 sci->sc_watermark = sbi->s_watermark; 2710 sci->sc_watermark = nilfs->ns_watermark;
2710 return sci; 2711 return sci;
2711} 2712}
2712 2713
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index 0576cb21d699..2f17a2f9ef9c 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -729,7 +729,7 @@ int nilfs_store_magic_and_option(struct super_block *sb,
729 struct nilfs_super_block *sbp, 729 struct nilfs_super_block *sbp,
730 char *data) 730 char *data)
731{ 731{
732 struct nilfs_sb_info *sbi = NILFS_SB(sb); 732 struct the_nilfs *nilfs = NILFS_SB(sb)->s_nilfs;
733 733
734 sb->s_magic = le16_to_cpu(sbp->s_magic); 734 sb->s_magic = le16_to_cpu(sbp->s_magic);
735 735
@@ -740,10 +740,10 @@ int nilfs_store_magic_and_option(struct super_block *sb,
740 740
741 nilfs_set_default_options(sb, sbp); 741 nilfs_set_default_options(sb, sbp);
742 742
743 sbi->s_resuid = le16_to_cpu(sbp->s_def_resuid); 743 nilfs->ns_resuid = le16_to_cpu(sbp->s_def_resuid);
744 sbi->s_resgid = le16_to_cpu(sbp->s_def_resgid); 744 nilfs->ns_resgid = le16_to_cpu(sbp->s_def_resgid);
745 sbi->s_interval = le32_to_cpu(sbp->s_c_interval); 745 nilfs->ns_interval = le32_to_cpu(sbp->s_c_interval);
746 sbi->s_watermark = le32_to_cpu(sbp->s_c_block_max); 746 nilfs->ns_watermark = le32_to_cpu(sbp->s_c_block_max);
747 747
748 return !parse_options(data, sb, 0) ? -EINVAL : 0 ; 748 return !parse_options(data, sb, 0) ? -EINVAL : 0 ;
749} 749}
diff --git a/fs/nilfs2/the_nilfs.h b/fs/nilfs2/the_nilfs.h
index 438278041d80..4a9bf3913c9c 100644
--- a/fs/nilfs2/the_nilfs.h
+++ b/fs/nilfs2/the_nilfs.h
@@ -73,6 +73,10 @@ enum {
73 * @ns_cptree_lock: lock protecting @ns_cptree 73 * @ns_cptree_lock: lock protecting @ns_cptree
74 * @ns_gc_inodes: dummy inodes to keep live blocks 74 * @ns_gc_inodes: dummy inodes to keep live blocks
75 * @ns_mount_opt: mount options 75 * @ns_mount_opt: mount options
76 * @ns_resuid: uid for reserved blocks
77 * @ns_resgid: gid for reserved blocks
78 * @ns_interval: checkpoint creation interval
79 * @ns_watermark: watermark for the number of dirty buffers
76 * @ns_blocksize_bits: bit length of block size 80 * @ns_blocksize_bits: bit length of block size
77 * @ns_blocksize: block size 81 * @ns_blocksize: block size
78 * @ns_nsegments: number of segments in filesystem 82 * @ns_nsegments: number of segments in filesystem
@@ -152,6 +156,11 @@ struct the_nilfs {
152 /* Mount options */ 156 /* Mount options */
153 unsigned long ns_mount_opt; 157 unsigned long ns_mount_opt;
154 158
159 uid_t ns_resuid;
160 gid_t ns_resgid;
161 unsigned long ns_interval;
162 unsigned long ns_watermark;
163
155 /* Disk layout information (static) */ 164 /* Disk layout information (static) */
156 unsigned int ns_blocksize_bits; 165 unsigned int ns_blocksize_bits;
157 unsigned int ns_blocksize; 166 unsigned int ns_blocksize;