From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6D69357CFA for ; Thu, 2 Jul 2026 23:02:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=209.85.221.45 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783033328; cv=pass; b=im0naD5J6lDD6g0KYVDAgKoD0rRpSIxTZEkpC1mPebDFCIfCgIj5XVk3cwW232AgSoiCnqHS/P1FIISg5mwXmwPfU1/N3/3/32e37XFoqOQ7fNUgP7H5+tEs5zO3xJTEiv2bk5Az9FCfN2K9ZWvKgVjDFtLz6BvooekPI7z0yIY= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783033328; c=relaxed/simple; bh=4Kn3VQND47UCcI26pv7bb40u477SLSvq4NVjLC7sHeg=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=C4JTQfMAYGiipkbCpkP6X2jEkHadAYGXf7LedhKiYVHWo+JDQeq/Zt6vKvq7ybl0VcktShmgFq5DTETjohHCDfMOQoMZEmajzgXWDTodopJ2Rxkw+uGgEg4GD6gkBDJuwPRcSsJAjNrmt2OanYpW1CYHavByzOF9YOiS1Xlxt/c= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fJaEPJ3l; arc=pass smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fJaEPJ3l" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-4629051c946so767608f8f.1 for ; Thu, 02 Jul 2026 16:02:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1783033325; cv=none; d=google.com; s=arc-20260327; b=MSXZq5KTydy74UpBJeiHn2A+2eRzXjcXoFmNeYR1mR9QHJwobX+H/oJwpgpKWaCbUn C8r2hrXqJrs098cyF9j8TP/f3oNqnPHDw0mgmm58h9nmYeFEgUuYFZjb7ExVpqEDv9ME oQgmpnctUAAeq2NBOotnZDgbjr7DefcfUjfECodVeG4xFyZTxfeL8mI1lTWa6u1CcMGp iArjQE9ChLdxe4IFfHXxWS4Qb3rLqPiUkI83idELADliqRqE6FBTCTWD5bH/KL9TKWZa P+dnByY86OGbsSdKH1tFumjfO/QRoMKdW+UCjsx6aAoN9uU6G4H1ehxt7xl1R5E5NTwX cnSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=4DB0StncCI4DCdkHVBFZN5AAMbnpw9y/OLi7Kcm8C6U=; fh=WmpkM6lMfNXorMQTk82M7kRZolVj69xUzJw1iiW3nvk=; b=FEn2RJwNY5cygkv06SVlHNtjlq4Xl3H/5JgRBYIBv4ROqGiZ06VUABiMyT2GSxnv5j Z615n0qdfVtIcoxPvyOPjlf02gYJdc6DNjTRnyJkTD0uNdel9mBsK1ZJUZMEzsgd6g8Z 4Sucq09MVKtZSzB1PocJcqFpZMq0tmQ3PF67Zogu18MyRldBdT0m+Y0pEjnuPn2u3/rB iy0TvV7K1Md8PlZsuTGlfCFPjWuut/eEtipRBDy4kSgywRGKQ3gfP6h71/hFQw+FqU6F gJ2KHJTRSzG/Ptafae3Sl/VicBDj/ScpxkV4vPjWrU1iOxiGuPcbNEtGW/izZirJnILM N6iw==; darn=vger.kernel.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783033325; x=1783638125; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=4DB0StncCI4DCdkHVBFZN5AAMbnpw9y/OLi7Kcm8C6U=; b=fJaEPJ3ld+n66r1G5fSulWfucGH7LbdhRHl+lw4OzgmeFjsyUZpSjGk0ARFBeMStHJ 5iBdiO1V9XFNcgioODdbtjBieLBMehoW9n2JdGkpAk9S6+6qTfdfCGEjKPr5XM7VioOu CBxZtd6lthU/F0kBOtEAW9th911Tkx2DnrhSZwqa0UuanXVZfgk3C411Tf/gUNvMBVrc rzOZRzxgrcApMw2SeK/YK43VaOAKVhQXCNJ9OOdwZV18IvOM43VGIMl1Gejr54Wa9orj Xus2O8eFj4mYhw8D33DFyRSomOK1AbOjSkpIJkHilF6ovudCY3f3PryZAjQy+wTpaa5i CuZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783033325; x=1783638125; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=4DB0StncCI4DCdkHVBFZN5AAMbnpw9y/OLi7Kcm8C6U=; b=mt13WB+qK6VPV5kiTl3QVf7kJ9+cvgT5Z5kVZImJAc8qQ+EeqekdVCruaGuO8dkCOi ssBmCNMpz3fwuIbPjcy40uGntU9ZF/d3j5ua6F7B0n2sV8sduOccDg8ICGyU1vUQuWAK 0vTGzCoBu63x/V0LeED/+eDRKK2qyTyVW7j9+n57dRuODdkhwnqcGPED1Y6CC1tsRE3U jBjuJKc0ipkn2fO5w6x2wCOJmrdRCVqKYBlrSRJ9xJtheyxe3MtTelW3GMfl4G8PWIFA krna1dQj4ZA67MQFeS78reNtUfQOQbQkCaqPdEdDRHZndK5R9QBvy2bLOtjnrWy3jQYH jUJA== X-Forwarded-Encrypted: i=1; AHgh+RrQ3ysFKphBWMQnuZ8Or45ncVRPkNEAvEQNaMYZ0QowfIfdviM0TKzLmQoAsgZ/Y/erEYLfvCK8jcV1jt8=@vger.kernel.org X-Gm-Message-State: AOJu0Yz0dExwO3tikUj4s0QHxX0HNsrIm8n5UkXyfoEiRANS4fL0JSbV kezGx7EyvbtOnLTF68W29ngknO3FX/7DXFE8U2PbC74F+OepRRCmEddxwu2fzWWSpyBaIEA2pnl bCIe40nqQXTC5kWmkNORA8/rp15y6/YFW11Qp X-Gm-Gg: AfdE7clyFvx+nWWRZQbpGvsl4jM6MQILG4xG0i38e1OH2pYCEvztx9nuW4gQ6ByeL1A KsrcpShB9B7iWjGJpJeTknNux31BZFWL+cPMOLnxyhCxk5kOwcMFBQ2uTrtPVe8ia8YJFUQSFRA qxn1sA2dJut4Jt2V/0XiI6CsyFEtQjDMQXdcgxRck/21N4+2S/+WFIWSkjw7bjkxcrndVM3KgFc XV5egVn3nGjA9dKOw2kwwst4kfFypgfXst30PItZvsQzopJ+4NmyUNWQdX6K8tSy1KZZHUvs7cO enQaBpXeBq9Hh62lOX+zb7aCsmzCqY+3lq4AwVaTHVknkdR3WL5q X-Received: by 2002:a5d:5ccc:0:b0:475:f0c2:75b3 with SMTP id ffacd0b85a97d-47936d2f33emr1915668f8f.30.1783033324743; Thu, 02 Jul 2026 16:02:04 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20260701000949.1666714-1-joannelkoong@gmail.com> <20260701000949.1666714-2-joannelkoong@gmail.com> <20260702140009.GA21339@lst.de> In-Reply-To: <20260702140009.GA21339@lst.de> From: Joanne Koong Date: Thu, 2 Jul 2026 16:01:51 -0700 X-Gm-Features: AVVi8CeaIMzXU9RzKe_zbiO3Q8oQSJv6T5IEdOvWb1S4DuwOGjn86_r2tKsstdQ Message-ID: Subject: Re: [PATCH v2 01/18] iomap: add ->iomap_next() and iomap_process() helper To: Christoph Hellwig Cc: brauner@kernel.org, djwong@kernel.org, willy@infradead.org, hsiangkao@linux.alibaba.com, linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, open list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jul 2, 2026 at 7:00=E2=80=AFAM Christoph Hellwig wrote= : > > On Tue, Jun 30, 2026 at 05:09:16PM -0700, Joanne Koong wrote: > > +static int iomap_iter_legacy(struct iomap_iter *iter, const struct iom= ap_ops *ops) > > Overly long line here. Not that it really matters too much given > that this goes away by the end of the series. I'll fix this. > > > + * Iterate over filesystem-provided space mappings for the provided fi= le range. > > + * > > + * This function handles cleanup of resources acquired for iteration w= hen the > > + * filesystem indicates there are no more space mappings, which means = that this > > + * function must be called in a loop that continues as long it returns= a > > + * positive value. If 0 or a negative value is returned, the caller m= ust not > > + * return to the loop body. Within a loop body, there are two ways to= break out > > + * of the loop body: leave @iter.status unchanged, or set it to a neg= ative > > + * errno. > > + */ > > +int iomap_iter(struct iomap_iter *iter, const struct iomap_ops *ops) > > +{ > > + if (ops->iomap_next) > > + return iomap_iter_next(iter, ops); > > + > > + return iomap_iter_legacy(iter, ops); > > Maybe inline the code currently in iomap_iter_next here from the > start, as that what we're getting to by the end of the series anyway. > And just do a: > > if (!ops->iomap_next)) > return iomap_iter_legacy(iter, ops); > > at the beginning? Sounds good, I'll make this change. > > > +int iomap_iter_continue(const struct iomap_iter *iter, struct iomap *i= omap, > > > > It seems like this is largely just factored out form the old iomap_iter()= . > Can you do a prep patch before this one which factors this out? > Preferably in a way that keeps the code in roughly the same place to > minimize the git blame disturbance? Sounds good, I'll extract this shared logic out into a preparatory patch. Thanks, Joanne