From patchwork Sat Nov 14 05:51:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hui Su X-Patchwork-Id: 11905423 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D03C7921 for ; Sat, 14 Nov 2020 05:52:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6948822256 for ; Sat, 14 Nov 2020 05:52:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="MXzIXe2b" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6948822256 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=163.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 627B96B005D; Sat, 14 Nov 2020 00:52:42 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 5D9426B006C; Sat, 14 Nov 2020 00:52:42 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4EE406B006E; Sat, 14 Nov 2020 00:52:42 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0218.hostedemail.com [216.40.44.218]) by kanga.kvack.org (Postfix) with ESMTP id 1F54D6B005D for ; Sat, 14 Nov 2020 00:52:42 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id AE6B4180AD802 for ; Sat, 14 Nov 2020 05:52:41 +0000 (UTC) X-FDA: 77481954522.10.hall27_4b01f3527315 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id 90ACB16A0AB for ; Sat, 14 Nov 2020 05:52:41 +0000 (UTC) X-Spam-Summary: 1,0,0,a982ebba4f9f9904,d41d8cd98f00b204,sh_def@163.com,,RULES_HIT:41:355:379:582:800:960:968:973:988:989:1152:1260:1277:1312:1313:1314:1345:1437:1516:1518:1519:1534:1541:1593:1594:1595:1596:1711:1730:1747:1777:1792:2198:2199:2307:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3866:3868:3870:4419:5007:6261:6653:10004:10400:11026:11334:11658:11914:12043:12048:12296:12297:12438:12555:12895:13069:13221:13229:13311:13357:13439:13895:14096:14097:14181:14394:14721:21080:21451:21627:21990:30054:30064:30075,0,RBL:220.181.12.13:@163.com:.lbl8.mailshell.net-62.50.2.100 66.100.201.100;04yrpta49op64f9awucxym13u3xxhoc5g1q8soz6mwjtmpea6r5cnp6b9h8ctek.ue7sixnqkrcit4tm9qm9g5kktd6pesh4oc84x9xmo6c6wx1nyt7mfj5e48fggjk.1-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:70,LUA_SUMMARY:none X-HE-Tag: hall27_4b01f3527315 X-Filterd-Recvd-Size: 2782 Received: from m12-13.163.com (m12-13.163.com [220.181.12.13]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Sat, 14 Nov 2020 05:52:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Date:From:Subject:Message-ID:MIME-Version; bh=lkm4a +uLOZfmtVm/YQoveCEH7utKvlhIajwwKMP3Kgw=; b=MXzIXe2bbsDdYAlNT6bZB frpV3jFJV/GZn4JcitLGaZjCdjSBRDPIvFUqbRZGTeBhy8KcXbcsxr9Pe+e74OEL UoEqWPum7ZnvuqFIk2nQOX/AoyOEivS+CCw/lsOIX+n9bZe3x1VSh7imnpI3qWaF /f7iH4njpNcEv6LnHaG1UI= Received: from localhost (unknown [101.86.213.176]) by smtp9 (Coremail) with SMTP id DcCowADXbmtmcK9fE_lkQg--.57491S2; Sat, 14 Nov 2020 13:51:35 +0800 (CST) Date: Sat, 14 Nov 2020 13:51:34 +0800 From: Hui Su To: hughd@google.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, pankaj.gupta.linux@gmail.com, lkp@intel.com Cc: sh_def@163.com Subject: [PATCH v2] mm/shmem.c: make shmem_mapping() inline Message-ID: <20201114055134.GA186011@rlk> MIME-Version: 1.0 Content-Disposition: inline X-CM-TRANSID: DcCowADXbmtmcK9fE_lkQg--.57491S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7Jw1xJr15WrWxJry7uF45ZFb_yoW8JF1UpF y3Cw1rCrW8XFy2gFW0qa18Zryaqa1kJ3y0y3s8Gwn0vF1kJa4UtF1jkF12vFW5AFy8Cw42 qr42kF109w4UtrJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07Un6pPUUUUU= X-Originating-IP: [101.86.213.176] X-CM-SenderInfo: xvkbvvri6rljoofrz/1tbiLgfcX1SIq0wwugAAsb X-Bogosity: Ham, tests=bogofilter, spamicity=0.006077, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: inline the shmem_mapping(), and use shmem_mapping() instead of 'inode->i_mapping->a_ops == &shmem_aops' in shmem_evict_inode(). v1->v2: remove the inline for func declaration in shmem_fs.h Reviewed-by: Pankaj Gupta Reported-by: kernel test robot Signed-off-by: Hui Su --- mm/shmem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 537c137698f8..7395d8e8226a 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1152,7 +1152,7 @@ static void shmem_evict_inode(struct inode *inode) struct shmem_inode_info *info = SHMEM_I(inode); struct shmem_sb_info *sbinfo = SHMEM_SB(inode->i_sb); - if (inode->i_mapping->a_ops == &shmem_aops) { + if (shmem_mapping(inode->i_mapping)) { shmem_unacct_size(info->flags, inode->i_size); inode->i_size = 0; shmem_truncate_range(inode, 0, (loff_t)-1); @@ -2352,7 +2352,7 @@ static struct inode *shmem_get_inode(struct super_block *sb, const struct inode return inode; } -bool shmem_mapping(struct address_space *mapping) +inline bool shmem_mapping(struct address_space *mapping) { return mapping->a_ops == &shmem_aops; }