You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
fs: deduplicate noop_backing_dev_info
hugetlbfs, kernfs and dlmfs can simply use noop_backing_dev_info instead of creating a local duplicate. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jan Kara <jack@suse.cz> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
committed by
Jens Axboe
parent
ec6f34e5b5
commit
a7a2c680a2
+1
-13
@@ -62,12 +62,6 @@ static inline struct hugetlbfs_inode_info *HUGETLBFS_I(struct inode *inode)
|
||||
return container_of(inode, struct hugetlbfs_inode_info, vfs_inode);
|
||||
}
|
||||
|
||||
static struct backing_dev_info hugetlbfs_backing_dev_info = {
|
||||
.name = "hugetlbfs",
|
||||
.ra_pages = 0, /* No readahead */
|
||||
.capabilities = BDI_CAP_NO_ACCT_AND_WRITEBACK,
|
||||
};
|
||||
|
||||
int sysctl_hugetlb_shm_group;
|
||||
|
||||
enum {
|
||||
@@ -498,7 +492,7 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb,
|
||||
lockdep_set_class(&inode->i_mapping->i_mmap_rwsem,
|
||||
&hugetlbfs_i_mmap_rwsem_key);
|
||||
inode->i_mapping->a_ops = &hugetlbfs_aops;
|
||||
inode->i_mapping->backing_dev_info =&hugetlbfs_backing_dev_info;
|
||||
inode->i_mapping->backing_dev_info = &noop_backing_dev_info;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_mapping->private_data = resv_map;
|
||||
info = HUGETLBFS_I(inode);
|
||||
@@ -1032,10 +1026,6 @@ static int __init init_hugetlbfs_fs(void)
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
|
||||
error = bdi_init(&hugetlbfs_backing_dev_info);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
error = -ENOMEM;
|
||||
hugetlbfs_inode_cachep = kmem_cache_create("hugetlbfs_inode_cache",
|
||||
sizeof(struct hugetlbfs_inode_info),
|
||||
@@ -1071,7 +1061,6 @@ static int __init init_hugetlbfs_fs(void)
|
||||
out:
|
||||
kmem_cache_destroy(hugetlbfs_inode_cachep);
|
||||
out2:
|
||||
bdi_destroy(&hugetlbfs_backing_dev_info);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -1091,7 +1080,6 @@ static void __exit exit_hugetlbfs_fs(void)
|
||||
for_each_hstate(h)
|
||||
kern_unmount(hugetlbfs_vfsmount[i++]);
|
||||
unregister_filesystem(&hugetlbfs_fs_type);
|
||||
bdi_destroy(&hugetlbfs_backing_dev_info);
|
||||
}
|
||||
|
||||
module_init(init_hugetlbfs_fs)
|
||||
|
||||
Reference in New Issue
Block a user