aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-02-12 16:50:21 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-12 16:50:21 -0500
commit6bec0035286119eefc32a5b1102127e6a4032cb2 (patch)
tree440fab001b4c877b0b0c9fd62d8392e956e387e3 /fs/nilfs2
parent5d8e7fb6916556e9b476de33404e8c9e2c9aee61 (diff)
parent15d0f5ea348b9c4e6d41df294dde38a56a39c7bf (diff)
Merge branch 'for-3.20/bdi' of git://git.kernel.dk/linux-block
Pull backing device changes from Jens Axboe: "This contains a cleanup of how the backing device is handled, in preparation for a rework of the life time rules. In this part, the most important change is to split the unrelated nommu mmap flags from it, but also removing a backing_dev_info pointer from the address_space (and inode), and a cleanup of other various minor bits. Christoph did all the work here, I just fixed an oops with pages that have a swap backing. Arnd fixed a missing export, and Oleg killed the lustre backing_dev_info from staging. Last patch was from Al, unexporting parts that are now no longer needed outside" * 'for-3.20/bdi' of git://git.kernel.dk/linux-block: Make super_blocks and sb_lock static mtd: export new mtd_mmap_capabilities fs: make inode_to_bdi() handle NULL inode staging/lustre/llite: get rid of backing_dev_info fs: remove default_backing_dev_info fs: don't reassign dirty inodes to default_backing_dev_info nfs: don't call bdi_unregister ceph: remove call to bdi_unregister fs: remove mapping->backing_dev_info fs: export inode_to_bdi and use it in favor of mapping->backing_dev_info nilfs2: set up s_bdi like the generic mount_bdev code block_dev: get bdev inode bdi directly from the block device block_dev: only write bdev inode on close fs: introduce f_op->mmap_capabilities for nommu mmap support fs: kill BDI_CAP_SWAP_BACKED fs: deduplicate noop_backing_dev_info
Diffstat (limited to 'fs/nilfs2')
-rw-r--r--fs/nilfs2/gcinode.c1
-rw-r--r--fs/nilfs2/mdt.c6
-rw-r--r--fs/nilfs2/page.c4
-rw-r--r--fs/nilfs2/page.h3
-rw-r--r--fs/nilfs2/super.c6
5 files changed, 6 insertions, 14 deletions
diff --git a/fs/nilfs2/gcinode.c b/fs/nilfs2/gcinode.c
index 57ceaf33d177..748ca238915a 100644
--- a/fs/nilfs2/gcinode.c
+++ b/fs/nilfs2/gcinode.c
@@ -172,7 +172,6 @@ int nilfs_init_gcinode(struct inode *inode)
172 inode->i_mode = S_IFREG; 172 inode->i_mode = S_IFREG;
173 mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS); 173 mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS);
174 inode->i_mapping->a_ops = &empty_aops; 174 inode->i_mapping->a_ops = &empty_aops;
175 inode->i_mapping->backing_dev_info = inode->i_sb->s_bdi;
176 175
177 ii->i_flags = 0; 176 ii->i_flags = 0;
178 nilfs_bmap_init_gc(ii->i_bmap); 177 nilfs_bmap_init_gc(ii->i_bmap);
diff --git a/fs/nilfs2/mdt.c b/fs/nilfs2/mdt.c
index c4dcd1db57ee..892cf5ffdb8e 100644
--- a/fs/nilfs2/mdt.c
+++ b/fs/nilfs2/mdt.c
@@ -429,7 +429,6 @@ int nilfs_mdt_init(struct inode *inode, gfp_t gfp_mask, size_t objsz)
429 429
430 inode->i_mode = S_IFREG; 430 inode->i_mode = S_IFREG;
431 mapping_set_gfp_mask(inode->i_mapping, gfp_mask); 431 mapping_set_gfp_mask(inode->i_mapping, gfp_mask);
432 inode->i_mapping->backing_dev_info = inode->i_sb->s_bdi;
433 432
434 inode->i_op = &def_mdt_iops; 433 inode->i_op = &def_mdt_iops;
435 inode->i_fop = &def_mdt_fops; 434 inode->i_fop = &def_mdt_fops;
@@ -457,13 +456,12 @@ int nilfs_mdt_setup_shadow_map(struct inode *inode,
457 struct nilfs_shadow_map *shadow) 456 struct nilfs_shadow_map *shadow)
458{ 457{
459 struct nilfs_mdt_info *mi = NILFS_MDT(inode); 458 struct nilfs_mdt_info *mi = NILFS_MDT(inode);
460 struct backing_dev_info *bdi = inode->i_sb->s_bdi;
461 459
462 INIT_LIST_HEAD(&shadow->frozen_buffers); 460 INIT_LIST_HEAD(&shadow->frozen_buffers);
463 address_space_init_once(&shadow->frozen_data); 461 address_space_init_once(&shadow->frozen_data);
464 nilfs_mapping_init(&shadow->frozen_data, inode, bdi); 462 nilfs_mapping_init(&shadow->frozen_data, inode);
465 address_space_init_once(&shadow->frozen_btnodes); 463 address_space_init_once(&shadow->frozen_btnodes);
466 nilfs_mapping_init(&shadow->frozen_btnodes, inode, bdi); 464 nilfs_mapping_init(&shadow->frozen_btnodes, inode);
467 mi->mi_shadow = shadow; 465 mi->mi_shadow = shadow;
468 return 0; 466 return 0;
469} 467}
diff --git a/fs/nilfs2/page.c b/fs/nilfs2/page.c
index da276640f776..700ecbcca55d 100644
--- a/fs/nilfs2/page.c
+++ b/fs/nilfs2/page.c
@@ -461,14 +461,12 @@ unsigned nilfs_page_count_clean_buffers(struct page *page,
461 return nc; 461 return nc;
462} 462}
463 463
464void nilfs_mapping_init(struct address_space *mapping, struct inode *inode, 464void nilfs_mapping_init(struct address_space *mapping, struct inode *inode)
465 struct backing_dev_info *bdi)
466{ 465{
467 mapping->host = inode; 466 mapping->host = inode;
468 mapping->flags = 0; 467 mapping->flags = 0;
469 mapping_set_gfp_mask(mapping, GFP_NOFS); 468 mapping_set_gfp_mask(mapping, GFP_NOFS);
470 mapping->private_data = NULL; 469 mapping->private_data = NULL;
471 mapping->backing_dev_info = bdi;
472 mapping->a_ops = &empty_aops; 470 mapping->a_ops = &empty_aops;
473} 471}
474 472
diff --git a/fs/nilfs2/page.h b/fs/nilfs2/page.h
index ef30c5c2426f..a43b8287d012 100644
--- a/fs/nilfs2/page.h
+++ b/fs/nilfs2/page.h
@@ -57,8 +57,7 @@ int nilfs_copy_dirty_pages(struct address_space *, struct address_space *);
57void nilfs_copy_back_pages(struct address_space *, struct address_space *); 57void nilfs_copy_back_pages(struct address_space *, struct address_space *);
58void nilfs_clear_dirty_page(struct page *, bool); 58void nilfs_clear_dirty_page(struct page *, bool);
59void nilfs_clear_dirty_pages(struct address_space *, bool); 59void nilfs_clear_dirty_pages(struct address_space *, bool);
60void nilfs_mapping_init(struct address_space *mapping, struct inode *inode, 60void nilfs_mapping_init(struct address_space *mapping, struct inode *inode);
61 struct backing_dev_info *bdi);
62unsigned nilfs_page_count_clean_buffers(struct page *, unsigned, unsigned); 61unsigned nilfs_page_count_clean_buffers(struct page *, unsigned, unsigned);
63unsigned long nilfs_find_uncommitted_extent(struct inode *inode, 62unsigned long nilfs_find_uncommitted_extent(struct inode *inode,
64 sector_t start_blk, 63 sector_t start_blk,
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index 2e5b3ec85b8f..5bc2a1cf73c3 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -166,7 +166,7 @@ struct inode *nilfs_alloc_inode(struct super_block *sb)
166 ii->i_state = 0; 166 ii->i_state = 0;
167 ii->i_cno = 0; 167 ii->i_cno = 0;
168 ii->vfs_inode.i_version = 1; 168 ii->vfs_inode.i_version = 1;
169 nilfs_mapping_init(&ii->i_btnode_cache, &ii->vfs_inode, sb->s_bdi); 169 nilfs_mapping_init(&ii->i_btnode_cache, &ii->vfs_inode);
170 return &ii->vfs_inode; 170 return &ii->vfs_inode;
171} 171}
172 172
@@ -1057,7 +1057,6 @@ nilfs_fill_super(struct super_block *sb, void *data, int silent)
1057{ 1057{
1058 struct the_nilfs *nilfs; 1058 struct the_nilfs *nilfs;
1059 struct nilfs_root *fsroot; 1059 struct nilfs_root *fsroot;
1060 struct backing_dev_info *bdi;
1061 __u64 cno; 1060 __u64 cno;
1062 int err; 1061 int err;
1063 1062
@@ -1077,8 +1076,7 @@ nilfs_fill_super(struct super_block *sb, void *data, int silent)
1077 sb->s_time_gran = 1; 1076 sb->s_time_gran = 1;
1078 sb->s_max_links = NILFS_LINK_MAX; 1077 sb->s_max_links = NILFS_LINK_MAX;
1079 1078
1080 bdi = sb->s_bdev->bd_inode->i_mapping->backing_dev_info; 1079 sb->s_bdi = &bdev_get_queue(sb->s_bdev)->backing_dev_info;
1081 sb->s_bdi = bdi ? : &default_backing_dev_info;
1082 1080
1083 err = load_nilfs(nilfs, sb); 1081 err = load_nilfs(nilfs, sb);
1084 if (err) 1082 if (err)