From patchwork Sat Aug 20 20:14:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 12949807 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1BE2C25B08 for ; Sat, 20 Aug 2022 20:14:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230188AbiHTUOQ (ORCPT ); Sat, 20 Aug 2022 16:14:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbiHTUOP (ORCPT ); Sat, 20 Aug 2022 16:14:15 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C82722AE29 for ; Sat, 20 Aug 2022 13:14:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Jij4gGIu/9MC3WTRmKg7/qEVttspVOOd9biZwQejFIk=; b=EMAS06HzyVOJPTLH699fcgZ4xA zREapKzrQbXxpuRgo6+TwGqWUgHB/tlE6yg6N36HYhydjmfWqO6NSDnyroqMb397pj783hJi9TTSv 3WHd1GtMMvx3Hbw8byMknGXPkx9wIDPWd2Zv8NlRhA23bRezRAUTIvV5F9AF0WwA3qIt67FAXNBVS z7jk/dWtq4KKY66bX5C2M378KfDCWIXZ7kj4Idhql6Pop1ls+Q08Ab5MVuB8W7OytubBZKg9g7WiK bsTOZX28DtxEzI8+8IF5s+ECxety1zWMv79tQskP9Kg30vr+jOdL1uYC+gqUodV5SE8JgjxrnM4WK +2Oqj5GA==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oPUrF-006T6w-8n; Sat, 20 Aug 2022 20:14:13 +0000 Date: Sat, 20 Aug 2022 21:14:13 +0100 From: Al Viro To: linux-fsdevel@vger.kernel.org Cc: Brad Warrum Subject: [PATCH 1/8] ibmvmc: don't open-code file_inode() Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org badly, at that... Signed-off-by: Al Viro --- drivers/misc/ibmvmc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/misc/ibmvmc.c b/drivers/misc/ibmvmc.c index c0fe3295c330..cbaf6d35e854 100644 --- a/drivers/misc/ibmvmc.c +++ b/drivers/misc/ibmvmc.c @@ -1039,6 +1039,7 @@ static unsigned int ibmvmc_poll(struct file *file, poll_table *wait) static ssize_t ibmvmc_write(struct file *file, const char *buffer, size_t count, loff_t *ppos) { + struct inode *inode; struct ibmvmc_buffer *vmc_buffer; struct ibmvmc_file_session *session; struct crq_server_adapter *adapter; @@ -1122,8 +1123,9 @@ static ssize_t ibmvmc_write(struct file *file, const char *buffer, if (p == buffer) goto out; - file->f_path.dentry->d_inode->i_mtime = current_time(file_inode(file)); - mark_inode_dirty(file->f_path.dentry->d_inode); + inode = file_inode(file); + inode->i_mtime = current_time(inode); + mark_inode_dirty(inode); dev_dbg(adapter->dev, "write: file = 0x%lx, count = 0x%lx\n", (unsigned long)file, (unsigned long)count); From patchwork Sat Aug 20 20:14:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 12949808 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22488C25B08 for ; Sat, 20 Aug 2022 20:15:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233625AbiHTUPB (ORCPT ); Sat, 20 Aug 2022 16:15:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbiHTUPA (ORCPT ); Sat, 20 Aug 2022 16:15:00 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 002F02F65C for ; Sat, 20 Aug 2022 13:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=eczBb+dnAseXIDwvlTbbXDeY6daD9Fm1d0jKak5GadE=; b=IYMO1TFsBJBUDzJ8bzeFIjSTsi XSzoTPari7vdoaFMH4rDttOahikJnBiF/uxVNIBmCsAyQeUApg4CZUv+AVqzjnT97LXRsDApNkDC4 yF3WBeUoqkvpg+X6lx/ZpDIOFw0JKRNk7mBAp9PsHD1Crq13JfxrgWWmrIKse/ixje0SMIeYJu5CF w5KvuQlrUJODre22ubgesKgZx0WC17ehF9nXDWF7x2VW0rF0WGotONCme+XqqbS1OBw6so0CEpdd0 D7WoDnvf2chGiFQdaYN1I63zqOX8IjddaT9RQay15g2WpdFjH0vBVH86MSSsXiB2jqL+w6/xSCUfV hw+Y9MUQ==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oPUrx-006T7j-HP; Sat, 20 Aug 2022 20:14:57 +0000 Date: Sat, 20 Aug 2022 21:14:57 +0100 From: Al Viro To: linux-fsdevel@vger.kernel.org Cc: Namjae Jeon Subject: [PATCH 2/8] exfat_iterate(): don't open-code file_inode(file) Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org and it's file, not filp... Signed-off-by: Al Viro --- fs/exfat/dir.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/exfat/dir.c b/fs/exfat/dir.c index a27b55ec060a..0fc08fdcba73 100644 --- a/fs/exfat/dir.c +++ b/fs/exfat/dir.c @@ -212,9 +212,9 @@ static void exfat_free_namebuf(struct exfat_dentry_namebuf *nb) /* skip iterating emit_dots when dir is empty */ #define ITER_POS_FILLED_DOTS (2) -static int exfat_iterate(struct file *filp, struct dir_context *ctx) +static int exfat_iterate(struct file *file, struct dir_context *ctx) { - struct inode *inode = filp->f_path.dentry->d_inode; + struct inode *inode = file_inode(file); struct super_block *sb = inode->i_sb; struct inode *tmp; struct exfat_dir_entry de; @@ -228,7 +228,7 @@ static int exfat_iterate(struct file *filp, struct dir_context *ctx) mutex_lock(&EXFAT_SB(sb)->s_lock); cpos = ctx->pos; - if (!dir_emit_dots(filp, ctx)) + if (!dir_emit_dots(file, ctx)) goto unlock; if (ctx->pos == ITER_POS_FILLED_DOTS) { From patchwork Sat Aug 20 20:16:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 12949809 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36E34C25B08 for ; Sat, 20 Aug 2022 20:16:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233727AbiHTUQI (ORCPT ); Sat, 20 Aug 2022 16:16:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbiHTUQH (ORCPT ); Sat, 20 Aug 2022 16:16:07 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75DD030570 for ; Sat, 20 Aug 2022 13:16:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=P50G2fbuAyKc/xqCikkqSBXoqQc16Qc7bJ7pCizTavk=; b=DUjRN2yq/Pt4f9M+EI4eeeJsBK eOJrTr62bJ6emHN8ij3oC3g8l6rBOKyGIv/37r6Pq50XtrXmYDByEMNYsVksT+2FkYr6NEVkPRf7P uIM1koTUilpXKsMrd0yv9BqaKzpOz+37k32o5cGpsjkW+IPWjJwAc1cdiqCbwT0qQgKf1W5hoJYl/ +cX1XTmqHxdghGqZ7kMLwo54HIjehHuLGGHkFwZfqi1pphAIApBKoRvYp2H/a4XrIfmWnM+7RUbXX 6reHVfuM1LzOe6jLGk0vDG/UgvKdrztekaBTYivESklep+dT92SX0tBWfpDOfxVJ2gq4GxwJsZ8I9 rT/LH4Uw==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oPUsz-006T8O-TB; Sat, 20 Aug 2022 20:16:02 +0000 Date: Sat, 20 Aug 2022 21:16:01 +0100 From: Al Viro To: linux-fsdevel@vger.kernel.org Cc: Jarkko Sakkinen Subject: [PATCH 3/8] sgx: use ->f_mapping... Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Signed-off-by: Al Viro Reviewed-by: Jarkko Sakkinen --- arch/x86/kernel/cpu/sgx/encl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/sgx/encl.c b/arch/x86/kernel/cpu/sgx/encl.c index 24c1bb8eb196..6de17468ca16 100644 --- a/arch/x86/kernel/cpu/sgx/encl.c +++ b/arch/x86/kernel/cpu/sgx/encl.c @@ -906,8 +906,7 @@ const cpumask_t *sgx_encl_cpumask(struct sgx_encl *encl) static struct page *sgx_encl_get_backing_page(struct sgx_encl *encl, pgoff_t index) { - struct inode *inode = encl->backing->f_path.dentry->d_inode; - struct address_space *mapping = inode->i_mapping; + struct address_space *mapping = encl->backing->f_mapping; gfp_t gfpmask = mapping_gfp_mask(mapping); return shmem_read_mapping_page_gfp(mapping, index, gfpmask); From patchwork Sat Aug 20 20:16:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 12949812 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0604C25B08 for ; Sat, 20 Aug 2022 20:17:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233977AbiHTURE (ORCPT ); Sat, 20 Aug 2022 16:17:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbiHTURC (ORCPT ); Sat, 20 Aug 2022 16:17:02 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEE6D30570 for ; Sat, 20 Aug 2022 13:17:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Jlm32nyGtnCnSG7q0B++K8ERpThUdpqRlTinI+FTl7Q=; b=CVTNsnJE0Ogh+f1mfbK2Mk91th Q6Km4BvwUqRqVwMoAHhA5Lf1h+hk8TzGiac1NQva7k1hv6pT5ATx13ElQ+XoydpQmE7qMvVoLNma7 7cbn88UYLofGLhzO5CC2W8AhX6v9rs2UoUuDY4DGXPiF7tg+JPpKT8Gmir66VL94HyDm9s/P9Ykd3 NIUWwjjoqsD7DRqPpa0ZriGkc0uimGAhR5dj1eu8fN5TUmmQIdT/7jPVem2DE4t/txmwnp95jR2Kq LyaRSoIlW4RVfU1ygx2xWGboOTeuIPt8Xd8Elg2oaHEd7oSt2Cg4UxbkMxRL2suOs2VDhYGW8r5jc +Ocv/o+Q==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oPUtv-006T9y-T4; Sat, 20 Aug 2022 20:17:00 +0000 Date: Sat, 20 Aug 2022 21:16:59 +0100 From: Al Viro To: linux-fsdevel@vger.kernel.org Cc: Eric Biederman Subject: [PATCH 4/8] bprm_fill_uid(): don't open-code file_inode() Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Signed-off-by: Al Viro --- fs/exec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/exec.c b/fs/exec.c index f793221f4eb6..c1867122204a 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -1595,7 +1595,7 @@ static void bprm_fill_uid(struct linux_binprm *bprm, struct file *file) { /* Handle suid and sgid on files */ struct user_namespace *mnt_userns; - struct inode *inode; + struct inode *inode = file_inode(file); unsigned int mode; kuid_t uid; kgid_t gid; @@ -1606,7 +1606,6 @@ static void bprm_fill_uid(struct linux_binprm *bprm, struct file *file) if (task_no_new_privs(current)) return; - inode = file->f_path.dentry->d_inode; mode = READ_ONCE(inode->i_mode); if (!(mode & (S_ISUID|S_ISGID))) return; From patchwork Sat Aug 20 20:17:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 12949813 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2A3BC3F6B0 for ; Sat, 20 Aug 2022 20:17:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234275AbiHTUR5 (ORCPT ); Sat, 20 Aug 2022 16:17:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234193AbiHTUR4 (ORCPT ); Sat, 20 Aug 2022 16:17:56 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AFEF30570; Sat, 20 Aug 2022 13:17:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=fD7vrQU4Z6TyVDACQCtFUO12NTMqAT8ivpKpMlldQjI=; b=kwUQDgmYF4rTLtMrROQoK9uYGE yty3SaaJSZt4cpR1dhlW3gibTu2D1srYQgRSvjyXfa2m/NbzoXK4qylAcziUpWYj8G762QNNm5Y8H OiOT3QGIl48Q+210OL6MRV5E0gijJT1b8Q8FWKzkySiIYEm2k7D3j67yP8EkIiVBr6l89lGuEBqug 3sphdZo6MDcgwyg5VRqPU3AR+Z8OqQbv2nxUuZ8rBd+60FWJRQLm2MSqnhU1k8FFg0xDNvOgf0GNu paNQlHUdLTkyYI+WgcE/iycYC9Ve9CQ0/L7tyNXgU4k8aC5UYp2c7Mx5UJ+FE8M7SNNmz+emZJ8Mj sEUFrSCw==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oPUun-006TAV-Id; Sat, 20 Aug 2022 20:17:53 +0000 Date: Sat, 20 Aug 2022 21:17:53 +0100 From: Al Viro To: linux-fsdevel@vger.kernel.org Cc: linux-nfs@vger.kernel.org Subject: [PATCH 5/8] nfs_finish_open(): don't open-code file_inode() Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Signed-off-by: Al Viro --- fs/nfs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index dbab3caa15ed..bcb2500c49b8 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -2022,7 +2022,7 @@ static int nfs_finish_open(struct nfs_open_context *ctx, err = finish_open(file, dentry, do_open); if (err) goto out; - if (S_ISREG(file->f_path.dentry->d_inode->i_mode)) + if (S_ISREG(file_inode(file)->i_mode)) nfs_file_set_open_context(file, ctx); else err = -EOPENSTALE; From patchwork Sat Aug 20 20:19:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 12949814 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AAECDC25B08 for ; Sat, 20 Aug 2022 20:19:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234591AbiHTUTJ (ORCPT ); Sat, 20 Aug 2022 16:19:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235238AbiHTUTD (ORCPT ); Sat, 20 Aug 2022 16:19:03 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F12A812AF7 for ; Sat, 20 Aug 2022 13:19:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=f2B88BtT0BwDCUCOMm6ekzS3U/w1aqQ18CQ1ZZdJD/E=; b=t4V9+RqY7T7nt2AplXZGZuwMf7 s3qXoMRZHZiKje/YQV1Pfsc32jeoxb/0lO+zLdoFJaiQxul0jyhraOYDIoZDmJAM4/NUj/ucvtv+y nuc508sDx7XDqrE2PlAGqzyC2v4L03sey6n0yO+T2fJA2bwDTzslN0G8AcAb4hV+Cv5PJ08T2xbwH btzgXGsOTMIqHOGNdqb+QWXU9X0nboW7znR+9sc5xGqTx2NdqIMcRy+w9xJgCB0Ds54QJyKIGiDKN 2+xjRGY44/nrkUjd42RKHK5rSV+G92uTI12jCDdpmbVm/vaYcb9eO5bcgTL2PWwEtpRfowheUmqzj 7FatFZyg==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oPUvs-006TBb-7J; Sat, 20 Aug 2022 20:19:00 +0000 Date: Sat, 20 Aug 2022 21:19:00 +0100 From: Al Viro To: linux-fsdevel@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Subject: [PATCH 6/8] dma_buf: no need to bother with file_inode()->i_mapping Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org ->f_mapping will do just fine Signed-off-by: Al Viro --- drivers/dma-buf/udmabuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c index 38e8767ec371..210473d927d8 100644 --- a/drivers/dma-buf/udmabuf.c +++ b/drivers/dma-buf/udmabuf.c @@ -210,7 +210,7 @@ static long udmabuf_create(struct miscdevice *device, memfd = fget(list[i].memfd); if (!memfd) goto err; - mapping = file_inode(memfd)->i_mapping; + mapping = memfd->f_mapping; if (!shmem_mapping(mapping) && !is_file_hugepages(memfd)) goto err; seals = memfd_fcntl(memfd, F_GET_SEALS, 0); From patchwork Sat Aug 20 20:19:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 12949815 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1399FC25B08 for ; Sat, 20 Aug 2022 20:19:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234193AbiHTUT5 (ORCPT ); Sat, 20 Aug 2022 16:19:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbiHTUT4 (ORCPT ); Sat, 20 Aug 2022 16:19:56 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B85E25C40; Sat, 20 Aug 2022 13:19:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ZPsz5dCfQLAnDB+pK1pbWEy1wzXIPKzrGENaRg4Npy8=; b=oLe3AE/VDOyqmFmTlUDO8Z83R3 WLIkM2ar0c3epxF37OyIYlYfZ6w3YxNMRlkIj3rYvjc/z/qi9wPzJsZeBU/lUQfKe8HRC8DsV4LaB mqMnTpcUeV1BEZwn1+2txnwzz65+jbhYZ+qFhPPRnKAHBa66CgMBNsfEPTpeKmb2oL2z2hw6uEq2G TKISRYHi70mzUe1bptZsepvnNZYYIzQtHVwhQUvzja5vtwjK4fJxCgmWWQJSZal05N3CUD0poQeh7 dlNySbEXym4Ld+2XVYlRR3NwCvfhu/YV0NYQteYU8QKxxhnDjq4+zIo/oRt/+LH6Rq/6KMBP5MTOt mKaiq4qg==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oPUwj-006TCE-Nc; Sat, 20 Aug 2022 20:19:53 +0000 Date: Sat, 20 Aug 2022 21:19:53 +0100 From: Al Viro To: linux-fsdevel@vger.kernel.org Cc: linux-nfs@vger.kernel.org Subject: [PATCH 7/8] _nfs42_proc_copy(): use ->f_mapping instead of file_inode()->i_mapping Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Signed-off-by: Al Viro --- fs/nfs/nfs42proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c index 068c45b3bc1a..542502199005 100644 --- a/fs/nfs/nfs42proc.c +++ b/fs/nfs/nfs42proc.c @@ -336,7 +336,7 @@ static ssize_t _nfs42_proc_copy(struct file *src, return status; } } - status = nfs_filemap_write_and_wait_range(file_inode(src)->i_mapping, + status = nfs_filemap_write_and_wait_range(src->f_mapping, pos_src, pos_src + (loff_t)count - 1); if (status) return status; From patchwork Sat Aug 20 20:20:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 12949816 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA229C25B08 for ; Sat, 20 Aug 2022 20:20:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234593AbiHTUUy (ORCPT ); Sat, 20 Aug 2022 16:20:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbiHTUUx (ORCPT ); Sat, 20 Aug 2022 16:20:53 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 975FC25C49 for ; Sat, 20 Aug 2022 13:20:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=vrOGcY06Bzfj4+g/pY24tJGby+aT9BjRijwDm74xZ/I=; b=UMZKj4FdeWestIdr4k/xOAGOJo JNTKcKXqLQU9U6BkcDq7gB6qq0SZT/Nu5nWw4QwS6WWbViLYWgIoKkWKN+6L+OAtfYAYRanraOjBk z7sbnzHTdvllik1b4YImdlspXq5kVF3bRHjsIg9jzN8QbY9RKm8EKCKjLFcBQKETtIIa3gyDGJza+ DQKgsHnU/O5qGeFQBR/ee4olvtO+g2a1IwiF0zIhz3xVEDmVAp15FKPUXW/uyWuxOGl5nPdRgO6Bg LJw2GwwXNi2Rx3zYw2ZCtW+hKFh5mQbs/igNKFT7kDG8CyauOgJx57rK7OUv3m8U78m5XBuZnR5tl 1FyzBeew==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oPUxe-006TCl-TW; Sat, 20 Aug 2022 20:20:50 +0000 Date: Sat, 20 Aug 2022 21:20:50 +0100 From: Al Viro To: linux-fsdevel@vger.kernel.org Cc: Mike Marshall Subject: [PATCH 8/8] orangefs: use ->f_mapping Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org ... and don't check for impossible conditions - file_inode() is never NULL in anything seen by ->release() and neither is its ->i_mapping. Signed-off-by: Al Viro --- fs/orangefs/file.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c index 86810e5d7914..732661aa2680 100644 --- a/fs/orangefs/file.c +++ b/fs/orangefs/file.c @@ -417,9 +417,7 @@ static int orangefs_file_release(struct inode *inode, struct file *file) * readahead cache (if any); this forces an expensive refresh of * data for the next caller of mmap (or 'get_block' accesses) */ - if (file_inode(file) && - file_inode(file)->i_mapping && - mapping_nrpages(&file_inode(file)->i_data)) { + if (mapping_nrpages(file->f_mapping)) { if (orangefs_features & ORANGEFS_FEATURE_READAHEAD) { gossip_debug(GOSSIP_INODE_DEBUG, "calling flush_racache on %pU\n",