Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5933690rdb; Thu, 14 Dec 2023 04:07:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IH7CKuZ83Dj492EKjf3hhXCpF+RCzux/BqhvayVXncunf9mQNvKwCu0aU8nhaLklh7NXbUX X-Received: by 2002:a05:6a00:190e:b0:6ce:82bd:93d2 with SMTP id y14-20020a056a00190e00b006ce82bd93d2mr5571993pfi.17.1702555643371; Thu, 14 Dec 2023 04:07:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702555643; cv=none; d=google.com; s=arc-20160816; b=kMH+YeizX1PsfBG+01fjnbbWjkQJTlSsxLkxP9rxKjdPjTZiFnF/HjKHPJHPqDjbgX BrMW6v92vfpq0PVSKOzx7Gk+3Q7QXbDs5tpBw/AQxWqxxXiK1XGcn/WaEbdiHnaKtmSe athM48wH7alJTMBKcLwB+X0NosThUmJH2lJaJ9+W8DocZaq3mSbMvVxp+VUPLLMPABks Z/YP+wv99HJhSv1DHR0LjM/JtvhL5zT0GSpogw7YimCrDXD9sSFMXv2oXjSolQIXh/JS dg2hRXjkeEDj0PnJPeQ1optZGkOKHLxbTFmPSW/nTJjaWuFMTx6FTJ7XxlbGTRFspNV0 NwBQ== 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=NdUCBhJHCiKrUpOglTlrT90pbcUo8QzylD4tLMZPWps=; fh=iwE0voEkQAMZ9/PoLrjkOq/H+1Kiqw8iHnUIvakgQPs=; b=Y4wIlUydcmlYEmbByWqMVsNmRejd4nR7XQ+dyjrgCnvJOVCAQWosSaM0uS1sJnTEW3 Kmw2JGkBZmziPYNb2HBkZeOPoiT7Yn4OUsaQ6acUXlGdc3HL+gHHOF7m179WVOBVpPkb Kh+QFocDS8hvMYciT16A7bWrcXtf1Qw5KRt0J3FuxsYgn5moyXXHIB4fLi+QcKlQRo9S tb96XiM1Ig3vpNtri8W5DF91N9tccdxsQHgodcRm16xfyy40uI1O7A2MvCTMCfGUPWJ7 Tk+n7eTd4aOcm+pl/D7NYK+Hf8oGNJwDf9Fu/f3caXCcPrcWmddIyer8s+y5pM5nZCNp 3w5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=O0qtsOQf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id h16-20020a056a00219000b006ceda12a350si10897715pfi.227.2023.12.14.04.07.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 04:07:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=O0qtsOQf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 828818122F09; Thu, 14 Dec 2023 04:07:18 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1572912AbjLNMHF (ORCPT + 99 others); Thu, 14 Dec 2023 07:07:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1572910AbjLNMHD (ORCPT ); Thu, 14 Dec 2023 07:07:03 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18CD0BD; Thu, 14 Dec 2023 04:07:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702555627; x=1734091627; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9Q+luyd4pSCUnS9q7QWXSG0Qvk/mCCFyLh+qA2EsHcU=; b=O0qtsOQfQ3LgETCj7VfHIwGRVWL5g/7r1biQ64m69HLT5XhwBWhKwYCi 6wtdYVsoKvFyNy+nzi0T0ig9giM/Oz6PObEnVB2ZbhsKk5fhPM9xSdXVT AL9xa2Dv9grNoUL2li4RgDFtzXcRCPhJPnRUvfUDaSwpX7RyknBeNu1c6 9Oxjs6G+yqh3Sc12q09uMHb5m0DKCj1jlns7OFmVPYZn1V91i5IVRGeXT v9QCGhI6jAezZU0SJ7hGGS8TL4egV90WEhpqydl00ponPh4LSkyBJochE PQLTnMm53Yvk4HcR56wxw42bOTyVl4V7kMA1HAaf2QMErar6vfYqWrcCs Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10923"; a="385523791" X-IronPort-AV: E=Sophos;i="6.04,275,1695711600"; d="scan'208";a="385523791" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2023 04:07:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10923"; a="947553760" X-IronPort-AV: E=Sophos;i="6.04,275,1695711600"; d="scan'208";a="947553760" Received: from fdefranc-mobl3.ger.corp.intel.com (HELO fdefranc-mobl3.localnet) ([10.213.7.207]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2023 04:07:01 -0800 From: "Fabio M. De Francesco" To: linux-fsdevel@vger.kernel.org, Al Viro Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/4] minixfs: switch to kmap_local_page() Date: Thu, 14 Dec 2023 13:06:57 +0100 Message-ID: <5180693.aeNJFYEL58@fdefranc-mobl3> Organization: intel In-Reply-To: <20231213000849.2748576-4-viro@zeniv.linux.org.uk> References: <20231213000656.GI1674809@ZenIV> <20231213000849.2748576-1-viro@zeniv.linux.org.uk> <20231213000849.2748576-4-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 groat.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 (groat.vger.email [0.0.0.0]); Thu, 14 Dec 2023 04:07:18 -0800 (PST) On Wednesday, 13 December 2023 01:08:49 CET Al Viro wrote: > Again, a counterpart of Fabio's fs/sysv patch > > Signed-off-by: Al Viro > --- > fs/minix/dir.c | 27 +++++++++++++-------------- > fs/minix/minix.h | 5 ----- > fs/minix/namei.c | 6 +++--- > 3 files changed, 16 insertions(+), 22 deletions(-) Reviewed-by: Fabio M. De Francesco > diff --git a/fs/minix/dir.c b/fs/minix/dir.c > index ccb6c47fd7fe..a224cf222570 100644 > --- a/fs/minix/dir.c > +++ b/fs/minix/dir.c > @@ -70,9 +70,8 @@ static void *dir_get_page(struct inode *dir, unsigned long > n, struct page **p) struct page *page = read_mapping_page(mapping, n, > NULL); > if (IS_ERR(page)) > return ERR_CAST(page); > - kmap(page); > *p = page; > - return page_address(page); > + return kmap_local_page(page); > } > > static inline void *minix_next_entry(void *de, struct minix_sb_info *sbi) > @@ -123,13 +122,13 @@ static int minix_readdir(struct file *file, struct > dir_context *ctx) unsigned l = strnlen(name, sbi->s_namelen); > if (!dir_emit(ctx, name, l, > inumber, DT_UNKNOWN)) { > - dir_put_page(page); > + unmap_and_put_page(page, p); > return 0; > } > } > ctx->pos += chunk_size; > } > - dir_put_page(page); > + unmap_and_put_page(page, kaddr); > } > return 0; > } > @@ -189,7 +188,7 @@ minix_dirent *minix_find_entry(struct dentry *dentry, > struct page **res_page) if (namecompare(namelen, sbi->s_namelen, name, > namx)) > goto found; > } > - dir_put_page(page); > + unmap_and_put_page(page, kaddr); > } > return NULL; > > @@ -255,7 +254,7 @@ int minix_add_link(struct dentry *dentry, struct inode > *inode) goto out_unlock; > } > unlock_page(page); > - dir_put_page(page); > + unmap_and_put_page(page, kaddr); > } > BUG(); > return -EINVAL; > @@ -278,7 +277,7 @@ int minix_add_link(struct dentry *dentry, struct inode > *inode) mark_inode_dirty(dir); > err = minix_handle_dirsync(dir); > out_put: > - dir_put_page(page); > + unmap_and_put_page(page, kaddr); > return err; > out_unlock: > unlock_page(page); > @@ -324,7 +323,7 @@ int minix_make_empty(struct inode *inode, struct inode > *dir) goto fail; > } > > - kaddr = kmap_atomic(page); > + kaddr = kmap_local_page(page); > memset(kaddr, 0, PAGE_SIZE); > > if (sbi->s_version == MINIX_V3) { > @@ -344,7 +343,7 @@ int minix_make_empty(struct inode *inode, struct inode > *dir) de->inode = dir->i_ino; > strcpy(de->name, ".."); > } > - kunmap_atomic(kaddr); > + kunmap_local(kaddr); > > dir_commit_chunk(page, 0, 2 * sbi->s_dirsize); > err = minix_handle_dirsync(inode); > @@ -361,11 +360,11 @@ int minix_empty_dir(struct inode * inode) > struct page *page = NULL; > unsigned long i, npages = dir_pages(inode); > struct minix_sb_info *sbi = minix_sb(inode->i_sb); > - char *name; > + char *name, *kaddr; > __u32 inumber; > > for (i = 0; i < npages; i++) { > - char *p, *kaddr, *limit; > + char *p, *limit; > > kaddr = dir_get_page(inode, i, &page); > if (IS_ERR(kaddr)) > @@ -396,12 +395,12 @@ int minix_empty_dir(struct inode * inode) > goto not_empty; > } > } > - dir_put_page(page); > + unmap_and_put_page(page, kaddr); > } > return 1; > > not_empty: > - dir_put_page(page); > + unmap_and_put_page(page, kaddr); > return 0; > } > > @@ -455,7 +454,7 @@ ino_t minix_inode_by_name(struct dentry *dentry) > res = ((minix3_dirent *) de)->inode; > else > res = de->inode; > - dir_put_page(page); > + unmap_and_put_page(page, de); > } > return res; > } > diff --git a/fs/minix/minix.h b/fs/minix/minix.h > index cb42b6cf7909..d493507c064f 100644 > --- a/fs/minix/minix.h > +++ b/fs/minix/minix.h > @@ -64,11 +64,6 @@ 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 20923a15e30a..d6031acc34f0 100644 > --- a/fs/minix/namei.c > +++ b/fs/minix/namei.c > @@ -149,7 +149,7 @@ static int minix_unlink(struct inode * dir, struct > dentry *dentry) if (!de) > return -ENOENT; > err = minix_delete_entry(de, page); > - dir_put_page(page); > + unmap_and_put_page(page, de); > > if (err) > return err; > @@ -242,9 +242,9 @@ static int minix_rename(struct mnt_idmap *idmap, > } > out_dir: > if (dir_de) > - dir_put_page(dir_page); > + unmap_and_put_page(dir_page, dir_de); > out_old: > - dir_put_page(old_page); > + unmap_and_put_page(old_page, old_de); > out: > return err; > }