]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
new helper: inode_fake_hash()
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 29 Jun 2018 23:36:57 +0000 (19:36 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 3 Aug 2018 20:03:32 +0000 (16:03 -0400)
open-coded in a quite a few places...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/hfs/inode.c
fs/jfs/jfs_imap.c
fs/jfs/super.c
fs/xfs/xfs_iops.c
include/linux/fs.h

index 2a16111d312fcaded7e265d294031035b63a9a3a..a2dfa1b2a89c7982deb26ea0fcd8eae46ac0dbbe 100644 (file)
@@ -541,7 +541,7 @@ static struct dentry *hfs_file_lookup(struct inode *dir, struct dentry *dentry,
        HFS_I(inode)->rsrc_inode = dir;
        HFS_I(dir)->rsrc_inode = inode;
        igrab(dir);
-       hlist_add_fake(&inode->i_hash);
+       inode_fake_hash(inode);
        mark_inode_dirty(inode);
        dont_mount(dentry);
 out:
index f36ef68905a74d830e75e7566c1145c8f55fc0cf..93e8c590ff5c060eb6026bf96d15d3db07a25a9f 100644 (file)
@@ -491,13 +491,7 @@ struct inode *diReadSpecial(struct super_block *sb, ino_t inum, int secondary)
        /* release the page */
        release_metapage(mp);
 
-       /*
-        * __mark_inode_dirty expects inodes to be hashed.  Since we don't
-        * want special inodes in the fileset inode space, we make them
-        * appear hashed, but do not put on any lists.  hlist_del()
-        * will work fine and require no locking.
-        */
-       hlist_add_fake(&ip->i_hash);
+       inode_fake_hash(ip);
 
        return (ip);
 }
index 1b9264fd54b68606ac73b749ce1f3af3ea860381..5403ece57dba285325c0c6591a9f72e0a0becc42 100644 (file)
@@ -581,7 +581,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
        inode->i_ino = 0;
        inode->i_size = i_size_read(sb->s_bdev->bd_inode);
        inode->i_mapping->a_ops = &jfs_metapage_aops;
-       hlist_add_fake(&inode->i_hash);
+       inode_fake_hash(inode);
        mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS);
 
        sbi->direct_inode = inode;
index 0fa29f39d658a7fcd8a8886689ab8e1b67a5db7e..3a75de7778434b53da42290819bb750dda5d6a0f 100644 (file)
@@ -1253,7 +1253,7 @@ xfs_setup_inode(
 
        inode_sb_list_add(inode);
        /* make the inode look hashed for the writeback code */
-       hlist_add_fake(&inode->i_hash);
+       inode_fake_hash(inode);
 
        inode->i_uid    = xfs_uid_to_kuid(ip->i_d.di_uid);
        inode->i_gid    = xfs_gid_to_kgid(ip->i_d.di_gid);
index a42600565925c8591ce8261b6a85bf3f02292784..43941e230e2b80be8843745f5d2e2f1f8f9f3342 100644 (file)
@@ -684,6 +684,17 @@ static inline int inode_unhashed(struct inode *inode)
        return hlist_unhashed(&inode->i_hash);
 }
 
+/*
+ * __mark_inode_dirty expects inodes to be hashed.  Since we don't
+ * want special inodes in the fileset inode space, we make them
+ * appear hashed, but do not put on any lists.  hlist_del()
+ * will work fine and require no locking.
+ */
+static inline void inode_fake_hash(struct inode *inode)
+{
+       hlist_add_fake(&inode->i_hash);
+}
+
 /*
  * inode->i_mutex nesting subclasses for the lock validator:
  *