Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1128367lqd; Thu, 25 Apr 2024 06:53:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU1nUCq2O929h1N6VOr6OCa0S1qnpYr4sLTNtiDYXmfvWkm61vBvSTeZsPqN1biNPiwS6KUHb62P3hc4sawLcZfVSbpM3br3s085nfxrw== X-Google-Smtp-Source: AGHT+IELNSjZMtSnKhinCbrv7PZU3ZaKc166ptW3aPWlr2KlmyniN3wbtCxzfzalRk8VQmJtGbQY X-Received: by 2002:a05:622a:547:b0:437:9be4:6679 with SMTP id m7-20020a05622a054700b004379be46679mr6508797qtx.34.1714053232286; Thu, 25 Apr 2024 06:53:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714053232; cv=pass; d=google.com; s=arc-20160816; b=vWybOFMZHIb5GnLnAxv+HZOWWq1lRvbDzHIAKG7QJNdiKxYI/0D2cq0ijJ1vWhruyw l18GZB++cpJI5Ow9wmVaTnH+lNXWgbwAzjo/iU8UuoOplBhzlGshR8YIjInv/EhdsI81 XaXwE6h5A3zNkVeMlN3htCTXVAo6vcMd1bICuEJ8PwdXSGun8kGuPEhuZjJRWxcv0/Wn zk2DhjXiI0OCh+EsIY7Kf6lNxqGleTDvyJEjY6LnNZZJbx9QsMT3ouP4BR04Prxm3V22 z0RyhubS6kDnUtoFTMyWYlXrYrd7J0+i+dl1yZmBfpcFSjC8xM7PN9lognTobCE3qRfP Onsg== 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=5Wpcc2EluftTR3n+n1SeM6zbEpUWGx7QYSyu+jsGwMo=; fh=pTQpbzPpbYZ9a4e03czGqF6O9kyd+DZHCvlK9n/sCgg=; b=iFx15yM4B0bWMacT82YnscbPvugV2zfuQ05Pko7TvAmd5UFBZ2Ybxp4yo/1VMq1uEg ElFwHXjvT7driPHtlpsNWBsJ0QJBynOLc3qcTO1iiHWnHVcSQVHNc4vKF0AgXM6b9Avk tRgswyN21ofA+5dEF2W2GxHFasgQWngFbQYa+XN9zb2s/R8g3kgmSL8uE3ENIZbqKtG2 P3bLv06K0O7EEHoKOSSo0zxyDRv8PN5YVSYsFBBJGnUBCJQoSu773SvwVgUJF7g/cQXW 1aw5+TMWA5qp5NhggO8aqmadON8FA7KOMPE0JnK2ixkKLR1JpqiIosJc6Z8n5/+2zsGk v41Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="NL2h/pvk"; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-ext4+bounces-2188-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-ext4+bounces-2188-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 z3-20020a05622a028300b00437b740c3d4si15636448qtw.79.2024.04.25.06.53.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 06:53:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4+bounces-2188-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=casper.20170209 header.b="NL2h/pvk"; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-ext4+bounces-2188-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-ext4+bounces-2188-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 0773D1C211F4 for ; Thu, 25 Apr 2024 13:53:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 97CFA149DE5; Thu, 25 Apr 2024 13:53:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="NL2h/pvk" X-Original-To: linux-ext4@vger.kernel.org Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 E898D1494D2; Thu, 25 Apr 2024 13:53:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714053223; cv=none; b=Knv1k21y9IyeLgOl6X/VCorbL1B1zsBiBB+5929X9wsC8KxFN2CeRHYOw8MFbPEhLQpp3rezh91AfcFPaeo3IaCQtHL4uNRXpcj263O+jmGO6Oo13kPuCi+ipYAgMvOEOUE1V0uo+tgOJT5dRVf5xc5x29o2FXPiT+EMytyWk80= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714053223; c=relaxed/simple; bh=kTygqRn5TnrYiQq0EdL4g698bxw2DbF8Yc06ogmZQjk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EEssbvq+4G1A4TZKermktnh7rLGvuKUeei3QECMTRIYfuBFIFZI4L8vHtoAt098syTFMkSEp+w2ThsK0w6RsPJ7yTres85yM96lrBfAoodAigokme+wyhG6h/9QzA+YbwRSoOL69X1yToJnrY5BYH1gSw3teIShUo2Y+6dG8mt8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=NL2h/pvk; arc=none smtp.client-ip=90.155.50.34 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=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=5Wpcc2EluftTR3n+n1SeM6zbEpUWGx7QYSyu+jsGwMo=; b=NL2h/pvkiBcr+1dzLWdofK3E0b sGfVi0Z4TZXvobq8MGiOimgjeTOXNDUIERbQH9ACUcD80ZDv15pW+25HpFYLPPbgaET0O9p5KlygX /YwTAWH5i0VoYkpWU/YUmLjb0uRXo8tMKymVfT9ulCeTXNA4QUqkIItp4xqdvwOmJTUWUo1qCLQcb RD3aA4Ps/SXf38DC1rrFmiBCirMkTktH8MXECpuUOB+IHrPeZm0vWlZq0vPaRsVbieJCcjhozR40h y1GvB3/jgIwfWxLdqS+I+TB/OFKZyEovpxsVOzWW3iat/OX/VQX683/LgNCSGHt4GeOOvZsNdrZgN ZqhHHHaQ==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzzXZ-000000039NX-2m4Q; Thu, 25 Apr 2024 13:53:33 +0000 Date: Thu, 25 Apr 2024 14:53:33 +0100 From: Matthew Wilcox To: "Ritesh Harjani (IBM)" Cc: linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, "Darrick J . Wong" , Ojaswin Mujoo , Jan Kara Subject: Re: [RFCv3 6/7] iomap: Optimize iomap_read_folio Message-ID: References: Precedence: bulk X-Mailing-List: linux-ext4@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: On Thu, Apr 25, 2024 at 06:58:50PM +0530, Ritesh Harjani (IBM) wrote: > +static loff_t iomap_read_folio_iter(const struct iomap_iter *iter, > + struct iomap_readpage_ctx *ctx) > +{ > + struct folio *folio = ctx->cur_folio; > + size_t pos = offset_in_folio(folio, iter->pos); "pos" is position in file. You should call this 'offset'. > + loff_t length = min_t(loff_t, folio_size(folio) - pos, > + iomap_length(iter)); > + loff_t done, ret; > + > + for (done = 0; done < length; done += ret) { > + ret = iomap_readpage_iter(iter, ctx, done); > + if (ret <= 0) > + return ret; > + }