linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Matthew Wilcox <willy@infradead.org>,
	Christoph Hellwig <hch@infradead.org>,
	Brian Foster <bfoster@redhat.com>,
	Andreas Gruenbacher <agruenba@redhat.com>
Subject: Re: [PATCHv11 5/8] iomap: Use iomap_punch_t typedef
Date: Wed, 12 Jul 2023 21:33:56 -0700	[thread overview]
Message-ID: <20230713043356.GE108251@frogsfrogsfrogs> (raw)
In-Reply-To: <b41412dae42389fc1db9d6cb37810cae5d943c0f.1688188958.git.ritesh.list@gmail.com>

On Sat, Jul 01, 2023 at 01:04:38PM +0530, Ritesh Harjani (IBM) wrote:
> It makes it much easier if we have iomap_punch_t typedef for "punch"
> function pointer in all delalloc related punch, scan and release
> functions. It will be useful in later patches when we will factor out
> iomap_write_delalloc_punch() function.
> 
> Suggested-by: Matthew Wilcox <willy@infradead.org>
> Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>

Thank goodness
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  fs/iomap/buffered-io.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
> index cddf01b96d8a..33fc5ed0049f 100644
> --- a/fs/iomap/buffered-io.c
> +++ b/fs/iomap/buffered-io.c
> @@ -23,6 +23,7 @@
>  
>  #define IOEND_BATCH_SIZE	4096
>  
> +typedef int (*iomap_punch_t)(struct inode *inode, loff_t offset, loff_t length);
>  /*
>   * Structure allocated for each folio to track per-block uptodate state
>   * and I/O completions.
> @@ -900,7 +901,7 @@ EXPORT_SYMBOL_GPL(iomap_file_buffered_write);
>   */
>  static int iomap_write_delalloc_scan(struct inode *inode,
>  		loff_t *punch_start_byte, loff_t start_byte, loff_t end_byte,
> -		int (*punch)(struct inode *inode, loff_t offset, loff_t length))
> +		iomap_punch_t punch)
>  {
>  	while (start_byte < end_byte) {
>  		struct folio	*folio;
> @@ -978,8 +979,7 @@ static int iomap_write_delalloc_scan(struct inode *inode,
>   * the code to subtle off-by-one bugs....
>   */
>  static int iomap_write_delalloc_release(struct inode *inode,
> -		loff_t start_byte, loff_t end_byte,
> -		int (*punch)(struct inode *inode, loff_t pos, loff_t length))
> +		loff_t start_byte, loff_t end_byte, iomap_punch_t punch)
>  {
>  	loff_t punch_start_byte = start_byte;
>  	loff_t scan_end_byte = min(i_size_read(inode), end_byte);
> @@ -1072,8 +1072,7 @@ static int iomap_write_delalloc_release(struct inode *inode,
>   */
>  int iomap_file_buffered_write_punch_delalloc(struct inode *inode,
>  		struct iomap *iomap, loff_t pos, loff_t length,
> -		ssize_t written,
> -		int (*punch)(struct inode *inode, loff_t pos, loff_t length))
> +		ssize_t written, iomap_punch_t punch)
>  {
>  	loff_t			start_byte;
>  	loff_t			end_byte;
> -- 
> 2.40.1
> 

  reply	other threads:[~2023-07-13  4:34 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-01  7:34 [PATCHv11 0/8] iomap: Add support for per-block dirty state to improve write performance Ritesh Harjani (IBM)
2023-07-01  7:34 ` [PATCHv11 1/8] iomap: Rename iomap_page to iomap_folio_state and others Ritesh Harjani (IBM)
2023-07-13  4:31   ` Darrick J. Wong
2023-07-01  7:34 ` [PATCHv11 2/8] iomap: Drop ifs argument from iomap_set_range_uptodate() Ritesh Harjani (IBM)
2023-07-13  4:31   ` Darrick J. Wong
2023-07-01  7:34 ` [PATCHv11 3/8] iomap: Add some uptodate state handling helpers for ifs state bitmap Ritesh Harjani (IBM)
2023-07-13  4:32   ` Darrick J. Wong
2023-07-01  7:34 ` [PATCHv11 4/8] iomap: Fix possible overflow condition in iomap_write_delalloc_scan Ritesh Harjani (IBM)
2023-07-13  4:33   ` Darrick J. Wong
2023-07-01  7:34 ` [PATCHv11 5/8] iomap: Use iomap_punch_t typedef Ritesh Harjani (IBM)
2023-07-13  4:33   ` Darrick J. Wong [this message]
2023-07-01  7:34 ` [PATCHv11 6/8] iomap: Refactor iomap_write_delalloc_punch() function out Ritesh Harjani (IBM)
2023-07-01  7:34 ` [PATCHv11 7/8] iomap: Allocate ifs in ->write_begin() early Ritesh Harjani (IBM)
2023-07-01  7:34 ` [PATCHv11 8/8] iomap: Add per-block dirty state tracking to improve performance Ritesh Harjani (IBM)
2023-07-06 14:46   ` Ritesh Harjani
2023-07-06 17:42     ` Matthew Wilcox
2023-07-06 22:16       ` Dave Chinner
2023-07-06 23:54         ` Matthew Wilcox
2023-07-10 18:19           ` Ritesh Harjani
2023-07-13  4:38             ` Darrick J. Wong
2023-07-13  5:27               ` Ritesh Harjani
2023-07-13  4:36   ` Darrick J. Wong

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=20230713043356.GE108251@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=agruenba@redhat.com \
    --cc=bfoster@redhat.com \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=ritesh.list@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).