All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: linux-xfs@vger.kernel.org
Subject: [PATCH 02/20] xfs: stop using XFS_LI_ABORTED as a parameter flag
Date: Fri, 17 May 2019 09:31:01 +0200	[thread overview]
Message-ID: <20190517073119.30178-3-hch@lst.de> (raw)
In-Reply-To: <20190517073119.30178-1-hch@lst.de>

Just pass a straight bool aborted instead of abusing XFS_LI_ABORTED as a
flag in function parameters.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_log.c     | 25 +++++++++++--------------
 fs/xfs/xfs_log.h     |  2 +-
 fs/xfs/xfs_log_cil.c |  4 ++--
 3 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 457ced3ee3e1..1eb0938165fc 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -54,12 +54,9 @@ xlog_dealloc_log(
 	struct xlog		*log);
 
 /* local state machine functions */
-STATIC void xlog_state_done_syncing(xlog_in_core_t *iclog, int);
-STATIC void
-xlog_state_do_callback(
-	struct xlog		*log,
-	int			aborted,
-	struct xlog_in_core	*iclog);
+STATIC void xlog_state_done_syncing(
+	struct xlog_in_core	*iclog,
+	bool			aborted);
 STATIC int
 xlog_state_get_iclog_space(
 	struct xlog		*log,
@@ -1255,7 +1252,7 @@ xlog_iodone(xfs_buf_t *bp)
 {
 	struct xlog_in_core	*iclog = bp->b_log_item;
 	struct xlog		*l = iclog->ic_log;
-	int			aborted = 0;
+	bool			aborted = false;
 
 	/*
 	 * Race to shutdown the filesystem if we see an error or the iclog is in
@@ -1275,9 +1272,9 @@ xlog_iodone(xfs_buf_t *bp)
 		 * callback routines to let them know that the log-commit
 		 * didn't succeed.
 		 */
-		aborted = XFS_LI_ABORTED;
+		aborted = true;
 	} else if (iclog->ic_state & XLOG_STATE_IOERROR) {
-		aborted = XFS_LI_ABORTED;
+		aborted = true;
 	}
 
 	/* log I/O is always issued ASYNC */
@@ -2697,7 +2694,7 @@ xlog_get_lowest_lsn(
 STATIC void
 xlog_state_do_callback(
 	struct xlog		*log,
-	int			aborted,
+	bool			aborted,
 	struct xlog_in_core	*ciclog)
 {
 	xlog_in_core_t	   *iclog;
@@ -2936,10 +2933,10 @@ xlog_state_do_callback(
  */
 STATIC void
 xlog_state_done_syncing(
-	xlog_in_core_t	*iclog,
-	int		aborted)
+	struct xlog_in_core	*iclog,
+	bool			aborted)
 {
-	struct xlog	   *log = iclog->ic_log;
+	struct xlog		*log = iclog->ic_log;
 
 	spin_lock(&log->l_icloglock);
 
@@ -4026,7 +4023,7 @@ xfs_log_force_umount(
 	 * avoid races.
 	 */
 	wake_up_all(&log->l_cilp->xc_commit_wait);
-	xlog_state_do_callback(log, XFS_LI_ABORTED, NULL);
+	xlog_state_do_callback(log, true, NULL);
 
 #ifdef XFSERRORDEBUG
 	{
diff --git a/fs/xfs/xfs_log.h b/fs/xfs/xfs_log.h
index 73a64bf32f6f..4450a2a26a1a 100644
--- a/fs/xfs/xfs_log.h
+++ b/fs/xfs/xfs_log.h
@@ -77,7 +77,7 @@ xlog_copy_iovec(struct xfs_log_vec *lv, struct xfs_log_iovec **vecp,
  */
 typedef struct xfs_log_callback {
 	struct xfs_log_callback	*cb_next;
-	void			(*cb_func)(void *, int);
+	void			(*cb_func)(void *, bool);
 	void			*cb_arg;
 } xfs_log_callback_t;
 
diff --git a/fs/xfs/xfs_log_cil.c b/fs/xfs/xfs_log_cil.c
index 5e595948bc5a..1b54002d3874 100644
--- a/fs/xfs/xfs_log_cil.c
+++ b/fs/xfs/xfs_log_cil.c
@@ -577,7 +577,7 @@ xlog_discard_busy_extents(
 static void
 xlog_cil_committed(
 	void	*args,
-	int	abort)
+	bool	abort)
 {
 	struct xfs_cil_ctx	*ctx = args;
 	struct xfs_mount	*mp = ctx->cil->xc_log->l_mp;
@@ -864,7 +864,7 @@ xlog_cil_push(
 out_abort_free_ticket:
 	xfs_log_ticket_put(tic);
 out_abort:
-	xlog_cil_committed(ctx, XFS_LI_ABORTED);
+	xlog_cil_committed(ctx, true);
 	return -EIO;
 }
 
-- 
2.20.1

  parent reply	other threads:[~2019-05-17  7:32 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-17  7:30 misc log item related cleanups Christoph Hellwig
2019-05-17  7:31 ` [PATCH 01/20] xfs: fix a trivial comment typo in the xfs_trans_committed_bulk Christoph Hellwig
2019-05-17 14:04   ` Brian Foster
2019-05-20 22:08   ` Darrick J. Wong
2019-05-17  7:31 ` Christoph Hellwig [this message]
2019-05-17 14:04   ` [PATCH 02/20] xfs: stop using XFS_LI_ABORTED as a parameter flag Brian Foster
2019-05-20  6:03     ` Christoph Hellwig
2019-05-17 14:10   ` Eric Sandeen
2019-05-20  6:05     ` Christoph Hellwig
2019-05-20 22:08   ` Darrick J. Wong
2019-06-11  8:46     ` Christoph Hellwig
2019-05-17  7:31 ` [PATCH 03/20] xfs: don't require log items to implement optional methods Christoph Hellwig
2019-05-17 14:06   ` Brian Foster
2019-05-20  6:06     ` Christoph Hellwig
2019-05-17  7:31 ` [PATCH 04/20] xfs: remove the dummy iop_push implementation for inode creation items Christoph Hellwig
2019-05-17 14:07   ` Brian Foster
2019-05-17  7:31 ` [PATCH 05/20] xfs: remove the iop_push implementation for quota off items Christoph Hellwig
2019-05-17 14:08   ` Brian Foster
2019-05-20  6:09     ` Christoph Hellwig
2019-05-17  7:31 ` [PATCH 06/20] xfs: don't use xfs_trans_free_items in the commit path Christoph Hellwig
2019-05-17 14:08   ` Brian Foster
2019-05-17  7:31 ` [PATCH 07/20] xfs: split iop_unlock Christoph Hellwig
2019-05-17 17:49   ` Brian Foster
2019-05-20  6:10     ` Christoph Hellwig
2019-05-20 11:38       ` Brian Foster
2019-05-17  7:31 ` [PATCH 08/20] xfs: add a flag to release log items on commit Christoph Hellwig
2019-05-17 17:50   ` Brian Foster
2019-05-20  6:11     ` Christoph Hellwig
2019-05-17  7:31 ` [PATCH 09/20] xfs: don't cast inode_log_items to get the log_item Christoph Hellwig
2019-05-17 17:50   ` Brian Foster
2019-05-17  7:31 ` [PATCH 10/20] xfs: remove the xfs_log_item_t typedef Christoph Hellwig
2019-05-17 17:50   ` Brian Foster
2019-05-17  7:31 ` [PATCH 11/20] xfs: use a list_head for iclog callbacks Christoph Hellwig
2019-05-20 13:12   ` Brian Foster
2019-05-20 13:19     ` Christoph Hellwig
2019-05-20 13:25       ` Brian Foster
2019-05-20 13:27       ` Bryan Gurney
2019-05-20 13:31         ` Christoph Hellwig
2019-05-17  7:31 ` [PATCH 12/20] xfs: remove a pointless comment duplicated above all xfs_item_ops instances Christoph Hellwig
2019-05-20 13:12   ` Brian Foster
2019-05-17  7:31 ` [PATCH 13/20] xfs: merge xfs_efd_init into xfs_trans_get_efd Christoph Hellwig
2019-05-17  8:16   ` Nikolay Borisov
2019-05-17  8:27     ` Christoph Hellwig
2019-05-17 18:26   ` Eric Sandeen
2019-05-20  6:03     ` Christoph Hellwig
2019-05-20 13:12   ` Brian Foster
2019-05-17  7:31 ` [PATCH 14/20] xfs: merge xfs_cud_init into xfs_trans_get_cud Christoph Hellwig
2019-05-20 13:13   ` Brian Foster
2019-05-17  7:31 ` [PATCH 15/20] xfs: merge xfs_rud_init into xfs_trans_get_rud Christoph Hellwig
2019-05-20 13:13   ` Brian Foster
2019-05-17  7:31 ` [PATCH 16/20] xfs: merge xfs_bud_init into xfs_trans_get_bud Christoph Hellwig
2019-05-20 13:13   ` Brian Foster
2019-05-17  7:31 ` [PATCH 17/20] xfs: merge xfs_trans_extfree.c into xfs_extfree_item.c Christoph Hellwig
2019-05-20 13:13   ` Brian Foster
2019-05-17  7:31 ` [PATCH 18/20] xfs: merge xfs_trans_refcount.c into xfs_refcount_item.c Christoph Hellwig
2019-05-20 13:14   ` Brian Foster
2019-05-17  7:31 ` [PATCH 19/20] xfs: merge xfs_trans_rmap.c into xfs_rmap_item.c Christoph Hellwig
2019-05-20 13:14   ` Brian Foster
2019-05-17  7:31 ` [PATCH 20/20] xfs: merge xfs_trans_bmap.c into xfs_bmap_item.c Christoph Hellwig
2019-05-20 13:14   ` Brian Foster
2019-06-13 18:02 misc log item related cleanups v2 Christoph Hellwig
2019-06-13 18:02 ` [PATCH 02/20] xfs: stop using XFS_LI_ABORTED as a parameter flag Christoph Hellwig

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=20190517073119.30178-3-hch@lst.de \
    --to=hch@lst.de \
    --cc=linux-xfs@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.