Re: [PATCH v2 3/5] fs: change write_begin/write_end interface to take struct kiocb *

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




在 2025/6/25 16:04, Christian Brauner 写道:
On Tue, Jun 24, 2025 at 01:51:51PM +0100, Matthew Wilcox wrote:
On Tue, Jun 24, 2025 at 12:12:08PM +0000, 陈涛涛 Taotao Chen wrote:
-static int blkdev_write_end(struct file *file, struct address_space *mapping,
+static int blkdev_write_end(struct kiocb *iocb, struct address_space *mapping,
  		loff_t pos, unsigned len, unsigned copied, struct folio *folio,
  		void *fsdata)
  {
  	int ret;
-	ret = block_write_end(file, mapping, pos, len, copied, folio, fsdata);
+	ret = block_write_end(iocb->ki_filp, mapping, pos, len, copied, folio, fsdata);
... huh.  I thought block_write_end() had to have the same prototype as
->write_end because it was used by some filesystems as the ->write_end.
I see that's not true (any more?).  Maybe I was confused with
generic_write_end().  Anyway, block_write_end() doesn't use it's file
argument, and never will, so we can just remove it.

+++ b/include/linux/fs.h
@@ -446,10 +446,10 @@ struct address_space_operations {
void (*readahead)(struct readahead_control *); - int (*write_begin)(struct file *, struct address_space *mapping,
+	int (*write_begin)(struct kiocb *, struct address_space *mapping,
  				loff_t pos, unsigned len,
  				struct folio **foliop, void **fsdata);
-	int (*write_end)(struct file *, struct address_space *mapping,
+	int (*write_end)(struct kiocb *, struct address_space *mapping,
  				loff_t pos, unsigned len, unsigned copied,
  				struct folio *folio, void *fsdata);
Should we make this a 'const struct kiocb *'?  I don't see a need for
filesystems to be allowed to modify the kiocb in future, but perhaps
other people have different opinions.
Given I picked up Willy's change I'll wait for a resubmit of this series
on top of vfs-6.17.misc unless I hear otherwise?
Sure, I’ll update the series on top of vfs-6.17.misc and resend it as soon as possible.

Best regards,
Taotao Chen





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux