diff mbox series

[2/4] xfs: open code ioend needs workqueue helper

Message ID 20210405145903.629152-3-bfoster@redhat.com (mailing list archive)
State Superseded, archived
Headers show
Series xfs: ioend batching log reservation deadlock | expand

Commit Message

Brian Foster April 5, 2021, 2:59 p.m. UTC
Open code xfs_ioend_needs_workqueue() into the only remaining
caller.

Signed-off-by: Brian Foster <bfoster@redhat.com>
---
 fs/xfs/xfs_aops.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

Comments

Christoph Hellwig April 7, 2021, 6:34 a.m. UTC | #1
On Mon, Apr 05, 2021 at 10:59:01AM -0400, Brian Foster wrote:
> Open code xfs_ioend_needs_workqueue() into the only remaining
> caller.

This description would all fit on a single line.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
Brian Foster April 7, 2021, 11:24 a.m. UTC | #2
On Wed, Apr 07, 2021 at 07:34:40AM +0100, Christoph Hellwig wrote:
> On Mon, Apr 05, 2021 at 10:59:01AM -0400, Brian Foster wrote:
> > Open code xfs_ioend_needs_workqueue() into the only remaining
> > caller.
> 
> This description would all fit on a single line.
> 

I've used 68 character wide commit log descriptions for quite some time,
to which this seems to be wrapped accurately. This is the same as the
immediately previous patch for example, with the much longer
description. I don't care much about changing it, but is there a
canonical format defined somewhere? I've always just thought 68-72 was
acceptable.

Brian

> Looks good:
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>
>
Darrick J. Wong April 7, 2021, 3:23 p.m. UTC | #3
On Wed, Apr 07, 2021 at 07:24:13AM -0400, Brian Foster wrote:
> On Wed, Apr 07, 2021 at 07:34:40AM +0100, Christoph Hellwig wrote:
> > On Mon, Apr 05, 2021 at 10:59:01AM -0400, Brian Foster wrote:
> > > Open code xfs_ioend_needs_workqueue() into the only remaining
> > > caller.
> > 
> > This description would all fit on a single line.
> > 
> 
> I've used 68 character wide commit log descriptions for quite some time,
> to which this seems to be wrapped accurately. This is the same as the
> immediately previous patch for example, with the much longer
> description. I don't care much about changing it, but is there a
> canonical format defined somewhere? I've always just thought 68-72 was
> acceptable.

I set email to wrap at 72 and C code to wrap at 79 columns.

Though as I've said in the past, I don't enforce /any/ of those rules
with any specificity so long as they're not being abused.  (e.g.
wrapping at column 5 or 500)

--D

> Brian
> 
> > Looks good:
> > 
> > Reviewed-by: Christoph Hellwig <hch@lst.de>
> > 
>
Darrick J. Wong April 7, 2021, 3:42 p.m. UTC | #4
On Mon, Apr 05, 2021 at 10:59:01AM -0400, Brian Foster wrote:
> Open code xfs_ioend_needs_workqueue() into the only remaining
> caller.
> 
> Signed-off-by: Brian Foster <bfoster@redhat.com>

I would have left it, but don't really care either way...
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  fs/xfs/xfs_aops.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
> index c1951975bd6a..63ecc04de64f 100644
> --- a/fs/xfs/xfs_aops.c
> +++ b/fs/xfs/xfs_aops.c
> @@ -206,13 +206,6 @@ xfs_end_io(
>  	}
>  }
>  
> -static inline bool xfs_ioend_needs_workqueue(struct iomap_ioend *ioend)
> -{
> -	return xfs_ioend_is_append(ioend) ||
> -		ioend->io_type == IOMAP_UNWRITTEN ||
> -		(ioend->io_flags & IOMAP_F_SHARED);
> -}
> -
>  STATIC void
>  xfs_end_bio(
>  	struct bio		*bio)
> @@ -472,7 +465,9 @@ xfs_prepare_ioend(
>  
>  	memalloc_nofs_restore(nofs_flag);
>  
> -	if (xfs_ioend_needs_workqueue(ioend))
> +	/* send ioends that might require a transaction to the completion wq */
> +	if (xfs_ioend_is_append(ioend) || ioend->io_type == IOMAP_UNWRITTEN ||
> +	    (ioend->io_flags & IOMAP_F_SHARED))
>  		ioend->io_bio->bi_end_io = xfs_end_bio;
>  	return status;
>  }
> -- 
> 2.26.3
>
diff mbox series

Patch

diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index c1951975bd6a..63ecc04de64f 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -206,13 +206,6 @@  xfs_end_io(
 	}
 }
 
-static inline bool xfs_ioend_needs_workqueue(struct iomap_ioend *ioend)
-{
-	return xfs_ioend_is_append(ioend) ||
-		ioend->io_type == IOMAP_UNWRITTEN ||
-		(ioend->io_flags & IOMAP_F_SHARED);
-}
-
 STATIC void
 xfs_end_bio(
 	struct bio		*bio)
@@ -472,7 +465,9 @@  xfs_prepare_ioend(
 
 	memalloc_nofs_restore(nofs_flag);
 
-	if (xfs_ioend_needs_workqueue(ioend))
+	/* send ioends that might require a transaction to the completion wq */
+	if (xfs_ioend_is_append(ioend) || ioend->io_type == IOMAP_UNWRITTEN ||
+	    (ioend->io_flags & IOMAP_F_SHARED))
 		ioend->io_bio->bi_end_io = xfs_end_bio;
 	return status;
 }