From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 BB0B117A31C for ; Fri, 3 Jul 2026 00:17:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=209.85.128.41 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783037837; cv=pass; b=WWIoxxllQiM97cUwPy/A4reRe1ZiV0zAjrCGer40JwHt+p0eRL4g54Pwovf9uszOKs5jqAhIXdz3pmXk0FRWLl2bMngpbVmyKC496QPl/sydBsMEAEyBozC0KkfuJFgMOSN+TnTK3JrxTgpi4NN24TsOGp+Po0hyAgAToewAuM4= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783037837; c=relaxed/simple; bh=kRH5ME6cl2uOZNTf4Hz7cjp4HebVSYInnLBFWd3k8/I=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=RJpzDru+K6V2Ty2UduxCS4icX/94CQE7PSfQPcuqlaMd4QPCF796LNLYrBcLA8ekovTJJ4pmK4myqhKMUns9dLu2rcC5uqBxvzQqDz0l/R1E85uWe8g6g92DXXa1fWZ00160DB8H6EMZi2LCjvYFx/mL1ChJZNEB9UIZ2dGCAlQ= 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=a253fLdl; arc=pass smtp.client-ip=209.85.128.41 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="a253fLdl" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-493c55d5c7aso12080265e9.1 for ; Thu, 02 Jul 2026 17:17:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1783037834; cv=none; d=google.com; s=arc-20260327; b=LSw+yqxstLgbeAMe899VphL2JHOYLlPdEKQAheU1xujJLp+M3Hr5z4yMn9fH5nLyJo vjvmqnwE/Bt4C/87fb8zywuLRraUY0L37ISlnKZU1l7JQFV6VwPOhQR+AzOISqZiV4VR SAeRSt+/+ivOHOyLSaodVDxwO7UemworaAw+FiVXWjW9m3rwLXC4A3zDIeGINpqOS9AI Cm8aIUlc30w2vSCBQ3qTzprmETHhknGVNkOOLSSpwptNOThkWyUaiKWxrUIstu4l/Jdz usDcq6ZG43e8eTpDTvpWEPW1HEIiLgH/8OKzS2PA45WO/f42HRjpy9pp8AKXaPTTXwb0 m5TQ== 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=vU7OEUrLlyve1bXZ6P0sGV5EAt2DQDqFHvcpp7wTUdg=; fh=JZJRWYom2U00CDS7eqN8K4vxzW9242QTEdY0hJw/E64=; b=guPZGfxKbSepORjE+7wxuEH8RG+onYDeO/lYy9RlRtJrOtKQ6IsdPre3mAL/zgJVbd n+mFEPLDFb+XFiFlSact7lWnTxAzBf8ZIV83H1GYj+fNBOw1RS1NnqM0kQGzVHB1C0+k ekub2VEi2coIHIr9A1b7audEGWMQ3MRkNW3uKWjYANhjkgLqw2it9/SQQz4XGKIirzQW gKYJVsZj9B/yPcBj+sd5xLLsuDTgDA0y2k6Vdi/3XB81Hrg0Xp3vmt/8bAPDjuDdt6v6 Wry2yNTL4ly4GTTm8iSXYmwP583mTbs3Lwoc3vDQ0BetnQAB9kfqQ23jp/ZhjszUdcv9 v+tQ==; 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=1783037834; x=1783642634; 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=vU7OEUrLlyve1bXZ6P0sGV5EAt2DQDqFHvcpp7wTUdg=; b=a253fLdlbH8sjLvBQuxc18I7crzBttsxvYqvDQKjdsDqmfby4HxHTiwKBeYtfQQ1p2 fh/NNNkiEW9X42YMwUy5BL6qjFZsgG79TS93wnUMg1ENd7lC9bWuRUojmsAlFGZlG7oR SPjr+K7XCDpAgW3mCbvg+3BmePEaE825ByxEhVgqByT1XDwEnrKuSX5d/yF2BLyer5mS ChzX45p2lDAQtLYtKI3ytM7J+SsLMMfkvDL4l5QHFiLAakQhDJWvXcVQTV0RU+xHFX02 oIR4u6PTI4Aj/4YErRx6q+umHvbfjb03WNF1DboheuhkNRvK6jK32I/h0fQL9HRfAZcY tvCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783037834; x=1783642634; 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=vU7OEUrLlyve1bXZ6P0sGV5EAt2DQDqFHvcpp7wTUdg=; b=XJh7QDUgmAdAUWdcYileL7+cEemqmC9te/OECXKBjb0BEErvPgLLHr2Z6GFvefD9dX 7xmlmK6pBRqoV2mpt2nufVQLEl05g7vDHbLK9EdkvNJpWf1M3t04d9bxEulNPjn5Z9xf NWSO6OYcZsivVxWPB+x08BThEIRhjQPISFTr5YqN2a40rRmFt8LGqj3gximkmlb1yrWp 5bEnRg/NsTcKigWSr3INL8BNPa5MKgoXceIpD3dB99/m5fWGhIgChV+/Z+ehm2wz9ltm p9SR4JX3kL+snd5YB2v/ulDGMc9GdLoF8XClNfNF1H3Z5ZxWgMGEW+pTWIiiUY+WLFTo 7pxw== X-Forwarded-Encrypted: i=1; AFNElJ+w0pFUoWzGKzzBeUHQzUCWAbwniZiuy6ihmMvKWMLWcTc8bHl8dJyw1eoPeeOdJnMVVnQHdJe+ueSkjdg=@vger.kernel.org X-Gm-Message-State: AOJu0YwSa+P4wVGPKm2a99cv4wqG0+FGYVNX1kMHNveN0DudrmX3Rz+f PzVpa0RfcGauFeDTSWpcDCULrH22bUYl1taPQHjn0Cz8+2ToIQHNlAyQlK9Xvr5d/FySYl+nzed QTiLnr0HAJyBnLwpS0lwfWJujAIxcYlU= X-Gm-Gg: AfdE7cnqCydbHBj/7Beg5hTSZCo5vg+9yKz/e3BX5G16iLwvbpxoBkCKidJKlLht4bv IiAbVUdO26wzhRQTeddZOJz9SaxFOEUIQrbHkfMEdJDrQRnmdyEkDwNhi79CrT7aSWHZL2XZqYP T8Ar/ynbOuCMKC6vD74cDaKB1U7oV7b28ZH4g8NrhiXs0bbUy+OFs4c5O68ytjIAPFBxNt9rZYP 4RPJ+fckGgsCd2vrTNYrg9ZrYFTMzZwMzZh0642q4tep9MIyBovjsXz6d4JJECHa3nTHcmRods+ EC5QhSk6zqcrmk6c0HiVQmyP9xZ2NVhuILyoOD62s6NNnoewdd9DzVboGwOskRE= X-Received: by 2002:a05:600c:46d0:b0:493:bc4a:c6b6 with SMTP id 5b1f17b1804b1-493c2ba1d3emr113298325e9.38.1783037834179; Thu, 02 Jul 2026 17:17:14 -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-18-joannelkoong@gmail.com> <20260702165841.GM9392@frogsfrogsfrogs> In-Reply-To: <20260702165841.GM9392@frogsfrogsfrogs> From: Joanne Koong Date: Thu, 2 Jul 2026 17:17:02 -0700 X-Gm-Features: AVVi8CcxJan3XgaMiYmE7l9m1K7rjamtB3vH8NBAZsWn7x4K1BrIcNnVAJIzZPo Message-ID: Subject: Re: [PATCH v2 17/18] iomap: pass iomap_next_fn directly instead of struct iomap_ops To: "Darrick J. Wong" Cc: brauner@kernel.org, hch@lst.de, willy@infradead.org, hsiangkao@linux.alibaba.com, linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, Jens Axboe , Chris Mason , David Sterba , Alexander Viro , Jan Kara , Dan Williams , Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu , Sandeep Dhavale , Hongbo Li , Chunhai Guo , Namjae Jeon , Sungjong Seo , Yuezhang Mo , "Theodore Ts'o" , Andreas Dilger , Baokun Li , Ojaswin Mujoo , "Ritesh Harjani (IBM)" , Zhang Yi , Jaegeuk Kim , Miklos Szeredi , Andreas Gruenbacher , Mikulas Patocka , Hyunchul Lee , Konstantin Komarov , Carlos Maiolino , Damien Le Moal , Naohiro Aota , Johannes Thumshirn , "open list:BLOCK LAYER" , open list , "open list:BTRFS FILE SYSTEM" , "open list:FILESYSTEM DIRECT ACCESS (DAX)" , "open list:EROFS FILE SYSTEM" , "open list:EXT2 FILE SYSTEM" , "open list:F2FS FILE SYSTEM" , "open list:FUSE FILESYSTEM [CORE]" , "open list:GFS2 FILE SYSTEM" , "open list:NTFS3 FILESYSTEM" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jul 2, 2026 at 9:58=E2=80=AFAM Darrick J. Wong = wrote: > > > diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c > > index 3f0932e46fd6..0aa8abc438c1 100644 > > --- a/fs/iomap/buffered-io.c > > +++ b/fs/iomap/buffered-io.c > > @@ -626,7 +626,7 @@ static int iomap_read_folio_iter(struct iomap_iter = *iter, > > return 0; > > } > > > > -void iomap_read_folio(const struct iomap_ops *ops, > > +void iomap_read_folio(iomap_next_fn iomap_next, > > If you took my earlier suggestion to rename the typedef to > iomap_iter_fn, then this parameter ought to be named iter_fn. Hmm... maybe at that point, it's self-explanatory enough that the arg could just be called "iter" instead of "iter_fn"? > > > struct iomap_read_folio_ctx *ctx, void *private) > > { > > struct folio *folio =3D ctx->cur_folio; > > @@ -650,7 +650,7 @@ void iomap_read_folio(const struct iomap_ops *ops, > > fsverity_readahead(ctx->vi, folio->index, > > folio_nr_pages(folio)); > > > > - while ((ret =3D iomap_iter(&iter, ops)) > 0) { > > + while ((ret =3D iomap_iter(&iter, iomap_next)) > 0) { > > iter.status =3D iomap_read_folio_iter(&iter, ctx, > > &bytes_submitted); > > iomap_read_submit(&iter, ctx); > > @@ -688,22 +688,22 @@ static int iomap_readahead_iter(struct iomap_iter= *iter, > > > > /** > > * iomap_readahead - Attempt to read pages from a file. > > - * @ops: The operations vector for the filesystem. > > + * @iomap_next: The iomap_next callback for the filesystem. > > "The iomap iteration function for the filesystem" ? > > Using the term "iomap_next" in the definition for iomap_next isn't that > helpful. Agreed, I'll replace this with your suggestion. > > > return ret; > > @@ -824,16 +824,16 @@ xfs_file_dio_write_atomic( > > unsigned int iolock =3D XFS_IOLOCK_SHARED; > > ssize_t ret, ocount =3D iov_iter_count(from); > > unsigned int dio_flags =3D 0; > > - const struct iomap_ops *dops; > > + iomap_next_fn dops; > > > > /* > > * HW offload should be faster, so try that first if it is alread= y > > * known that the write length is not too large. > > */ > > if (ocount > xfs_inode_buftarg(ip)->bt_awu_max) > > - dops =3D &xfs_atomic_write_cow_iomap_ops; > > + dops =3D xfs_atomic_write_cow_iomap_next; > > else > > - dops =3D &xfs_direct_write_iomap_ops; > > + dops =3D xfs_direct_write_iomap_next; > > Probably ought to be called iter_fn, or at least something that isn't > "dops". Nice spotting, I'll rename this in the next version. Thanks, Joanne