Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5930871rdb; Thu, 14 Dec 2023 04:03:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IENCrTDgP8yNFfRf8jH5PNhX+kP/mvazYL5224ObuAZtzsPs5Zd2WmYbtLyYbgFzrrGjuec X-Received: by 2002:a05:6a20:a890:b0:18f:1d8b:fadc with SMTP id ca16-20020a056a20a89000b0018f1d8bfadcmr10562326pzb.19.1702555400019; Thu, 14 Dec 2023 04:03:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702555400; cv=none; d=google.com; s=arc-20160816; b=cEoRDsHajzNOtCU2VMTEovvBzd24yHndhkLehXaZ4pRrul5Bl7bysm7cYc+WtnVpIl uv3tZxj31gtxXj0hSbGzEcv8edkhtv5S0ZEPv9HJK6U8D1riZiN3TdAs5sNnzEZXKFnD A+3Egp1Kfnhs16XePYkFE9/GG6Fjo2CAURZEjvn3nAQbNNx7ni0PUCtpNCBenu3jWCPF 1cEt+PMJfMQGT1DqVPA0ZCjPubMWVE2WN4dtHlaAMLP+/Ai501hD5vg5F3meye9lGUyG hlesd3jtH6KmQvRYO1TU+qHByHPsmTmRZHytjHKvXjwXnpBNTZGlg52uzLzF+ZFxMnnM YE8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:organization:message-id:date:subject:cc:to :from:dkim-signature; bh=GX08mch+/uJk6gm8GpCprVPtWTLZR2tbP+3JwVrRMhw=; fh=iwE0voEkQAMZ9/PoLrjkOq/H+1Kiqw8iHnUIvakgQPs=; b=ZzzBPqVkopO/J0UY88j2yYeE0HLJhnG+zQz/b5KVJ+gurAkrdsgjov4E630DFiAUgk 1nFa4g+7iSjgk7yzXWD0+ShgYjePyRXDR2EMv6hDI5fXRB4eSNiTSWLw+pdEdTXCmEVj YwKv6awXJYsBFMbsjSC+f/H7x/l7R9zEKJrWPpI1+IqwvHy1MDHJ+9ZkTfA5uUwueksU m6sfziggUqIWx9YAi0Bk8gXFec0BPIwMZkr43vdgSVmka+/Tzq83rYIT926l7A0/W2D/ JqmjLZfCppaJJzHTcPxkOVos7waF1MNWo3UtNvY+T6uTqmiyEwOUosgXDiS0HbTqTpjF T/qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=d7l7NPQe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id u17-20020a631411000000b005c679836faesi11099568pgl.785.2023.12.14.04.03.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 04:03:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=d7l7NPQe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id D830582F9141; Thu, 14 Dec 2023 04:03:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1572888AbjLNMCy (ORCPT + 99 others); Thu, 14 Dec 2023 07:02:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444191AbjLNMCw (ORCPT ); Thu, 14 Dec 2023 07:02:52 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F7A0B9; Thu, 14 Dec 2023 04:02:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702555379; x=1734091379; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=563D9nECUGI/og8VRk92+ujEBSTYRs1beJ3uhY8y7zs=; b=d7l7NPQe3CJulGImA8XbKtmYRe2a6xvH+/WlIKvc08uYBQWnzI1uPCXO eOEuTtH9oWv7jBU/xYw2r17Rnxn6NWjFhDBi6eYCSrZrJ5oU0aLzDPLnP Pd3NaH2ccd3uYySJbzrWxtsjQLblEx7GEu1DEtB0o15sNjiTERT8bNk+3 WHDk2EWF5484p0PxOUt1VRX5BhqHnLfv8WPbHh1/2DTbtYByiEfm1yh72 KcGJR1F4/ye44WY1HvSExG2A/S1EA69vnO5Rt7TF8h+kd7yc/oWNjlGIg z7ziyc9G7RF0Ew1VTMJF0s30Ax/ZBTKW+zVqOCcP6QvFIMRU89gXYveqB g==; X-IronPort-AV: E=McAfee;i="6600,9927,10923"; a="397892475" X-IronPort-AV: E=Sophos;i="6.04,275,1695711600"; d="scan'208";a="397892475" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2023 04:02:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10923"; a="808560608" X-IronPort-AV: E=Sophos;i="6.04,275,1695711600"; d="scan'208";a="808560608" Received: from fdefranc-mobl3.ger.corp.intel.com (HELO fdefranc-mobl3.localnet) ([10.213.7.207]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2023 04:02:57 -0800 From: "Fabio M. De Francesco" To: linux-fsdevel@vger.kernel.org, Al Viro Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/4] minixfs: Use dir_put_page() in minix_unlink() and minix_rename() Date: Thu, 14 Dec 2023 13:02:54 +0100 Message-ID: <4082441.irdbgypaU6@fdefranc-mobl3> Organization: intel In-Reply-To: <20231213000849.2748576-3-viro@zeniv.linux.org.uk> References: <20231213000656.GI1674809@ZenIV> <20231213000849.2748576-1-viro@zeniv.linux.org.uk> <20231213000849.2748576-3-viro@zeniv.linux.org.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 14 Dec 2023 04:03:08 -0800 (PST) On Wednesday, 13 December 2023 01:08:48 CET Al Viro wrote: > ... rather than open-coding it there. Counterpart of the > corresponding fs/sysv commit from Fabio's series... Yes, I can still remember this code ;) > Signed-off-by: Al Viro > --- > fs/minix/dir.c | 6 ------ > fs/minix/minix.h | 5 +++++ > fs/minix/namei.c | 12 ++++-------- > 3 files changed, 9 insertions(+), 14 deletions(-) Reviewed-by: Fabio M. De Francesco > diff --git a/fs/minix/dir.c b/fs/minix/dir.c > index 4e5483adea40..ccb6c47fd7fe 100644 > --- a/fs/minix/dir.c > +++ b/fs/minix/dir.c > @@ -26,12 +26,6 @@ const struct file_operations minix_dir_operations = { > .fsync = generic_file_fsync, > }; > > -static inline void dir_put_page(struct page *page) > -{ > - kunmap(page); > - put_page(page); > -} > - > /* > * Return the offset into page `page_nr' of the last valid > * byte in that page, plus one. > diff --git a/fs/minix/minix.h b/fs/minix/minix.h > index d493507c064f..cb42b6cf7909 100644 > --- a/fs/minix/minix.h > +++ b/fs/minix/minix.h > @@ -64,6 +64,11 @@ extern int V2_minix_get_block(struct inode *, long, > struct buffer_head *, int); extern unsigned V1_minix_blocks(loff_t, struct > super_block *); > extern unsigned V2_minix_blocks(loff_t, struct super_block *); > > +static inline void dir_put_page(struct page *page) > +{ > + kunmap(page); > + put_page(page); > +} > extern struct minix_dir_entry *minix_find_entry(struct dentry*, struct > page**); extern int minix_add_link(struct dentry*, struct inode*); > extern int minix_delete_entry(struct minix_dir_entry*, struct page*); > diff --git a/fs/minix/namei.c b/fs/minix/namei.c > index 114084d5636a..20923a15e30a 100644 > --- a/fs/minix/namei.c > +++ b/fs/minix/namei.c > @@ -149,8 +149,7 @@ static int minix_unlink(struct inode * dir, struct > dentry *dentry) if (!de) > return -ENOENT; > err = minix_delete_entry(de, page); > - kunmap(page); > - put_page(page); > + dir_put_page(page); > > if (err) > return err; > @@ -242,13 +241,10 @@ static int minix_rename(struct mnt_idmap *idmap, > inode_dec_link_count(old_dir); > } > out_dir: > - if (dir_de) { > - kunmap(dir_page); > - put_page(dir_page); > - } > + if (dir_de) > + dir_put_page(dir_page); > out_old: > - kunmap(old_page); > - put_page(old_page); > + dir_put_page(old_page); > out: > return err; > }