Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4997506rdb; Tue, 12 Dec 2023 16:09:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IG1JG77k9HT9XGOFLzoIkZpC9FfHYKb4CBTybb0n1Rh4ZkT+vN0o7UhYlAsFKQpPGIA0iFB X-Received: by 2002:a05:6e02:1544:b0:35f:6c6b:abd6 with SMTP id j4-20020a056e02154400b0035f6c6babd6mr1059632ilu.25.1702426169994; Tue, 12 Dec 2023 16:09:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702426169; cv=none; d=google.com; s=arc-20160816; b=VsycftL2o2g3hFHPAjBMBZnW4ifrRQeQHi+pljvMtS+tmTqeO/OITgjMSoLeM3vnqH WnN1U+26dGrvQkDLvEdRFlphWhBJ99xUrfAmEBKN9BcmmB4pl03QDKPROEbPX0IDpplN ePoF66FbJxMO/r+4YMguu4WoI8S3TIXFc6RkLJsDq8XvlsAPnuQQBNAII+Ip0vq2Vz4+ KjIJULVZsXAfEj2iQTgA6YHJlp4D1AGCOLmdp04ujlBlEsBvdu/iJHrqZBRCSmOGmpNV byGQnvSLytZwm/R33TfTka81doC1ynfhBKtGHlb99fdItQGVjWpKxTXtmQcPzQ+8bp2M O7CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2/w5ERFrmChBMIDGO6+09pNbE8Y3dQuTTvG9JrP5JDY=; fh=PB/Cqfd7rEHjS8PKwY8H201+W6h7CwWuELHDErE1bVA=; b=q76LevHaWNHEPE8UyRajpsSLX0ymSWRZv0VHV8dOWpMCF4yfdRyXT85k3Tjh4gBG89 0179G5EL83BiBGtx4WqlNFMrSNyLeg22LoUj0g7fSjlwDD6pi91bMgG1cmBSPn7EEHv/ nFt4NWZeidhT0xeHuHmfPQrsVrPgyoO+SA0TpS2erdbThOHvO02soOZuVNnwqQv+q7fW JYvJWSVLi3gHO7J38K0kNxehfCbiF5+c/l4HUwuHHtBDJ5a4eDhbh9axlF/qg5KE+Cm3 YjbSaosSPO3b7/H7yJRkKSoRPArh+vWGbNf+DyWtRe13hQfrmBuXx6NcoGgwZ8B/Xrro EdGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=t5YLbKf5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id c4-20020a63ef44000000b005c26e59bf98si8372613pgk.855.2023.12.12.16.09.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 16:09:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=t5YLbKf5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 17D6381DAAE6; Tue, 12 Dec 2023 16:09:24 -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 S1377716AbjLMAJK (ORCPT + 99 others); Tue, 12 Dec 2023 19:09:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377930AbjLMAI5 (ORCPT ); Tue, 12 Dec 2023 19:08:57 -0500 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 E698DD68; Tue, 12 Dec 2023 16:08:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=2/w5ERFrmChBMIDGO6+09pNbE8Y3dQuTTvG9JrP5JDY=; b=t5YLbKf59Ph5/HA4K3h5FNGpwN oQPJp3Z7OQTJZldru5/Ye5EzplzTdDLgbuUHdrGsgzNUjVaIIdg70ThXj7SPysucJNTrSHwfPRX8T PtXYfxX/UMoravlVxqRvgPgzTAqGApdMc8qJinBpphqMEPGycu0L+O7TOxROFS8yf/RmZwnYjmIC7 XiRra8jeckgpVMzMKl/mS4aypG7O8hem1+xjlCcwvv6USWBsX1IgywWmfEuESQRDjBdTu5Yla51Aw 4GPmIBKIVsSmI9g8EzsRCMthb003X/YZfAb4Mj7xjs5cnmMgzPD72sQyT8iu/3j2R7pdTcMld0Xpy Z33csicg==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1rDCny-00BX25-1J; Wed, 13 Dec 2023 00:08:50 +0000 From: Al Viro To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 3/4] minixfs: Use dir_put_page() in minix_unlink() and minix_rename() Date: Wed, 13 Dec 2023 00:08:48 +0000 Message-Id: <20231213000849.2748576-3-viro@zeniv.linux.org.uk> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231213000849.2748576-1-viro@zeniv.linux.org.uk> References: <20231213000656.GI1674809@ZenIV> <20231213000849.2748576-1-viro@zeniv.linux.org.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Al Viro X-Spam-Status: No, score=-0.8 required=5.0 tests=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]); Tue, 12 Dec 2023 16:09:24 -0800 (PST) ... rather than open-coding it there. Counterpart of the corresponding fs/sysv commit from Fabio's series... 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(-) 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; } -- 2.39.2