diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2018-06-29 19:36:57 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-08-03 16:03:32 -0400 |
commit | 5bef915104f32c9d0bb5df6e86a98e31cb524e9a (patch) | |
tree | 51c6c5bbbd4cd30d9d6dc65f8c78999d6eca9754 | |
parent | e950564b97fd0f541b02eb207685d0746f5ecf29 (diff) |
new helper: inode_fake_hash()
open-coded in a quite a few places...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/hfs/inode.c | 2 | ||||
-rw-r--r-- | fs/jfs/jfs_imap.c | 8 | ||||
-rw-r--r-- | fs/jfs/super.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_iops.c | 2 | ||||
-rw-r--r-- | include/linux/fs.h | 11 |
5 files changed, 15 insertions, 10 deletions
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c index 2a16111d312f..a2dfa1b2a89c 100644 --- a/fs/hfs/inode.c +++ b/fs/hfs/inode.c | |||
@@ -541,7 +541,7 @@ static struct dentry *hfs_file_lookup(struct inode *dir, struct dentry *dentry, | |||
541 | HFS_I(inode)->rsrc_inode = dir; | 541 | HFS_I(inode)->rsrc_inode = dir; |
542 | HFS_I(dir)->rsrc_inode = inode; | 542 | HFS_I(dir)->rsrc_inode = inode; |
543 | igrab(dir); | 543 | igrab(dir); |
544 | hlist_add_fake(&inode->i_hash); | 544 | inode_fake_hash(inode); |
545 | mark_inode_dirty(inode); | 545 | mark_inode_dirty(inode); |
546 | dont_mount(dentry); | 546 | dont_mount(dentry); |
547 | out: | 547 | out: |
diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c index f36ef68905a7..93e8c590ff5c 100644 --- a/fs/jfs/jfs_imap.c +++ b/fs/jfs/jfs_imap.c | |||
@@ -491,13 +491,7 @@ struct inode *diReadSpecial(struct super_block *sb, ino_t inum, int secondary) | |||
491 | /* release the page */ | 491 | /* release the page */ |
492 | release_metapage(mp); | 492 | release_metapage(mp); |
493 | 493 | ||
494 | /* | 494 | inode_fake_hash(ip); |
495 | * __mark_inode_dirty expects inodes to be hashed. Since we don't | ||
496 | * want special inodes in the fileset inode space, we make them | ||
497 | * appear hashed, but do not put on any lists. hlist_del() | ||
498 | * will work fine and require no locking. | ||
499 | */ | ||
500 | hlist_add_fake(&ip->i_hash); | ||
501 | 495 | ||
502 | return (ip); | 496 | return (ip); |
503 | } | 497 | } |
diff --git a/fs/jfs/super.c b/fs/jfs/super.c index 1b9264fd54b6..5403ece57dba 100644 --- a/fs/jfs/super.c +++ b/fs/jfs/super.c | |||
@@ -581,7 +581,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent) | |||
581 | inode->i_ino = 0; | 581 | inode->i_ino = 0; |
582 | inode->i_size = i_size_read(sb->s_bdev->bd_inode); | 582 | inode->i_size = i_size_read(sb->s_bdev->bd_inode); |
583 | inode->i_mapping->a_ops = &jfs_metapage_aops; | 583 | inode->i_mapping->a_ops = &jfs_metapage_aops; |
584 | hlist_add_fake(&inode->i_hash); | 584 | inode_fake_hash(inode); |
585 | mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS); | 585 | mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS); |
586 | 586 | ||
587 | sbi->direct_inode = inode; | 587 | sbi->direct_inode = inode; |
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index 0fa29f39d658..3a75de777843 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c | |||
@@ -1253,7 +1253,7 @@ xfs_setup_inode( | |||
1253 | 1253 | ||
1254 | inode_sb_list_add(inode); | 1254 | inode_sb_list_add(inode); |
1255 | /* make the inode look hashed for the writeback code */ | 1255 | /* make the inode look hashed for the writeback code */ |
1256 | hlist_add_fake(&inode->i_hash); | 1256 | inode_fake_hash(inode); |
1257 | 1257 | ||
1258 | inode->i_uid = xfs_uid_to_kuid(ip->i_d.di_uid); | 1258 | inode->i_uid = xfs_uid_to_kuid(ip->i_d.di_uid); |
1259 | inode->i_gid = xfs_gid_to_kgid(ip->i_d.di_gid); | 1259 | inode->i_gid = xfs_gid_to_kgid(ip->i_d.di_gid); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index a42600565925..43941e230e2b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -685,6 +685,17 @@ static inline int inode_unhashed(struct inode *inode) | |||
685 | } | 685 | } |
686 | 686 | ||
687 | /* | 687 | /* |
688 | * __mark_inode_dirty expects inodes to be hashed. Since we don't | ||
689 | * want special inodes in the fileset inode space, we make them | ||
690 | * appear hashed, but do not put on any lists. hlist_del() | ||
691 | * will work fine and require no locking. | ||
692 | */ | ||
693 | static inline void inode_fake_hash(struct inode *inode) | ||
694 | { | ||
695 | hlist_add_fake(&inode->i_hash); | ||
696 | } | ||
697 | |||
698 | /* | ||
688 | * inode->i_mutex nesting subclasses for the lock validator: | 699 | * inode->i_mutex nesting subclasses for the lock validator: |
689 | * | 700 | * |
690 | * 0: the object of the current VFS operation | 701 | * 0: the object of the current VFS operation |