Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5924963rdb; Thu, 14 Dec 2023 03:52:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IEZ6jOMhI6HWgnaEKRt61LoRU2Ei+wY9bP/LQoT66eVzNIMJ4LZFrKIyx3Zd1V6oqmjm86m X-Received: by 2002:a05:6a20:9390:b0:180:ebec:da1e with SMTP id x16-20020a056a20939000b00180ebecda1emr5174884pzh.21.1702554733728; Thu, 14 Dec 2023 03:52:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702554733; cv=none; d=google.com; s=arc-20160816; b=dPqM9YvU9Ad8jfSEYWp1RKrZrgz70//fFNCcSVvRYLoUxNbExnS9FtZBAP6/IXjEs4 U0dMzv6LH9P6iePecIXC87eBuTNdH1aYOsdNyAKQwoY7brLFbHz4iMKy/NxR0Zj8bOBm UjcKfVqnYG8LgoFczsMXXDOrNrqqTrb8FtHXm7KUofrjPxeSxUbG78z7pXvQvgWcwuCx oE1Oj45u0Qy6FgCtPATX7nh1TfJbA8nZL4MYGJY1hB96fpWd3hlxdHGd64t4GcgLBdFh CP+Xig1i9Vnh0iS7MuNaBIUd9CzkooA3JrLQzid5Jgih3PzasGwoSErOUYKoGS0TiJDz Cgnw== 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=SbuHHBQB0TMxsxZ/RGuyiz8o/o9yoMhlZdhzrigAYOk=; fh=iwE0voEkQAMZ9/PoLrjkOq/H+1Kiqw8iHnUIvakgQPs=; b=iev2INxy9eh08FfgemXi5t1sDtTQIcpGuAM9UZY9JkwE5J/ppYVzytuZxK+VmJfpAx qsaNxW0GeJ/Qy12XQMe1oZp6C85KF/aYMS0sswbVi5i9pfzaiLZv3JxJSQfMknlCHzLs 4Uh8/6kJigICdiXjE0Cbmqu0vibwuj9iac9fj+BkZQNK7dDGz95lB0y0bZ1gd7JbcFa7 16KOvn9LHxnNVNSVHxc1r/l4QhMUVdOKteNiUU8U+GDsIzVbBYn8XiAmpiIc03Er+KHx JcEuqXkXnddH9tWPgxxdJPKuvaMJBtXuzzH5s9MvJ8h7TTWU+wP88n+ypN3jFon0jmFl jEVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GeQQ5clz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id p11-20020a170903248b00b001d094766f1fsi11166949plw.404.2023.12.14.03.52.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 03:52:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GeQQ5clz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 16D1D801EE1B; Thu, 14 Dec 2023 03:52:08 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1572881AbjLNLvt (ORCPT + 99 others); Thu, 14 Dec 2023 06:51:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444306AbjLNLvf (ORCPT ); Thu, 14 Dec 2023 06:51:35 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A06F7188; Thu, 14 Dec 2023 03:51:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702554699; x=1734090699; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mYKmxaSZ3lHYWl59qq8UbtDfw7ikggP9hgTyywd2sfM=; b=GeQQ5clzF/97fOvYNFP48vI7Y4gM3GOCDMsGVnmtJ6RawPEhjHx6eiqQ Kr2KQSVnHSALu+ih8ewpZa2eTXodDKsd2keF8X76uMbhdGRT513cmU2px eInEkGBjIvKNwv1ImQxDxTC7FGBJH9knF6BZlF56Vkb5VeqmBTu0gYRbE XoX8RjxSa3FDX6DqHO3NwhUepN+/LiHouTgABSEAuryGj8qAEgNhtWIb/ OAXoWEK/qCriaNFXPFTI4O9LV6wda8iAiToh1jEg5iNCROl6hfZ0th9Lg njoF9f1JsqEIaokBzhsYMuadcShm+FIxpc33vBFY0+YTXW4+sna97CjfL A==; X-IronPort-AV: E=McAfee;i="6600,9927,10923"; a="375263552" X-IronPort-AV: E=Sophos;i="6.04,275,1695711600"; d="scan'208";a="375263552" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2023 03:51:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10923"; a="777874627" X-IronPort-AV: E=Sophos;i="6.04,275,1695711600"; d="scan'208";a="777874627" Received: from fdefranc-mobl3.ger.corp.intel.com (HELO fdefranc-mobl3.localnet) ([10.213.7.207]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2023 03:51:37 -0800 From: "Fabio M. De Francesco" To: linux-fsdevel@vger.kernel.org, Al Viro Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/4] minixfs: use offset_in_page() Date: Thu, 14 Dec 2023 12:51:35 +0100 Message-ID: <7914003.lOV4Wx5bFT@fdefranc-mobl3> Organization: intel 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: 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 agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 14 Dec 2023 03:52:08 -0800 (PST) On Wednesday, 13 December 2023 01:08:46 CET Al Viro wrote: > It's cheaper and more idiomatic than subtracting page_address() > of the corresponding page... > > Signed-off-by: Al Viro > --- > fs/minix/dir.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) Well, I know this code since the changes to fs/sysv and fs/ext2 ;) Therefore, FWIW... Reviewed-by: Fabio M. De Francesco Fabio > diff --git a/fs/minix/dir.c b/fs/minix/dir.c > index 62c313fc9a49..34a5d17f0796 100644 > --- a/fs/minix/dir.c > +++ b/fs/minix/dir.c > @@ -268,7 +268,7 @@ int minix_add_link(struct dentry *dentry, struct inode > *inode) return -EINVAL; > > got_it: > - pos = page_offset(page) + p - (char *)page_address(page); > + pos = page_offset(page) + offset_in_page(p); > err = minix_prepare_chunk(page, pos, sbi->s_dirsize); > if (err) > goto out_unlock; > @@ -296,8 +296,7 @@ int minix_add_link(struct dentry *dentry, struct inode > *inode) int minix_delete_entry(struct minix_dir_entry *de, struct page > *page) { > struct inode *inode = page->mapping->host; > - char *kaddr = page_address(page); > - loff_t pos = page_offset(page) + (char*)de - kaddr; > + loff_t pos = page_offset(page) + offset_in_page(de); > struct minix_sb_info *sbi = minix_sb(inode->i_sb); > unsigned len = sbi->s_dirsize; > int err; > @@ -421,8 +420,7 @@ int minix_set_link(struct minix_dir_entry *de, struct > page *page, { > struct inode *dir = page->mapping->host; > struct minix_sb_info *sbi = minix_sb(dir->i_sb); > - loff_t pos = page_offset(page) + > - (char *)de-(char*)page_address(page); > + loff_t pos = page_offset(page) + offset_in_page(de); > int err; > > lock_page(page);