Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp418293lqh; Fri, 31 May 2024 05:41:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXqPHfxV8EuFx5rKypdOFFsdrcbuRsTQ7iWcobOvK7TK4KOU6yFGtQHaYe6lWeG7LeMVyzUy0YWu5X+2CKNz1L6O8m/apglw5pqx5RN9w== X-Google-Smtp-Source: AGHT+IGniqgjPZZ/O9wv6lBQl4CiZgcuNnGSffQnMquOfwnI8Nt//tnUonl+trN/njcqptjuxZUM X-Received: by 2002:a05:6871:739d:b0:24c:b2c0:5bc9 with SMTP id 586e51a60fabf-2508b7e3e97mr1854791fac.13.1717159264166; Fri, 31 May 2024 05:41:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717159264; cv=pass; d=google.com; s=arc-20160816; b=qUPr1XrgFFC45D5HAJ4EX2Fn9UZ6Mq+dJeRhgGJX1iF0/u/faF/wpRrCAN2n/Qxd92 dd7dKfa6Scfhf/CUD8jpLphIb6aGnGwlY0arVFQR2PbW7CciKFGGT4UxVZ4xCgpnFbHL EpJ+6UJJPI5KfqZS3I97veLOWWS8CT+nfMQr0d/U5WTM3GLzNVTaoIJw5fiTOhmPMiBk koLH747Ixli1XPXHkhmndBix1uMLM4jU+cnLdZbLxrF9yI5mNkSzG26DnDeGmiIdCUx6 aHVWzPuwjGvmW+I11ds9JILMm8fnypqkKxZbA4bWOdjrF2V2qey8bd2h737AfCD2VJyU VBsA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=JUHpCtOFvJ217dOG69CLyUE0s9lGKzV3hZOfC/pApv8=; fh=sPKrtYcvfYrx0SMCKkPItgREgastrob9cURc2UNAf8I=; b=GAfUgYhVYM7NytuBM6d83qqHDj3Aq06WVz26WdmkyoedJpLecOtuiGVXs5B861tVbH Jssz8r76GHCIS5QibkCufqC+Uu1D3zjfiwPST2k8955547PB/FnFSNxl3ybgKorICNR1 g27lXsItgI862AJtY16UBenhpcjQ6UM0TKdnTojkxYBifdwGWn13At+hBSHgXoxIq3UT MqO5xtpc10doxzJLHHIbVq/reU3A2/zfkGIfOi8B9zElmsTfm6HYCdFSBf9tM0sbRJoR oDmSJTrmzXTyWckIzpNkxoEYpTC9HL6L4AKyMJGRNn5+yevnwMFnp2Pyw7bfgWN2ix5s WicQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="iQld/0+w"; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-196808-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196808-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-794f2f05911si185667685a.151.2024.05.31.05.41.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 05:41:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-196808-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="iQld/0+w"; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-196808-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196808-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D5FA21C24854 for ; Fri, 31 May 2024 12:41:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0D5B615E5AE; Fri, 31 May 2024 12:39:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="iQld/0+w" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1DF82158A14; Fri, 31 May 2024 12:39:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717159155; cv=none; b=DDZNUKO9Kwylk4WP9F1WVNGBxEBNZ7IAEj4MtJyn64KpVvoH+/OtCUJe9mkEQgn0j4TfqVIMW+0w1ytI4fD0s/bqGDZnDyI7apkgRG5r0+qhD3aC7rCO99mSq5qW+ZicJSMdNp80g2GMHYWiZVv1K6WDX/qf76WyxQ+sPdfD6Ng= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717159155; c=relaxed/simple; bh=XHhIKllrLS04EQIbw2cXL6NKpGu+cxJfRqy8n5ltMfQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=a0h0HAvwm1BsAArAUoM3uup0CDpvIJs+E4GmgIH3sv5QcrkljwYElPiinFZsp1KY/kNEetBKDnB8bd1KAW+wPaY2KqQ0R+Lx/4M8t7ZoPtbRmXNyxXIY3xAzLtCZPxP18sVwtm6Rc3m8ygBmMR/993CY81bkUjeGjiKs9lSHWRI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=iQld/0+w; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=JUHpCtOFvJ217dOG69CLyUE0s9lGKzV3hZOfC/pApv8=; b=iQld/0+wSyfDLz98D3BIIzo6Ac x0Kz29ldzbaZqe3zBKjJV5QDN2L941s1LbVSuwnrhoAoU7XP/QxLTgu79MZ7uwZFM8R5ABwwaUS+E eCr7HJjGHMmlVgDZKCQ/ET2oUVa3AiYGlyTjXatp4q4nqfzZcBif0iRw6XtgN35+02gEDFDAIHxZb QkIAWVD7WxeqRRAcU63D4fj6MQcY4Bybro4TsAka9FJeb5N1ZYtMcqo/1a9pP6furrGehPRXH4v89 Ev9xqid/1uHzTf44rjHWrxGPVRQitVoixmDtn/7rI4kGEH6u5FLVUmya0YnvDbWir4nTaE8Pw/CQx PL3jCGig==; Received: from hch by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD1XK-0000000ADsj-3R6h; Fri, 31 May 2024 12:39:10 +0000 Date: Fri, 31 May 2024 05:39:10 -0700 From: Christoph Hellwig To: Zhang Yi Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, djwong@kernel.org, hch@infradead.org, brauner@kernel.org, david@fromorbit.com, chandanbabu@kernel.org, jack@suse.cz, willy@infradead.org, yi.zhang@huawei.com, chengzhihao1@huawei.com, yukuai3@huawei.com Subject: Re: [RFC PATCH v4 3/8] iomap: pass blocksize to iomap_truncate_page() Message-ID: References: <20240529095206.2568162-1-yi.zhang@huaweicloud.com> <20240529095206.2568162-4-yi.zhang@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240529095206.2568162-4-yi.zhang@huaweicloud.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html > - const struct iomap_ops *ops) > +iomap_truncate_page(struct inode *inode, loff_t pos, unsigned int blocksize, > + bool *did_zero, const struct iomap_ops *ops) > { > - unsigned int blocksize = i_blocksize(inode); > - unsigned int off = pos & (blocksize - 1); > + unsigned int off = rem_u64(pos, blocksize); > > /* Block boundary? Nothing to do */ > if (!off) Instad of passing yet another argument here, can we just kill iomap_truncate_page? I.e. just open code the rem_u64 and 0 offset check in the only caller and call iomap_zero_range. Same for the DAX variant and it's two callers.