Commit b83ae6d4 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

fs: remove mapping->backing_dev_info

Now that we never use the backing_dev_info pointer in struct address_space
we can simply remove it and save 4 to 8 bytes in every inode.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Acked-by: default avatarRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Reviewed-by: default avatarTejun Heo <tj@kernel.org>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent de1414a6
...@@ -104,11 +104,9 @@ static int raw_release(struct inode *inode, struct file *filp) ...@@ -104,11 +104,9 @@ static int raw_release(struct inode *inode, struct file *filp)
mutex_lock(&raw_mutex); mutex_lock(&raw_mutex);
bdev = raw_devices[minor].binding; bdev = raw_devices[minor].binding;
if (--raw_devices[minor].inuse == 0) { if (--raw_devices[minor].inuse == 0)
/* Here inode->i_mapping == bdev->bd_inode->i_mapping */ /* Here inode->i_mapping == bdev->bd_inode->i_mapping */
inode->i_mapping = &inode->i_data; inode->i_mapping = &inode->i_data;
inode->i_mapping->backing_dev_info = &default_backing_dev_info;
}
mutex_unlock(&raw_mutex); mutex_unlock(&raw_mutex);
blkdev_put(bdev, filp->f_mode | FMODE_EXCL); blkdev_put(bdev, filp->f_mode | FMODE_EXCL);
......
...@@ -176,7 +176,6 @@ static struct file *aio_private_file(struct kioctx *ctx, loff_t nr_pages) ...@@ -176,7 +176,6 @@ static struct file *aio_private_file(struct kioctx *ctx, loff_t nr_pages)
inode->i_mapping->a_ops = &aio_ctx_aops; inode->i_mapping->a_ops = &aio_ctx_aops;
inode->i_mapping->private_data = ctx; inode->i_mapping->private_data = ctx;
inode->i_mapping->backing_dev_info = &noop_backing_dev_info;
inode->i_size = PAGE_SIZE * nr_pages; inode->i_size = PAGE_SIZE * nr_pages;
path.dentry = d_alloc_pseudo(aio_mnt->mnt_sb, &this); path.dentry = d_alloc_pseudo(aio_mnt->mnt_sb, &this);
......
...@@ -60,19 +60,6 @@ static void bdev_write_inode(struct inode *inode) ...@@ -60,19 +60,6 @@ static void bdev_write_inode(struct inode *inode)
spin_unlock(&inode->i_lock); spin_unlock(&inode->i_lock);
} }
/*
* Move the inode from its current bdi to a new bdi. Make sure the inode
* is clean before moving so that it doesn't linger on the old bdi.
*/
static void bdev_inode_switch_bdi(struct inode *inode,
struct backing_dev_info *dst)
{
spin_lock(&inode->i_lock);
WARN_ON_ONCE(inode->i_state & I_DIRTY);
inode->i_data.backing_dev_info = dst;
spin_unlock(&inode->i_lock);
}
/* Kill _all_ buffers and pagecache , dirty or not.. */ /* Kill _all_ buffers and pagecache , dirty or not.. */
void kill_bdev(struct block_device *bdev) void kill_bdev(struct block_device *bdev)
{ {
...@@ -589,7 +576,6 @@ struct block_device *bdget(dev_t dev) ...@@ -589,7 +576,6 @@ struct block_device *bdget(dev_t dev)
inode->i_bdev = bdev; inode->i_bdev = bdev;
inode->i_data.a_ops = &def_blk_aops; inode->i_data.a_ops = &def_blk_aops;
mapping_set_gfp_mask(&inode->i_data, GFP_USER); mapping_set_gfp_mask(&inode->i_data, GFP_USER);
inode->i_data.backing_dev_info = &default_backing_dev_info;
spin_lock(&bdev_lock); spin_lock(&bdev_lock);
list_add(&bdev->bd_list, &all_bdevs); list_add(&bdev->bd_list, &all_bdevs);
spin_unlock(&bdev_lock); spin_unlock(&bdev_lock);
...@@ -1150,8 +1136,6 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part) ...@@ -1150,8 +1136,6 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
bdev->bd_queue = disk->queue; bdev->bd_queue = disk->queue;
bdev->bd_contains = bdev; bdev->bd_contains = bdev;
if (!partno) { if (!partno) {
struct backing_dev_info *bdi;
ret = -ENXIO; ret = -ENXIO;
bdev->bd_part = disk_get_part(disk, partno); bdev->bd_part = disk_get_part(disk, partno);
if (!bdev->bd_part) if (!bdev->bd_part)
...@@ -1177,11 +1161,8 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part) ...@@ -1177,11 +1161,8 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
} }
} }
if (!ret) { if (!ret)
bd_set_size(bdev,(loff_t)get_capacity(disk)<<9); bd_set_size(bdev,(loff_t)get_capacity(disk)<<9);
bdi = blk_get_backing_dev_info(bdev);
bdev_inode_switch_bdi(bdev->bd_inode, bdi);
}
/* /*
* If the device is invalidated, rescan partition * If the device is invalidated, rescan partition
...@@ -1208,8 +1189,6 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part) ...@@ -1208,8 +1189,6 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
if (ret) if (ret)
goto out_clear; goto out_clear;
bdev->bd_contains = whole; bdev->bd_contains = whole;
bdev_inode_switch_bdi(bdev->bd_inode,
whole->bd_inode->i_data.backing_dev_info);
bdev->bd_part = disk_get_part(disk, partno); bdev->bd_part = disk_get_part(disk, partno);
if (!(disk->flags & GENHD_FL_UP) || if (!(disk->flags & GENHD_FL_UP) ||
!bdev->bd_part || !bdev->bd_part->nr_sects) { !bdev->bd_part || !bdev->bd_part->nr_sects) {
...@@ -1249,7 +1228,6 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part) ...@@ -1249,7 +1228,6 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
bdev->bd_disk = NULL; bdev->bd_disk = NULL;
bdev->bd_part = NULL; bdev->bd_part = NULL;
bdev->bd_queue = NULL; bdev->bd_queue = NULL;
bdev_inode_switch_bdi(bdev->bd_inode, &default_backing_dev_info);
if (bdev != bdev->bd_contains) if (bdev != bdev->bd_contains)
__blkdev_put(bdev->bd_contains, mode, 1); __blkdev_put(bdev->bd_contains, mode, 1);
bdev->bd_contains = NULL; bdev->bd_contains = NULL;
...@@ -1474,8 +1452,6 @@ static void __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part) ...@@ -1474,8 +1452,6 @@ static void __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part)
* dirty data before. * dirty data before.
*/ */
bdev_write_inode(bdev->bd_inode); bdev_write_inode(bdev->bd_inode);
bdev_inode_switch_bdi(bdev->bd_inode,
&default_backing_dev_info);
} }
if (bdev->bd_contains == bdev) { if (bdev->bd_contains == bdev) {
if (disk->fops->release) if (disk->fops->release)
......
...@@ -2318,7 +2318,6 @@ int open_ctree(struct super_block *sb, ...@@ -2318,7 +2318,6 @@ int open_ctree(struct super_block *sb,
*/ */
fs_info->btree_inode->i_size = OFFSET_MAX; fs_info->btree_inode->i_size = OFFSET_MAX;
fs_info->btree_inode->i_mapping->a_ops = &btree_aops; fs_info->btree_inode->i_mapping->a_ops = &btree_aops;
fs_info->btree_inode->i_mapping->backing_dev_info = &fs_info->bdi;
RB_CLEAR_NODE(&BTRFS_I(fs_info->btree_inode)->rb_node); RB_CLEAR_NODE(&BTRFS_I(fs_info->btree_inode)->rb_node);
extent_io_tree_init(&BTRFS_I(fs_info->btree_inode)->io_tree, extent_io_tree_init(&BTRFS_I(fs_info->btree_inode)->io_tree,
......
...@@ -3608,7 +3608,6 @@ cache_acl: ...@@ -3608,7 +3608,6 @@ cache_acl:
switch (inode->i_mode & S_IFMT) { switch (inode->i_mode & S_IFMT) {
case S_IFREG: case S_IFREG:
inode->i_mapping->a_ops = &btrfs_aops; inode->i_mapping->a_ops = &btrfs_aops;
inode->i_mapping->backing_dev_info = &root->fs_info->bdi;
BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops; BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops;
inode->i_fop = &btrfs_file_operations; inode->i_fop = &btrfs_file_operations;
inode->i_op = &btrfs_file_inode_operations; inode->i_op = &btrfs_file_inode_operations;
...@@ -3623,7 +3622,6 @@ cache_acl: ...@@ -3623,7 +3622,6 @@ cache_acl:
case S_IFLNK: case S_IFLNK:
inode->i_op = &btrfs_symlink_inode_operations; inode->i_op = &btrfs_symlink_inode_operations;
inode->i_mapping->a_ops = &btrfs_symlink_aops; inode->i_mapping->a_ops = &btrfs_symlink_aops;
inode->i_mapping->backing_dev_info = &root->fs_info->bdi;
break; break;
default: default:
inode->i_op = &btrfs_special_inode_operations; inode->i_op = &btrfs_special_inode_operations;
...@@ -6088,7 +6086,6 @@ static int btrfs_create(struct inode *dir, struct dentry *dentry, ...@@ -6088,7 +6086,6 @@ static int btrfs_create(struct inode *dir, struct dentry *dentry,
inode->i_fop = &btrfs_file_operations; inode->i_fop = &btrfs_file_operations;
inode->i_op = &btrfs_file_inode_operations; inode->i_op = &btrfs_file_inode_operations;
inode->i_mapping->a_ops = &btrfs_aops; inode->i_mapping->a_ops = &btrfs_aops;
inode->i_mapping->backing_dev_info = &root->fs_info->bdi;
err = btrfs_init_inode_security(trans, inode, dir, &dentry->d_name); err = btrfs_init_inode_security(trans, inode, dir, &dentry->d_name);
if (err) if (err)
...@@ -9203,7 +9200,6 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry, ...@@ -9203,7 +9200,6 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry,
inode->i_fop = &btrfs_file_operations; inode->i_fop = &btrfs_file_operations;
inode->i_op = &btrfs_file_inode_operations; inode->i_op = &btrfs_file_inode_operations;
inode->i_mapping->a_ops = &btrfs_aops; inode->i_mapping->a_ops = &btrfs_aops;
inode->i_mapping->backing_dev_info = &root->fs_info->bdi;
BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops; BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops;
err = btrfs_init_inode_security(trans, inode, dir, &dentry->d_name); err = btrfs_init_inode_security(trans, inode, dir, &dentry->d_name);
...@@ -9247,7 +9243,6 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry, ...@@ -9247,7 +9243,6 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry,
inode->i_op = &btrfs_symlink_inode_operations; inode->i_op = &btrfs_symlink_inode_operations;
inode->i_mapping->a_ops = &btrfs_symlink_aops; inode->i_mapping->a_ops = &btrfs_symlink_aops;
inode->i_mapping->backing_dev_info = &root->fs_info->bdi;
inode_set_bytes(inode, name_len); inode_set_bytes(inode, name_len);
btrfs_i_size_write(inode, name_len); btrfs_i_size_write(inode, name_len);
err = btrfs_update_inode(trans, root, inode); err = btrfs_update_inode(trans, root, inode);
...@@ -9459,7 +9454,6 @@ static int btrfs_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode) ...@@ -9459,7 +9454,6 @@ static int btrfs_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode)
inode->i_op = &btrfs_file_inode_operations; inode->i_op = &btrfs_file_inode_operations;
inode->i_mapping->a_ops = &btrfs_aops; inode->i_mapping->a_ops = &btrfs_aops;
inode->i_mapping->backing_dev_info = &root->fs_info->bdi;
BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops; BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops;
ret = btrfs_init_inode_security(trans, inode, dir, NULL); ret = btrfs_init_inode_security(trans, inode, dir, NULL);
......
...@@ -783,8 +783,6 @@ static int fill_inode(struct inode *inode, struct page *locked_page, ...@@ -783,8 +783,6 @@ static int fill_inode(struct inode *inode, struct page *locked_page,
} }
inode->i_mapping->a_ops = &ceph_aops; inode->i_mapping->a_ops = &ceph_aops;
inode->i_mapping->backing_dev_info =
&ceph_sb_to_client(inode->i_sb)->backing_dev_info;
switch (inode->i_mode & S_IFMT) { switch (inode->i_mode & S_IFMT) {
case S_IFIFO: case S_IFIFO:
......
...@@ -937,8 +937,6 @@ retry_iget5_locked: ...@@ -937,8 +937,6 @@ retry_iget5_locked:
inode->i_flags |= S_NOATIME | S_NOCMTIME; inode->i_flags |= S_NOATIME | S_NOCMTIME;
if (inode->i_state & I_NEW) { if (inode->i_state & I_NEW) {
inode->i_ino = hash; inode->i_ino = hash;
if (S_ISREG(inode->i_mode))
inode->i_data.backing_dev_info = sb->s_bdi;
#ifdef CONFIG_CIFS_FSCACHE #ifdef CONFIG_CIFS_FSCACHE
/* initialize per-inode cache cookie pointer */ /* initialize per-inode cache cookie pointer */
CIFS_I(inode)->fscache = NULL; CIFS_I(inode)->fscache = NULL;
......
...@@ -131,7 +131,6 @@ struct inode *configfs_new_inode(umode_t mode, struct configfs_dirent *sd, ...@@ -131,7 +131,6 @@ struct inode *configfs_new_inode(umode_t mode, struct configfs_dirent *sd,
if (inode) { if (inode) {
inode->i_ino = get_next_ino(); inode->i_ino = get_next_ino();
inode->i_mapping->a_ops = &configfs_aops; inode->i_mapping->a_ops = &configfs_aops;
inode->i_mapping->backing_dev_info = &noop_backing_dev_info;
inode->i_op = &configfs_inode_operations; inode->i_op = &configfs_inode_operations;
if (sd->s_iattr) { if (sd->s_iattr) {
......
...@@ -67,7 +67,6 @@ static int ecryptfs_inode_set(struct inode *inode, void *opaque) ...@@ -67,7 +67,6 @@ static int ecryptfs_inode_set(struct inode *inode, void *opaque)
inode->i_ino = lower_inode->i_ino; inode->i_ino = lower_inode->i_ino;
inode->i_version++; inode->i_version++;
inode->i_mapping->a_ops = &ecryptfs_aops; inode->i_mapping->a_ops = &ecryptfs_aops;
inode->i_mapping->backing_dev_info = inode->i_sb->s_bdi;
if (S_ISLNK(inode->i_mode)) if (S_ISLNK(inode->i_mode))
inode->i_op = &ecryptfs_symlink_iops; inode->i_op = &ecryptfs_symlink_iops;
......
...@@ -1214,7 +1214,6 @@ struct inode *exofs_iget(struct super_block *sb, unsigned long ino) ...@@ -1214,7 +1214,6 @@ struct inode *exofs_iget(struct super_block *sb, unsigned long ino)
memcpy(oi->i_data, fcb.i_data, sizeof(fcb.i_data)); memcpy(oi->i_data, fcb.i_data, sizeof(fcb.i_data));
} }
inode->i_mapping->backing_dev_info = sb->s_bdi;
if (S_ISREG(inode->i_mode)) { if (S_ISREG(inode->i_mode)) {
inode->i_op = &exofs_file_inode_operations; inode->i_op = &exofs_file_inode_operations;
inode->i_fop = &exofs_file_operations; inode->i_fop = &exofs_file_operations;
...@@ -1314,7 +1313,6 @@ struct inode *exofs_new_inode(struct inode *dir, umode_t mode) ...@@ -1314,7 +1313,6 @@ struct inode *exofs_new_inode(struct inode *dir, umode_t mode)
set_obj_2bcreated(oi); set_obj_2bcreated(oi);
inode->i_mapping->backing_dev_info = sb->s_bdi;
inode_init_owner(inode, dir, mode); inode_init_owner(inode, dir, mode);
inode->i_ino = sbi->s_nextid++; inode->i_ino = sbi->s_nextid++;
inode->i_blkbits = EXOFS_BLKSHIFT; inode->i_blkbits = EXOFS_BLKSHIFT;
......
...@@ -308,7 +308,6 @@ struct inode *fuse_iget(struct super_block *sb, u64 nodeid, ...@@ -308,7 +308,6 @@ struct inode *fuse_iget(struct super_block *sb, u64 nodeid,
if (!fc->writeback_cache || !S_ISREG(attr->mode)) if (!fc->writeback_cache || !S_ISREG(attr->mode))
inode->i_flags |= S_NOCMTIME; inode->i_flags |= S_NOCMTIME;
inode->i_generation = generation; inode->i_generation = generation;
inode->i_data.backing_dev_info = &fc->bdi;
fuse_init_inode(inode, attr); fuse_init_inode(inode, attr);
unlock_new_inode(inode); unlock_new_inode(inode);
} else if ((inode->i_mode ^ attr->mode) & S_IFMT) { } else if ((inode->i_mode ^ attr->mode) & S_IFMT) {
......
...@@ -775,7 +775,6 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number, ...@@ -775,7 +775,6 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
mapping->flags = 0; mapping->flags = 0;
mapping_set_gfp_mask(mapping, GFP_NOFS); mapping_set_gfp_mask(mapping, GFP_NOFS);
mapping->private_data = NULL; mapping->private_data = NULL;
mapping->backing_dev_info = s->s_bdi;
mapping->writeback_index = 0; mapping->writeback_index = 0;
} }
......
...@@ -112,7 +112,6 @@ static struct gfs2_sbd *init_sbd(struct super_block *sb) ...@@ -112,7 +112,6 @@ static struct gfs2_sbd *init_sbd(struct super_block *sb)
mapping->flags = 0; mapping->flags = 0;
mapping_set_gfp_mask(mapping, GFP_NOFS); mapping_set_gfp_mask(mapping, GFP_NOFS);
mapping->private_data = NULL; mapping->private_data = NULL;
mapping->backing_dev_info = sb->s_bdi;
mapping->writeback_index = 0; mapping->writeback_index = 0;
spin_lock_init(&sdp->sd_log_lock); spin_lock_init(&sdp->sd_log_lock);
......
...@@ -492,7 +492,6 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb, ...@@ -492,7 +492,6 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb,
lockdep_set_class(&inode->i_mapping->i_mmap_rwsem, lockdep_set_class(&inode->i_mapping->i_mmap_rwsem,
&hugetlbfs_i_mmap_rwsem_key); &hugetlbfs_i_mmap_rwsem_key);
inode->i_mapping->a_ops = &hugetlbfs_aops; inode->i_mapping->a_ops = &hugetlbfs_aops;
inode->i_mapping->backing_dev_info = &noop_backing_dev_info;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
inode->i_mapping->private_data = resv_map; inode->i_mapping->private_data = resv_map;
info = HUGETLBFS_I(inode); info = HUGETLBFS_I(inode);
......
...@@ -170,20 +170,7 @@ int inode_init_always(struct super_block *sb, struct inode *inode) ...@@ -170,20 +170,7 @@ int inode_init_always(struct super_block *sb, struct inode *inode)
atomic_set(&mapping->i_mmap_writable, 0); atomic_set(&mapping->i_mmap_writable, 0);
mapping_set_gfp_mask(mapping, GFP_HIGHUSER_MOVABLE); mapping_set_gfp_mask(mapping, GFP_HIGHUSER_MOVABLE);
mapping->private_data = NULL; mapping->private_data = NULL;
mapping->backing_dev_info = &default_backing_dev_info;
mapping->writeback_index = 0; mapping->writeback_index = 0;
/*
* If the block_device provides a backing_dev_info for client
* inodes then use that. Otherwise the inode share the bdev's
* backing_dev_info.
*/
if (sb->s_bdev) {
struct backing_dev_info *bdi;
bdi = sb->s_bdev->bd_inode->i_mapping->backing_dev_info;
mapping->backing_dev_info = bdi;
}
inode->i_private = NULL; inode->i_private = NULL;
inode->i_mapping = mapping; inode->i_mapping = mapping;
INIT_HLIST_HEAD(&inode->i_dentry); /* buggered by rcu freeing */ INIT_HLIST_HEAD(&inode->i_dentry); /* buggered by rcu freeing */
......
...@@ -286,7 +286,6 @@ static void kernfs_init_inode(struct kernfs_node *kn, struct inode *inode) ...@@ -286,7 +286,6 @@ static void kernfs_init_inode(struct kernfs_node *kn, struct inode *inode)
kernfs_get(kn); kernfs_get(kn);
inode->i_private = kn; inode->i_private = kn;
inode->i_mapping->a_ops = &kernfs_aops; inode->i_mapping->a_ops = &kernfs_aops;
inode->i_mapping->backing_dev_info = &noop_backing_dev_info;
inode->i_op = &kernfs_iops; inode->i_op = &kernfs_iops;
set_default_inode_attr(inode, kn->mode); set_default_inode_attr(inode, kn->mode);
......
...@@ -267,7 +267,6 @@ ncp_iget(struct super_block *sb, struct ncp_entry_info *info) ...@@ -267,7 +267,6 @@ ncp_iget(struct super_block *sb, struct ncp_entry_info *info)
if (inode) { if (inode) {
atomic_set(&NCP_FINFO(inode)->opened, info->opened); atomic_set(&NCP_FINFO(inode)->opened, info->opened);
inode->i_mapping->backing_dev_info = sb->s_bdi;
inode->i_ino = info->ino; inode->i_ino = info->ino;
ncp_set_attr(inode, info); ncp_set_attr(inode, info);
if (S_ISREG(inode->i_mode)) { if (S_ISREG(inode->i_mode)) {
......
...@@ -387,7 +387,6 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr, st ...@@ -387,7 +387,6 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr, st
if (S_ISREG(inode->i_mode)) { if (S_ISREG(inode->i_mode)) {
inode->i_fop = NFS_SB(sb)->nfs_client->rpc_ops->file_ops; inode->i_fop = NFS_SB(sb)->nfs_client->rpc_ops->file_ops;
inode->i_data.a_ops = &nfs_file_aops; inode->i_data.a_ops = &nfs_file_aops;
inode->i_data.backing_dev_info = &NFS_SB(sb)->backing_dev_info;
} else if (S_ISDIR(inode->i_mode)) { } else if (S_ISDIR(inode->i_mode)) {
inode->i_op = NFS_SB(sb)->nfs_client->rpc_ops->dir_inode_ops; inode->i_op = NFS_SB(sb)->nfs_client->rpc_ops->dir_inode_ops;
inode->i_fop = &nfs_dir_operations; inode->i_fop = &nfs_dir_operations;
......
...@@ -172,7 +172,6 @@ int nilfs_init_gcinode(struct inode *inode) ...@@ -172,7 +172,6 @@ int nilfs_init_gcinode(struct inode *inode)
inode->i_mode = S_IFREG; inode->i_mode = S_IFREG;
mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS); mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS);
inode->i_mapping->a_ops = &empty_aops; inode->i_mapping->a_ops = &empty_aops;
inode->i_mapping->backing_dev_info = inode->i_sb->s_bdi;
ii->i_flags = 0; ii->i_flags = 0;
nilfs_bmap_init_gc(ii->i_bmap); nilfs_bmap_init_gc(ii->i_bmap);
......
...@@ -429,7 +429,6 @@ int nilfs_mdt_init(struct inode *inode, gfp_t gfp_mask, size_t objsz) ...@@ -429,7 +429,6 @@ int nilfs_mdt_init(struct inode *inode, gfp_t gfp_mask, size_t objsz)
inode->i_mode = S_IFREG; inode->i_mode = S_IFREG;
mapping_set_gfp_mask(inode->i_mapping, gfp_mask); mapping_set_gfp_mask(inode->i_mapping, gfp_mask);
inode->i_mapping->backing_dev_info = inode->i_sb->s_bdi;
inode->i_op = &def_mdt_iops; inode->i_op = &def_mdt_iops;
inode->i_fop = &def_mdt_fops; inode->i_fop = &def_mdt_fops;
...@@ -457,13 +456,12 @@ int nilfs_mdt_setup_shadow_map(struct inode *inode, ...@@ -457,13 +456,12 @@ int nilfs_mdt_setup_shadow_map(struct inode *inode,
struct nilfs_shadow_map *shadow) struct nilfs_shadow_map *shadow)
{ {
struct nilfs_mdt_info *mi = NILFS_MDT(inode); struct nilfs_mdt_info *mi = NILFS_MDT(inode);
struct backing_dev_info *bdi = inode->i_sb->s_bdi;
INIT_LIST_HEAD(&shadow->frozen_buffers); INIT_LIST_HEAD(&shadow->frozen_buffers);
address_space_init_once(&shadow->frozen_data); address_space_init_once(&shadow->frozen_data);
nilfs_mapping_init(&shadow->frozen_data, inode, bdi); nilfs_mapping_init(&shadow->frozen_data, inode);
address_space_init_once(&shadow->frozen_btnodes); address_space_init_once(&shadow->frozen_btnodes);
nilfs_mapping_init(&shadow->frozen_btnodes, inode, bdi); nilfs_mapping_init(&shadow->frozen_btnodes, inode);
mi->mi_shadow = shadow; mi->mi_shadow = shadow;
return 0; return 0;
} }
......
...@@ -461,14 +461,12 @@ unsigned nilfs_page_count_clean_buffers(struct page *page, ...@@ -461,14 +461,12 @@ unsigned nilfs_page_count_clean_buffers(struct page *page,
return nc; return nc;
} }
void nilfs_mapping_init(struct address_space *mapping, struct inode *inode, void nilfs_mapping_init(struct address_space *mapping, struct inode *inode)
struct backing_dev_info *bdi)
{ {
mapping->host = inode; mapping->host = inode;
mapping->flags = 0; mapping->flags = 0;
mapping_set_gfp_mask(mapping, GFP_NOFS); mapping_set_gfp_mask(mapping, GFP_NOFS);
mapping->private_data = NULL; mapping->private_data = NULL;
mapping->backing_dev_info = bdi;
mapping->a_ops = &empty_aops; mapping->a_ops = &empty_aops;
} }
......
...@@ -57,8 +57,7 @@ int nilfs_copy_dirty_pages(struct address_space *, struct address_space *); ...@@ -57,8 +57,7 @@ int nilfs_copy_dirty_pages(struct address_space *, struct address_space *);
void nilfs_copy_back_pages(struct address_space *, struct address_space *); void nilfs_copy_back_pages(struct address_space *, struct address_space *);
void nilfs_clear_dirty_page(struct page *, bool); void nilfs_clear_dirty_page(struct page *, bool);
void nilfs_clear_dirty_pages(struct address_space *, bool); void nilfs_clear_dirty_pages(struct address_space *, bool);
void nilfs_mapping_init(struct address_space *mapping, struct inode *inode, void nilfs_mapping_init(struct address_space *mapping, struct inode *inode);
struct backing_dev_info *bdi);
unsigned nilfs_page_count_clean_buffers(struct page *, unsigned, unsigned); unsigned nilfs_page_count_clean_buffers(struct page *, unsigned, unsigned);
unsigned long nilfs_find_uncommitted_extent(struct inode *inode, unsigned long nilfs_find_uncommitted_extent(struct inode *inode,
sector_t start_blk, sector_t start_blk,
......
...@@ -166,7 +166,7 @@ struct inode *nilfs_alloc_inode(struct super_block *sb) ...@@ -166,7 +166,7 @@ struct inode *nilfs_alloc_inode(struct super_block *sb)
ii->i_state = 0; ii->i_state = 0;
ii->i_cno = 0; ii->i_cno = 0;
ii->vfs_inode.i_version = 1; ii->vfs_inode.i_version = 1;
nilfs_mapping_init(&ii->i_btnode_cache, &ii->vfs_inode, sb->s_bdi); nilfs_mapping_init(&ii->i_btnode_cache, &ii->vfs_inode);
return &ii->vfs_inode; return &ii->vfs_inode;
} }
......
...@@ -398,7 +398,6 @@ static struct inode *dlmfs_get_root_inode(struct super_block *sb) ...@@ -398,7 +398,6 @@ static struct inode *dlmfs_get_root_inode(struct super_block *sb)
if (inode) { if (inode) {
inode->i_ino = get_next_ino(); inode->i_ino = get_next_ino();
inode_init_owner(inode, NULL, mode); inode_init_owner(inode, NULL, mode);
inode->i_mapping->backing_dev_info = &noop_backing_dev_info;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
inc_nlink(inode); inc_nlink(inode);
...@@ -422,7 +421,6 @@ static struct inode *dlmfs_get_inode(struct inode *parent, ...@@ -422,7 +421,6 @@ static struct inode *dlmfs_get_inode(struct inode *parent,
inode->i_ino = get_next_ino(); inode->i_ino = get_next_ino();
inode_init_owner(inode, parent, mode); inode_init_owner(inode, parent, mode);
inode->i_mapping->backing_dev_info = &noop_backing_dev_info;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
ip = DLMFS_I(inode); ip = DLMFS_I(inode);
......
...@@ -59,7 +59,6 @@ struct inode *ramfs_get_inode(struct super_block *sb, ...@@ -59,7 +59,6 @@ struct inode *ramfs_get_inode(struct super_block *sb,
inode->i_ino = get_next_ino(); inode->i_ino = get_next_ino();
inode_init_owner(inode, dir, mode); inode_init_owner(inode, dir, mode);
inode->i_mapping->a_ops = &ramfs_aops; inode->i_mapping->a_ops = &ramfs_aops;
inode->i_mapping->backing_dev_info = &noop_backing_dev_info;
mapping_set_gfp_mask(inode->i_mapping, GFP_HIGHUSER); mapping_set_gfp_mask(inode->i_mapping, GFP_HIGHUSER);
mapping_set_unevictable(inode->i_mapping); mapping_set_unevictable(inode->i_mapping);
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
......
...@@ -355,9 +355,6 @@ static struct inode *romfs_iget(struct super_block *sb, unsigned long pos) ...@@ -355,9 +355,6 @@ static struct inode *romfs_iget(struct super_block *sb, unsigned long pos)
case ROMFH_REG: case ROMFH_REG:
i->i_fop = &romfs_ro_fops; i->i_fop = &romfs_ro_fops;