From: Jens Axboe <axboe@kernel.dk>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
linux-block@vger.kernel.org, willy@infradead.org, clm@fb.com,
torvalds@linux-foundation.org, david@fromorbit.com
Subject: Re: [PATCH 4/5] iomap: add struct iomap_data
Date: Fri, 13 Dec 2019 13:47:35 -0700 [thread overview]
Message-ID: <90f26792-3751-c755-c0b9-a85b816e5340@kernel.dk> (raw)
In-Reply-To: <20191213203242.GB99868@magnolia>
On 12/13/19 1:32 PM, Darrick J. Wong wrote:
> On Thu, Dec 12, 2019 at 12:01:32PM -0700, Jens Axboe wrote:
>> We pass a lot of arguments to iomap_apply(), and subsequently to the
>> actors that it calls. In preparation for adding one more argument,
>> switch them to using a struct iomap_data instead. The actor gets a const
>> version of that, they are not supposed to change anything in it.
>>
>> Signed-off-by: Jens Axboe <axboe@kernel.dk>
>
> Looks good, only a couple of questions...
Thanks!
>> fs/dax.c | 25 +++--
>> fs/iomap/apply.c | 26 +++---
>> fs/iomap/buffered-io.c | 202 +++++++++++++++++++++++++----------------
>> fs/iomap/direct-io.c | 57 +++++++-----
>> fs/iomap/fiemap.c | 48 ++++++----
>> fs/iomap/seek.c | 64 ++++++++-----
>> fs/iomap/swapfile.c | 27 +++---
>> include/linux/iomap.h | 15 ++-
>> 8 files changed, 278 insertions(+), 186 deletions(-)
>>
>> diff --git a/fs/dax.c b/fs/dax.c
>> index 1f1f0201cad1..d1c32dbbdf24 100644
>> --- a/fs/dax.c
>> +++ b/fs/dax.c
>> @@ -1090,13 +1090,16 @@ int __dax_zero_page_range(struct block_device *bdev,
>> EXPORT_SYMBOL_GPL(__dax_zero_page_range);
>>
>> static loff_t
>> -dax_iomap_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
>> - struct iomap *iomap, struct iomap *srcmap)
>> +dax_iomap_actor(const struct iomap_data *data, struct iomap *iomap,
>
> I wonder, is 'struct iomap_ctx' a better name for the context structure?
Yeah I think you are right, does seem like a better fit. I'll rename it
for the next version.
>> @@ -43,17 +44,18 @@ iomap_apply(struct inode *inode, loff_t pos, loff_t length, unsigned flags,
>> * expose transient stale data. If the reserve fails, we can safely
>> * back out at this point as there is nothing to undo.
>> */
>> - ret = ops->iomap_begin(inode, pos, length, flags, &iomap, &srcmap);
>> + ret = ops->iomap_begin(data->inode, data->pos, data->len, data->flags,
>> + &iomap, &srcmap);
>
> ...and second, what do people think about about passing "const struct
> iomap_ctx *ctx" to iomap_begin and iomap_end to reduce the argument
> counts there too?
>
> (That's definitely a separate patch though, and I might just do that on
> my own if nobody beats me to it...)
To be honest, I just did what I needed, but I do think it's worth
pursuing in general. The argument clutter is real.
--
Jens Axboe
next prev parent reply other threads:[~2019-12-13 20:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-12 19:01 [PATCHSET v4 0/5] Support for RWF_UNCACHED Jens Axboe
2019-12-12 19:01 ` [PATCH 1/5] fs: add read support " Jens Axboe
2019-12-12 21:21 ` Matthew Wilcox
2019-12-12 21:27 ` Jens Axboe
2019-12-12 19:01 ` [PATCH 2/5] mm: make generic_perform_write() take a struct kiocb Jens Axboe
2019-12-12 19:01 ` [PATCH 3/5] mm: make buffered writes work with RWF_UNCACHED Jens Axboe
2019-12-12 19:01 ` [PATCH 4/5] iomap: add struct iomap_data Jens Axboe
2019-12-13 20:32 ` Darrick J. Wong
2019-12-13 20:47 ` Jens Axboe [this message]
2019-12-12 19:01 ` [PATCH 5/5] iomap: support RWF_UNCACHED for buffered writes Jens Axboe
2019-12-13 2:26 ` Darrick J. Wong
2019-12-13 2:38 ` Jens Axboe
2019-12-13 0:53 ` [PATCHSET v4 0/5] Support for RWF_UNCACHED Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=90f26792-3751-c755-c0b9-a85b816e5340@kernel.dk \
--to=axboe@kernel.dk \
--cc=clm@fb.com \
--cc=darrick.wong@oracle.com \
--cc=david@fromorbit.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=torvalds@linux-foundation.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox