[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tencent_5B902C24516F8FB647C156B41596BF68E70A@qq.com>
Date: Fri, 27 Jun 2025 10:40:41 +0800
From: Chen Taotao <chentao325@...com>
To: Christian Brauner <brauner@...nel.org>,
Matthew Wilcox <willy@...radead.org>
Cc: 陈涛涛 Taotao Chen <chentaotao@...iglobal.com>,
"tytso@....edu" <tytso@....edu>, "hch@...radead.org" <hch@...radead.org>,
"adilger.kernel@...ger.ca" <adilger.kernel@...ger.ca>,
"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>
Subject: Re: [PATCH v2 3/5] fs: change write_begin/write_end interface to take
struct kiocb *
在 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
Powered by blists - more mailing lists