xfs
[Top] [All Lists]

Re: [PATCH 02/14] fs: introduce iomap infrastructure

To: Christoph Hellwig <hch@xxxxxx>
Subject: Re: [PATCH 02/14] fs: introduce iomap infrastructure
From: Jan Kara <jack@xxxxxxx>
Date: Thu, 16 Jun 2016 18:12:42 +0200
Cc: xfs@xxxxxxxxxxx, rpeterso@xxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1464792297-13185-3-git-send-email-hch@xxxxxx>
References: <1464792297-13185-1-git-send-email-hch@xxxxxx> <1464792297-13185-3-git-send-email-hch@xxxxxx>
User-agent: Mutt/1.5.24 (2015-08-30)
On Wed 01-06-16 16:44:45, Christoph Hellwig wrote:
> Add infrastructure for multipage buffered writes.  This is implemented
> using an main iterator that applies an actor function to a range that
> can be written.
> 
> This infrastucture is used to implement a buffered write helper, one
> to zero file ranges and one to implement the ->page_mkwrite VM
> operations.  All of them borrow a fair amount of code from fs/buffers.
> for now by using an internal version of __block_write_begin that
> gets passed an iomap and builds the corresponding buffer head.
> 
> The file system is gets a set of paired ->iomap_begin and ->iomap_end
> calls which allow it to map/reserve a range and get a notification
> once the write code is finished with it.
> 
> Based on earlier code from Dave Chinner.
> 
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> Reviewed-by: Bob Peterson <rpeterso@xxxxxxxxxx>

When reading through the patch I've noticed two minor errors in the
comments:

...
> +static loff_t
> +iomap_apply(struct inode *inode, loff_t pos, loff_t length, unsigned flags,
> +             struct iomap_ops *ops, void *data, iomap_actor_t actor)
> +{
> +     struct iomap iomap = { 0 };
> +     loff_t written = 0, ret;
> +
> +     /*
> +      * Need to map a range from start position for count bytes. This can
                                                       ^^^^ length
...

>  struct iomap {
> -     sector_t        blkno;  /* first sector of mapping */
> -     loff_t          offset; /* file offset of mapping, bytes */
> -     u64             length; /* length of mapping, bytes */
> -     int             type;   /* type of mapping */
> +     sector_t                blkno;  /* first sector of mapping, fs blocks */

This is actually in 512-byte units, not in fs blocks as the comment
suggests, right?

                                                                Honza
-- 
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR

<Prev in Thread] Current Thread [Next in Thread>