From patchwork Mon Feb 19 06:27:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13562212 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D0ECC48260 for ; Mon, 19 Feb 2024 06:27:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 04CEF8D000F; Mon, 19 Feb 2024 01:27:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EF5E58D0008; Mon, 19 Feb 2024 01:27:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D6F528D000F; Mon, 19 Feb 2024 01:27:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id C114A8D0008 for ; Mon, 19 Feb 2024 01:27:54 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 8F4AC801D1 for ; Mon, 19 Feb 2024 06:27:54 +0000 (UTC) X-FDA: 81807572868.23.2753B01 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf06.hostedemail.com (Postfix) with ESMTP id E9AC8180019 for ; Mon, 19 Feb 2024 06:27:52 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=RHqOkPT4; dmarc=none; spf=none (imf06.hostedemail.com: domain of BATV+994827af29a55d2021e7+7484+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+994827af29a55d2021e7+7484+infradead.org+hch@bombadil.srs.infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708324073; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=jHJLbhzbQM88bSKvGjvpGu8mOibQcB/FZYvTZsZJGfs=; b=MbubGmPWD7zBI8FOPQHfkIL8Pp5C+Jqjx3Sok+oVNOk2/HpF7VkQKmZTYgKVeUapG0nTVS zipDTkMjT7B32pv+kDDt0CEYRnEBuJ5qV4/kl5zgD93h4cvDSYSwZ0cY6o4d3EYWs7hYys MaYzjgIImlFhza99kHrnU9gq+ySngj8= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=RHqOkPT4; dmarc=none; spf=none (imf06.hostedemail.com: domain of BATV+994827af29a55d2021e7+7484+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+994827af29a55d2021e7+7484+infradead.org+hch@bombadil.srs.infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708324073; a=rsa-sha256; cv=none; b=ntvji7B2hHZEZEyBdxNBKsduW152w5gTcPpwlhCdbJLCX4n593Ibejn2T6fIJIWQKc+ITX NwNanD6FpV1kbAXAPfFTFR+LMuOHm4ytiYZdJsEP3oOLtFqiKnZAy02CfEQdUx/AA/ffR1 LCV9DP6CzQnulKLF3XBUOyXoCwFFqoU= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=jHJLbhzbQM88bSKvGjvpGu8mOibQcB/FZYvTZsZJGfs=; b=RHqOkPT4qmpCVEsIyABsD0OQnz tYDZ2iIzJAvY3uXOUGcqEJxyneuEiIwQ7a73AGoj2RzlVYEG8jIlzMea4llly1Ot50UAznCAEcpXm N2cIxiMUGZmm8TxWeNQNuQjPsEsdcbOv97BOJCOH3CgvzgiuriP1DO3jjwB0Sp+4IoTJsm1NyD5kg nlY5McIxIcC7+bfMAKR41Ax6GY+i/5v0+NAZy2bc8ANkVZkUlXHEiFNEBv/Xwcu8T84lupd7itQJ6 EIB4NUJoq008JfzwtfEnB9mSsr9ETzMjR7+3DovntfAOEB6TEyAPHrkfweL+NEihY4lSfwRVyzAlL EikAmf9g==; Received: from 2a02-8389-2341-5b80-39d3-4735-9a3c-88d8.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:39d3:4735:9a3c:88d8] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rbx81-00000009FDA-3143; Mon, 19 Feb 2024 06:27:50 +0000 From: Christoph Hellwig To: Chandan Babu R , "Darrick J. Wong" , Hugh Dickins , Andrew Morton Cc: Hui Su , linux-xfs@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 10/22] xfs: use shmem_kernel_file_setup in xfile_create Date: Mon, 19 Feb 2024 07:27:18 +0100 Message-Id: <20240219062730.3031391-11-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240219062730.3031391-1-hch@lst.de> References: <20240219062730.3031391-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: E9AC8180019 X-Stat-Signature: zrs1pkhgfmwapu46pbepefi3j1awakbo X-Rspam-User: X-HE-Tag: 1708324072-397934 X-HE-Meta: U2FsdGVkX19D4KTj5fjSIuBPDJans4mnaJTneNbqhmmczXP/Mw6YpjoRlQL0yXgrCrfTKtOddpfnLsRzp7/3N3GvLaFIuvsLzidCHMVEN2lYjNx7zaaL34V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qek+wqnbh5Or0h4YYQ+Hr1sHD10xCHhohrkakMtf0Xa61S/kH32Xvw014ugUXT3SB8Oge1jA7iqtebytKDrCXHejYHUwUwrK06zSDYFfTDzR9UM8c78QazKUeW6KTPPA3/g7UlIIOGEoF+82flYJ7uzKK3uhFCyF9d+3+1yNuhTGRubYOfU1EfJvMy5EVgA4ABVarIkRIfReQ4bbFtqNP9MN38mxZAPIwl2x94BcHLevMEWlR/ZAxJmmE7nRAtS2/lk4l2U= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: shmem_kernel_file_setup is equivalent to shmem_file_setup except that it already sets the S_PRIVATE flag. Use it instead of open coding the logic. Signed-off-by: Christoph Hellwig Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong --- fs/xfs/scrub/xfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/xfs/scrub/xfile.c b/fs/xfs/scrub/xfile.c index e649558351bc5a..99a2b48f5662e6 100644 --- a/fs/xfs/scrub/xfile.c +++ b/fs/xfs/scrub/xfile.c @@ -68,7 +68,7 @@ xfile_create( if (!xf) return -ENOMEM; - xf->file = shmem_file_setup(description, isize, VM_NORESERVE); + xf->file = shmem_kernel_file_setup(description, isize, VM_NORESERVE); if (IS_ERR(xf->file)) { error = PTR_ERR(xf->file); goto out_xfile; @@ -85,7 +85,7 @@ xfile_create( FMODE_LSEEK; xf->file->f_flags |= O_RDWR | O_LARGEFILE | O_NOATIME; inode = file_inode(xf->file); - inode->i_flags |= S_PRIVATE | S_NOCMTIME | S_NOATIME; + inode->i_flags |= S_NOCMTIME | S_NOATIME; inode->i_mode &= ~0177; inode->i_uid = GLOBAL_ROOT_UID; inode->i_gid = GLOBAL_ROOT_GID;