linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Andreas Gruenbacher <agruenba@redhat.com>
Cc: cluster-devel@redhat.com, Christoph Hellwig <hch@lst.de>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v8 06/10] iomap: Add page_write_end iomap hook
Date: Tue, 5 Jun 2018 14:07:33 +0200	[thread overview]
Message-ID: <20180605120733.boqsxhku77warm7s@twin.jikos.cz> (raw)
In-Reply-To: <20180604193123.27655-7-agruenba@redhat.com>

On Mon, Jun 04, 2018 at 09:31:19PM +0200, Andreas Gruenbacher wrote:
> --- a/fs/iomap.c
> +++ b/fs/iomap.c
> @@ -181,16 +181,22 @@ iomap_write_begin(struct inode *inode, loff_t pos, unsigned len, unsigned flags,
>  
>  static int
>  iomap_write_end(struct inode *inode, loff_t pos, unsigned len,
> -		unsigned copied, struct page *page, struct iomap *iomap)
> +		unsigned copied, struct page *page, struct iomap *iomap,
> +		const struct iomap_ops *ops)
>  {
> +	typeof(ops->page_write_end) page_write_end = ops->page_write_end;

Is the reason to use typeof is to avoid repeating the type of
page_write_end? As it's only for a temporary variable with 2 uses,
ops->page_write_end does not hurt readability nor is too much typing.

I would not recommend using typeof outside of the justified contexts
like macros or without a good reason.

>  	int ret;
>  
>  	if (iomap->type == IOMAP_INLINE) {
>  		iomap_write_inline_data(inode, page, iomap, pos, copied);
>  		__generic_write_end(inode, pos, copied, page);
> +		if (page_write_end)
> +			page_write_end(inode, pos, copied, page, iomap);
>  		return copied;
>  	}
>  
> +	if (page_write_end)
> +		page_write_end(inode, pos, copied, page, iomap);
>  	ret = generic_write_end(NULL, inode->i_mapping, pos, len,
>  			copied, page, NULL);
>  	if (ret < len)
> @@ -198,11 +204,17 @@ iomap_write_end(struct inode *inode, loff_t pos, unsigned len,

  parent reply	other threads:[~2018-06-05 12:10 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-04 19:31 [PATCH v8 00/10] gfs2 iomap write support Andreas Gruenbacher
2018-06-04 19:31 ` [PATCH v8 01/10] iomap: inline data should be an iomap type, not a flag Andreas Gruenbacher
2018-06-04 19:31 ` [PATCH v8 02/10] iomap: Mark newly allocated buffer heads as new Andreas Gruenbacher
2018-06-04 19:31 ` [PATCH v8 03/10] iomap: Complete partial direct I/O writes synchronously Andreas Gruenbacher
2018-06-05 12:10   ` David Sterba
2018-06-05 12:32     ` Andreas Grünbacher
2018-06-06 10:26     ` Christoph Hellwig
2018-06-06 11:44       ` Andreas Gruenbacher
2018-06-04 19:31 ` [PATCH v8 04/10] fs: factor out a __generic_write_end helper Andreas Gruenbacher
2018-06-04 19:31 ` [PATCH v8 05/10] iomap: Generic inline data handling Andreas Gruenbacher
2018-06-05  5:34   ` Christoph Hellwig
2018-06-04 19:31 ` [PATCH v8 06/10] iomap: Add page_write_end iomap hook Andreas Gruenbacher
2018-06-05  7:56   ` Andreas Grünbacher
2018-06-05 12:07   ` David Sterba [this message]
2018-06-05 12:17     ` Andreas Grünbacher
2018-06-05 12:29       ` David Sterba
2018-06-05 12:50         ` Andreas Grünbacher
2018-06-04 19:31 ` [PATCH v8 07/10] gfs2: iomap buffered write support Andreas Gruenbacher
2018-06-04 19:31 ` [PATCH v8 08/10] gfs2: gfs2_extent_length cleanup Andreas Gruenbacher
2018-06-04 19:31 ` [PATCH v8 09/10] gfs2: iomap direct I/O support Andreas Gruenbacher
2018-06-04 19:31 ` [PATCH v8 10/10] gfs2: Remove gfs2_write_{begin,end} Andreas Gruenbacher

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=20180605120733.boqsxhku77warm7s@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=agruenba@redhat.com \
    --cc=cluster-devel@redhat.com \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --subject='Re: [PATCH v8 06/10] iomap: Add page_write_end iomap hook' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).