diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-12 16:50:21 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-12 16:50:21 -0500 |
commit | 6bec0035286119eefc32a5b1102127e6a4032cb2 (patch) | |
tree | 440fab001b4c877b0b0c9fd62d8392e956e387e3 /fs/nfs | |
parent | 5d8e7fb6916556e9b476de33404e8c9e2c9aee61 (diff) | |
parent | 15d0f5ea348b9c4e6d41df294dde38a56a39c7bf (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/nfs')
-rw-r--r-- | fs/nfs/filelayout/filelayout.c | 2 | ||||
-rw-r--r-- | fs/nfs/flexfilelayout/flexfilelayout.c | 2 | ||||
-rw-r--r-- | fs/nfs/inode.c | 1 | ||||
-rw-r--r-- | fs/nfs/internal.h | 1 | ||||
-rw-r--r-- | fs/nfs/nfs4super.c | 1 | ||||
-rw-r--r-- | fs/nfs/super.c | 24 | ||||
-rw-r--r-- | fs/nfs/write.c | 6 |
7 files changed, 11 insertions, 26 deletions
diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c index 3c9769441f36..7ae1c263c5cf 100644 --- a/fs/nfs/filelayout/filelayout.c +++ b/fs/nfs/filelayout/filelayout.c | |||
@@ -1002,7 +1002,7 @@ mds_commit: | |||
1002 | spin_unlock(cinfo->lock); | 1002 | spin_unlock(cinfo->lock); |
1003 | if (!cinfo->dreq) { | 1003 | if (!cinfo->dreq) { |
1004 | inc_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); | 1004 | inc_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); |
1005 | inc_bdi_stat(page_file_mapping(req->wb_page)->backing_dev_info, | 1005 | inc_bdi_stat(inode_to_bdi(page_file_mapping(req->wb_page)->host), |
1006 | BDI_RECLAIMABLE); | 1006 | BDI_RECLAIMABLE); |
1007 | __mark_inode_dirty(req->wb_context->dentry->d_inode, | 1007 | __mark_inode_dirty(req->wb_context->dentry->d_inode, |
1008 | I_DIRTY_DATASYNC); | 1008 | I_DIRTY_DATASYNC); |
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index f29fb7d7e8f8..c22ecaa86c1c 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c | |||
@@ -1366,7 +1366,7 @@ ff_layout_mark_request_commit(struct nfs_page *req, | |||
1366 | spin_unlock(cinfo->lock); | 1366 | spin_unlock(cinfo->lock); |
1367 | if (!cinfo->dreq) { | 1367 | if (!cinfo->dreq) { |
1368 | inc_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); | 1368 | inc_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); |
1369 | inc_bdi_stat(page_file_mapping(req->wb_page)->backing_dev_info, | 1369 | inc_bdi_stat(inode_to_bdi(page_file_mapping(req->wb_page)->host), |
1370 | BDI_RECLAIMABLE); | 1370 | BDI_RECLAIMABLE); |
1371 | __mark_inode_dirty(req->wb_context->dentry->d_inode, | 1371 | __mark_inode_dirty(req->wb_context->dentry->d_inode, |
1372 | I_DIRTY_DATASYNC); | 1372 | I_DIRTY_DATASYNC); |
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index d2398c193bda..e4f0dcef8f54 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -388,7 +388,6 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr, st | |||
388 | if (S_ISREG(inode->i_mode)) { | 388 | if (S_ISREG(inode->i_mode)) { |
389 | inode->i_fop = NFS_SB(sb)->nfs_client->rpc_ops->file_ops; | 389 | inode->i_fop = NFS_SB(sb)->nfs_client->rpc_ops->file_ops; |
390 | inode->i_data.a_ops = &nfs_file_aops; | 390 | inode->i_data.a_ops = &nfs_file_aops; |
391 | inode->i_data.backing_dev_info = &NFS_SB(sb)->backing_dev_info; | ||
392 | } else if (S_ISDIR(inode->i_mode)) { | 391 | } else if (S_ISDIR(inode->i_mode)) { |
393 | inode->i_op = NFS_SB(sb)->nfs_client->rpc_ops->dir_inode_ops; | 392 | inode->i_op = NFS_SB(sb)->nfs_client->rpc_ops->dir_inode_ops; |
394 | inode->i_fop = &nfs_dir_operations; | 393 | inode->i_fop = &nfs_dir_operations; |
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 21469e6e3834..212b8c883d22 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h | |||
@@ -430,7 +430,6 @@ int nfs_show_options(struct seq_file *, struct dentry *); | |||
430 | int nfs_show_devname(struct seq_file *, struct dentry *); | 430 | int nfs_show_devname(struct seq_file *, struct dentry *); |
431 | int nfs_show_path(struct seq_file *, struct dentry *); | 431 | int nfs_show_path(struct seq_file *, struct dentry *); |
432 | int nfs_show_stats(struct seq_file *, struct dentry *); | 432 | int nfs_show_stats(struct seq_file *, struct dentry *); |
433 | void nfs_put_super(struct super_block *); | ||
434 | int nfs_remount(struct super_block *sb, int *flags, char *raw_data); | 433 | int nfs_remount(struct super_block *sb, int *flags, char *raw_data); |
435 | 434 | ||
436 | /* write.c */ | 435 | /* write.c */ |
diff --git a/fs/nfs/nfs4super.c b/fs/nfs/nfs4super.c index 48cea3c30e5d..75090feeafad 100644 --- a/fs/nfs/nfs4super.c +++ b/fs/nfs/nfs4super.c | |||
@@ -53,7 +53,6 @@ static const struct super_operations nfs4_sops = { | |||
53 | .destroy_inode = nfs_destroy_inode, | 53 | .destroy_inode = nfs_destroy_inode, |
54 | .write_inode = nfs4_write_inode, | 54 | .write_inode = nfs4_write_inode, |
55 | .drop_inode = nfs_drop_inode, | 55 | .drop_inode = nfs_drop_inode, |
56 | .put_super = nfs_put_super, | ||
57 | .statfs = nfs_statfs, | 56 | .statfs = nfs_statfs, |
58 | .evict_inode = nfs4_evict_inode, | 57 | .evict_inode = nfs4_evict_inode, |
59 | .umount_begin = nfs_umount_begin, | 58 | .umount_begin = nfs_umount_begin, |
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 368d9395d2e7..322b2de02988 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -311,7 +311,6 @@ const struct super_operations nfs_sops = { | |||
311 | .destroy_inode = nfs_destroy_inode, | 311 | .destroy_inode = nfs_destroy_inode, |
312 | .write_inode = nfs_write_inode, | 312 | .write_inode = nfs_write_inode, |
313 | .drop_inode = nfs_drop_inode, | 313 | .drop_inode = nfs_drop_inode, |
314 | .put_super = nfs_put_super, | ||
315 | .statfs = nfs_statfs, | 314 | .statfs = nfs_statfs, |
316 | .evict_inode = nfs_evict_inode, | 315 | .evict_inode = nfs_evict_inode, |
317 | .umount_begin = nfs_umount_begin, | 316 | .umount_begin = nfs_umount_begin, |
@@ -2572,7 +2571,7 @@ struct dentry *nfs_fs_mount_common(struct nfs_server *server, | |||
2572 | error = nfs_bdi_register(server); | 2571 | error = nfs_bdi_register(server); |
2573 | if (error) { | 2572 | if (error) { |
2574 | mntroot = ERR_PTR(error); | 2573 | mntroot = ERR_PTR(error); |
2575 | goto error_splat_bdi; | 2574 | goto error_splat_super; |
2576 | } | 2575 | } |
2577 | server->super = s; | 2576 | server->super = s; |
2578 | } | 2577 | } |
@@ -2604,9 +2603,6 @@ error_splat_root: | |||
2604 | dput(mntroot); | 2603 | dput(mntroot); |
2605 | mntroot = ERR_PTR(error); | 2604 | mntroot = ERR_PTR(error); |
2606 | error_splat_super: | 2605 | error_splat_super: |
2607 | if (server && !s->s_root) | ||
2608 | bdi_unregister(&server->backing_dev_info); | ||
2609 | error_splat_bdi: | ||
2610 | deactivate_locked_super(s); | 2606 | deactivate_locked_super(s); |
2611 | goto out; | 2607 | goto out; |
2612 | } | 2608 | } |
@@ -2654,27 +2650,19 @@ out: | |||
2654 | EXPORT_SYMBOL_GPL(nfs_fs_mount); | 2650 | EXPORT_SYMBOL_GPL(nfs_fs_mount); |
2655 | 2651 | ||
2656 | /* | 2652 | /* |
2657 | * Ensure that we unregister the bdi before kill_anon_super | ||
2658 | * releases the device name | ||
2659 | */ | ||
2660 | void nfs_put_super(struct super_block *s) | ||
2661 | { | ||
2662 | struct nfs_server *server = NFS_SB(s); | ||
2663 | |||
2664 | bdi_unregister(&server->backing_dev_info); | ||
2665 | } | ||
2666 | EXPORT_SYMBOL_GPL(nfs_put_super); | ||
2667 | |||
2668 | /* | ||
2669 | * Destroy an NFS2/3 superblock | 2653 | * Destroy an NFS2/3 superblock |
2670 | */ | 2654 | */ |
2671 | void nfs_kill_super(struct super_block *s) | 2655 | void nfs_kill_super(struct super_block *s) |
2672 | { | 2656 | { |
2673 | struct nfs_server *server = NFS_SB(s); | 2657 | struct nfs_server *server = NFS_SB(s); |
2658 | dev_t dev = s->s_dev; | ||
2659 | |||
2660 | generic_shutdown_super(s); | ||
2674 | 2661 | ||
2675 | kill_anon_super(s); | ||
2676 | nfs_fscache_release_super_cookie(s); | 2662 | nfs_fscache_release_super_cookie(s); |
2663 | |||
2677 | nfs_free_server(server); | 2664 | nfs_free_server(server); |
2665 | free_anon_bdev(dev); | ||
2678 | } | 2666 | } |
2679 | EXPORT_SYMBOL_GPL(nfs_kill_super); | 2667 | EXPORT_SYMBOL_GPL(nfs_kill_super); |
2680 | 2668 | ||
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index bcf83e535f29..88a6d2196ece 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -791,7 +791,7 @@ nfs_request_add_commit_list(struct nfs_page *req, struct list_head *dst, | |||
791 | spin_unlock(cinfo->lock); | 791 | spin_unlock(cinfo->lock); |
792 | if (!cinfo->dreq) { | 792 | if (!cinfo->dreq) { |
793 | inc_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); | 793 | inc_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); |
794 | inc_bdi_stat(page_file_mapping(req->wb_page)->backing_dev_info, | 794 | inc_bdi_stat(inode_to_bdi(page_file_mapping(req->wb_page)->host), |
795 | BDI_RECLAIMABLE); | 795 | BDI_RECLAIMABLE); |
796 | __mark_inode_dirty(req->wb_context->dentry->d_inode, | 796 | __mark_inode_dirty(req->wb_context->dentry->d_inode, |
797 | I_DIRTY_DATASYNC); | 797 | I_DIRTY_DATASYNC); |
@@ -858,7 +858,7 @@ static void | |||
858 | nfs_clear_page_commit(struct page *page) | 858 | nfs_clear_page_commit(struct page *page) |
859 | { | 859 | { |
860 | dec_zone_page_state(page, NR_UNSTABLE_NFS); | 860 | dec_zone_page_state(page, NR_UNSTABLE_NFS); |
861 | dec_bdi_stat(page_file_mapping(page)->backing_dev_info, BDI_RECLAIMABLE); | 861 | dec_bdi_stat(inode_to_bdi(page_file_mapping(page)->host), BDI_RECLAIMABLE); |
862 | } | 862 | } |
863 | 863 | ||
864 | /* Called holding inode (/cinfo) lock */ | 864 | /* Called holding inode (/cinfo) lock */ |
@@ -1607,7 +1607,7 @@ void nfs_retry_commit(struct list_head *page_list, | |||
1607 | nfs_mark_request_commit(req, lseg, cinfo, ds_commit_idx); | 1607 | nfs_mark_request_commit(req, lseg, cinfo, ds_commit_idx); |
1608 | if (!cinfo->dreq) { | 1608 | if (!cinfo->dreq) { |
1609 | dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); | 1609 | dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); |
1610 | dec_bdi_stat(page_file_mapping(req->wb_page)->backing_dev_info, | 1610 | dec_bdi_stat(inode_to_bdi(page_file_mapping(req->wb_page)->host), |
1611 | BDI_RECLAIMABLE); | 1611 | BDI_RECLAIMABLE); |
1612 | } | 1612 | } |
1613 | nfs_unlock_and_release_request(req); | 1613 | nfs_unlock_and_release_request(req); |