[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aFqfZ9hiiW4qnYtO@casper.infradead.org>
Date: Tue, 24 Jun 2025 13:51:51 +0100
From: Matthew Wilcox <willy@...radead.org>
To: 陈涛涛 Taotao Chen <chentaotao@...iglobal.com>
Cc: "tytso@....edu" <tytso@....edu>,
"hch@...radead.org" <hch@...radead.org>,
"adilger.kernel@...ger.ca" <adilger.kernel@...ger.ca>,
"brauner@...nel.org" <brauner@...nel.org>,
"jani.nikula@...ux.intel.com" <jani.nikula@...ux.intel.com>,
"rodrigo.vivi@...el.com" <rodrigo.vivi@...el.com>,
"tursulin@...ulin.net" <tursulin@...ulin.net>,
"airlied@...il.com" <airlied@...il.com>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"linux-ext4@...r.kernel.org" <linux-ext4@...r.kernel.org>,
"linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
"intel-gfx@...ts.freedesktop.org" <intel-gfx@...ts.freedesktop.org>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"chentao325@...com" <chentao325@...com>
Subject: Re: [PATCH v2 3/5] fs: change write_begin/write_end interface to
take struct kiocb *
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.
Powered by blists - more mailing lists