From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DB7AC636C8 for ; Tue, 20 Jul 2021 11:43:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1EA6861222 for ; Tue, 20 Jul 2021 11:43:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1EA6861222 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BFB3A6B00BC; Tue, 20 Jul 2021 07:43:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BD0EE6B00BD; Tue, 20 Jul 2021 07:43:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AC0526B00BE; Tue, 20 Jul 2021 07:43:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0024.hostedemail.com [216.40.44.24]) by kanga.kvack.org (Postfix) with ESMTP id 7D1F56B00BC for ; Tue, 20 Jul 2021 07:43:50 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 0AC308248047 for ; Tue, 20 Jul 2021 11:43:49 +0000 (UTC) X-FDA: 78382781778.30.6A413A6 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf12.hostedemail.com (Postfix) with ESMTP id C125810000A3 for ; Tue, 20 Jul 2021 11:43:48 +0000 (UTC) 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=ttlOaivC03YsJ7TBE/oQQyfqlAgy1q5eYHsgF1bddgA=; b=A+xbrWSa0Yw/Jyi3Q4wQSRpr68 xPWPtNtyo1giAkrFLO2yAihOpnSmt1zB+koMdFPOqlVJz7NfV1MtLFLMzD1U47xtpyqrQ+q7NtLxl 8Jv0aey8pPiRsyNv9vf3Yj5KDMyRATYIz3w6/x0djWMEZwe7BQc+Mktqu7oiGUYsY+rCuwE3wdpfK RCqHIUt6qp7/4fuCpWXA6JpcqUuDKgObTW2K925qORegWX6QB8uT82ehZEoEaLk1vaRZyKlWvV6g2 gYuygYEH/wnMiD9o0FnBAk8cbuTtfde3JtDDYhbwNq2OWY1kibj2eFOyZha0hk9gCGyJv7K3soqFo EIPvouJg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m5o9C-0083gt-N3; Tue, 20 Jul 2021 11:43:07 +0000 Date: Tue, 20 Jul 2021 12:42:50 +0100 From: Matthew Wilcox To: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-block@vger.kernel.org, "Darrick J . Wong" Subject: Re: [PATCH v15 09/17] iomap: Use folio offsets instead of page offsets Message-ID: References: <20210719184001.1750630-1-willy@infradead.org> <20210719184001.1750630-10-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=A+xbrWSa; spf=none (imf12.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Stat-Signature: e8grr51yi4iiweru6bmsu31cq3zbeknk X-Rspamd-Queue-Id: C125810000A3 X-Rspamd-Server: rspam01 X-HE-Tag: 1626781428-125447 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Jul 20, 2021 at 08:59:45AM +0200, Christoph Hellwig wrote: > > + size_t poff = offset_in_folio(folio, *pos); > > + size_t plen = min_t(loff_t, folio_size(folio) - poff, length); > > These variables are a little misnamed now. But I'm not sure what a > better name would be. Yes, foff and flen would be ambiguous -- is f folio or file? I tend to prefer 'offset' and 'length', but we already have a loff_t length and having both a len and a length isn't conducive to understanding. Maybe rename loff_t length to extent_len? I'm going to leave it for now unless we have a really good suggestion. > > + size_t off = (page - &folio->page) * PAGE_SIZE + > > + bvec->bv_offset; > > Another use case for the helper I suggested earlier. Deleted in the very next patch, alas.