aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2010-10-07 01:19:48 -0400
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2010-10-22 20:24:39 -0400
commit026a7d63d55ba8656ed8c8a0733265cc7d47bb8c (patch)
tree094f32e7aec1c514153b880ce1c6ef4f700fe481 /fs
parentc486f3895d6dc751f7c0f04f0fa67390ce4d168e (diff)
nilfs2: get rid of bdi from nilfs object
Nilfs now can use sb->s_bdi to get backing_dev_info, so we use it instead of ns_bdi on the nilfs object and remove ns_bdi. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs')
-rw-r--r--fs/nilfs2/mdt.c2
-rw-r--r--fs/nilfs2/segbuf.c3
-rw-r--r--fs/nilfs2/super.c5
-rw-r--r--fs/nilfs2/the_nilfs.c4
-rw-r--r--fs/nilfs2/the_nilfs.h2
5 files changed, 7 insertions, 9 deletions
diff --git a/fs/nilfs2/mdt.c b/fs/nilfs2/mdt.c
index d60fdb097d52..39a5b84e2c9f 100644
--- a/fs/nilfs2/mdt.c
+++ b/fs/nilfs2/mdt.c
@@ -457,7 +457,7 @@ int nilfs_mdt_setup_shadow_map(struct inode *inode,
457 struct nilfs_shadow_map *shadow) 457 struct nilfs_shadow_map *shadow)
458{ 458{
459 struct nilfs_mdt_info *mi = NILFS_MDT(inode); 459 struct nilfs_mdt_info *mi = NILFS_MDT(inode);
460 struct backing_dev_info *bdi = NILFS_I_NILFS(inode)->ns_bdi; 460 struct backing_dev_info *bdi = inode->i_sb->s_bdi;
461 461
462 INIT_LIST_HEAD(&shadow->frozen_buffers); 462 INIT_LIST_HEAD(&shadow->frozen_buffers);
463 nilfs_mapping_init_once(&shadow->frozen_data); 463 nilfs_mapping_init_once(&shadow->frozen_data);
diff --git a/fs/nilfs2/segbuf.c b/fs/nilfs2/segbuf.c
index 4588fb9e93df..0f83e93935b2 100644
--- a/fs/nilfs2/segbuf.c
+++ b/fs/nilfs2/segbuf.c
@@ -371,7 +371,8 @@ static int nilfs_segbuf_submit_bio(struct nilfs_segment_buffer *segbuf,
371 struct bio *bio = wi->bio; 371 struct bio *bio = wi->bio;
372 int err; 372 int err;
373 373
374 if (segbuf->sb_nbio > 0 && bdi_write_congested(wi->nilfs->ns_bdi)) { 374 if (segbuf->sb_nbio > 0 &&
375 bdi_write_congested(segbuf->sb_super->s_bdi)) {
375 wait_for_completion(&segbuf->sb_bio_event); 376 wait_for_completion(&segbuf->sb_bio_event);
376 segbuf->sb_nbio--; 377 segbuf->sb_nbio--;
377 if (unlikely(atomic_read(&segbuf->sb_err))) { 378 if (unlikely(atomic_read(&segbuf->sb_err))) {
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index 92e8c769584c..8e77016bafae 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -910,6 +910,7 @@ nilfs_fill_super(struct super_block *sb, void *data, int silent)
910 struct the_nilfs *nilfs; 910 struct the_nilfs *nilfs;
911 struct nilfs_sb_info *sbi; 911 struct nilfs_sb_info *sbi;
912 struct nilfs_root *fsroot; 912 struct nilfs_root *fsroot;
913 struct backing_dev_info *bdi;
913 __u64 cno; 914 __u64 cno;
914 int err; 915 int err;
915 916
@@ -948,7 +949,9 @@ nilfs_fill_super(struct super_block *sb, void *data, int silent)
948 sb->s_export_op = &nilfs_export_ops; 949 sb->s_export_op = &nilfs_export_ops;
949 sb->s_root = NULL; 950 sb->s_root = NULL;
950 sb->s_time_gran = 1; 951 sb->s_time_gran = 1;
951 sb->s_bdi = nilfs->ns_bdi; 952
953 bdi = sb->s_bdev->bd_inode->i_mapping->backing_dev_info;
954 sb->s_bdi = bdi ? : &default_backing_dev_info;
952 955
953 err = load_nilfs(nilfs, sbi); 956 err = load_nilfs(nilfs, sbi);
954 if (err) 957 if (err)
diff --git a/fs/nilfs2/the_nilfs.c b/fs/nilfs2/the_nilfs.c
index a94aa57c4bd9..bd02b6127d35 100644
--- a/fs/nilfs2/the_nilfs.c
+++ b/fs/nilfs2/the_nilfs.c
@@ -535,7 +535,6 @@ int init_nilfs(struct the_nilfs *nilfs, struct nilfs_sb_info *sbi, char *data)
535{ 535{
536 struct super_block *sb = sbi->s_super; 536 struct super_block *sb = sbi->s_super;
537 struct nilfs_super_block *sbp; 537 struct nilfs_super_block *sbp;
538 struct backing_dev_info *bdi;
539 int blocksize; 538 int blocksize;
540 int err; 539 int err;
541 540
@@ -598,9 +597,6 @@ int init_nilfs(struct the_nilfs *nilfs, struct nilfs_sb_info *sbi, char *data)
598 597
599 nilfs->ns_mount_state = le16_to_cpu(sbp->s_state); 598 nilfs->ns_mount_state = le16_to_cpu(sbp->s_state);
600 599
601 bdi = nilfs->ns_bdev->bd_inode->i_mapping->backing_dev_info;
602 nilfs->ns_bdi = bdi ? : &default_backing_dev_info;
603
604 err = nilfs_store_log_cursor(nilfs, sbp); 600 err = nilfs_store_log_cursor(nilfs, sbp);
605 if (err) 601 if (err)
606 goto failed_sbh; 602 goto failed_sbh;
diff --git a/fs/nilfs2/the_nilfs.h b/fs/nilfs2/the_nilfs.h
index bbbc1c748aac..69226e14b745 100644
--- a/fs/nilfs2/the_nilfs.h
+++ b/fs/nilfs2/the_nilfs.h
@@ -47,7 +47,6 @@ enum {
47 * struct the_nilfs - struct to supervise multiple nilfs mount points 47 * struct the_nilfs - struct to supervise multiple nilfs mount points
48 * @ns_flags: flags 48 * @ns_flags: flags
49 * @ns_bdev: block device 49 * @ns_bdev: block device
50 * @ns_bdi: backing dev info
51 * @ns_sem: semaphore for shared states 50 * @ns_sem: semaphore for shared states
52 * @ns_sbh: buffer heads of on-disk super blocks 51 * @ns_sbh: buffer heads of on-disk super blocks
53 * @ns_sbp: pointers to super block data 52 * @ns_sbp: pointers to super block data
@@ -90,7 +89,6 @@ struct the_nilfs {
90 unsigned long ns_flags; 89 unsigned long ns_flags;
91 90
92 struct block_device *ns_bdev; 91 struct block_device *ns_bdev;
93 struct backing_dev_info *ns_bdi;
94 struct rw_semaphore ns_sem; 92 struct rw_semaphore ns_sem;
95 93
96 /* 94 /*