Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3347435imm; Sun, 29 Jul 2018 16:45:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdsU8QhZ9sl9GugnQ+jXjUyoW+zOunQg+D6hjNasSOM3Vs2qTlt/1+GZEdvHLP01tlGEwG4 X-Received: by 2002:a63:9d87:: with SMTP id i129-v6mr13659049pgd.395.1532907933281; Sun, 29 Jul 2018 16:45:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532907933; cv=none; d=google.com; s=arc-20160816; b=WXfxxaZ4i8k0XOSe0j0mGJtYL9YfCoSq10ZvvTyKjxzuAI30bL71c4wljKCSwpCAAY C5r/2VPOWMRumet4Up2y93rDAJ1Vkxt+qpoTvJ5JCxDBmc0pKnmKv7jdLI8XPWhCpelw jSSNbRaqMyczwH7d1Fhvl+/TP263rFr07vZG7fJcXM4fGBQm4YOeQeXwREikda6WBYtP UA5NeQcG4G+9vhnDzX96Bi3QDIoNV/ETSiWcd7ic/n79lfXnl5iAQOMWf/QVIVeJaQsY lJ/AF2zdiq2AeMZryKiMbzgPsJmE9XNVd+9nhrhHHWxM2NpPiipIOk5VO9nkafM54ouN 73iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=sNs3mKiza/BsdgvycDPqWjaabJNOPU7v0aJxJqNSr7w=; b=CYcOUCsAAXVf4b2lzNTMiOzJ0UpsGrlMXpHaUcca2KctGxlvshi9Gihn8XrPuIRrzA maY7/0NlBJ1+bi/RIdQysAaZHZMbTeYuhiIZGHDRdTacElQLELRVVyzg0tg/hHlPDSch DwHpD7WuW5q02zUgk8TqNq09huZCwnfJyWl2tdPlzCTQcaY4omPyDQKrzdP5zqNuCLCt A/xfB48c9BG2W4WasPjYRs+rIjIzmof2r6p2QPy1CMlOlH85Qp8jOQTU4NweVEYxIpxD USJlHxbvDgQ9NcspK3h7MwcZFPlQtw8Tn5yV2vgyq6QfanZgLF90ARLyFZOVFepCkCgp S5hA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1-v6si9766491plm.375.2018.07.29.16.44.50; Sun, 29 Jul 2018 16:45:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732252AbeG2XhQ (ORCPT + 99 others); Sun, 29 Jul 2018 19:37:16 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:51622 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729378AbeG2Xg5 (ORCPT ); Sun, 29 Jul 2018 19:36:57 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1fjto7-0003WL-41; Sun, 29 Jul 2018 22:04:55 +0000 From: Al Viro To: linux-fsdevel@vger.kernel.org Cc: Linus Torvalds , linux-kernel@vger.kernel.org, Miklos Szeredi Subject: [PATCH 12/16] new helper: inode_fake_hash() Date: Sun, 29 Jul 2018 23:04:49 +0100 Message-Id: <20180729220453.13431-12-viro@ZenIV.linux.org.uk> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180729220453.13431-1-viro@ZenIV.linux.org.uk> References: <20180729220317.GB30522@ZenIV.linux.org.uk> <20180729220453.13431-1-viro@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Al Viro open-coded in a quite a few places... Signed-off-by: Al Viro --- fs/hfs/inode.c | 2 +- fs/jfs/jfs_imap.c | 8 +------- fs/jfs/super.c | 2 +- fs/xfs/xfs_iops.c | 2 +- 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, 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: 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) /* 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); } 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) 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; 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( 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); 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) } /* + * __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: * * 0: the object of the current VFS operation -- 2.11.0