public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Dave Chinner <david@fromorbit.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 09/16] xfs: replace XFS_FORCED_SHUTDOWN with xfs_is_shutdown
Date: Wed, 14 Jul 2021 16:11:38 -0700	[thread overview]
Message-ID: <20210714231138.GC22402@magnolia> (raw)
In-Reply-To: <20210714041912.2625692-10-david@fromorbit.com>

On Wed, Jul 14, 2021 at 02:19:05PM +1000, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
> 
> Remove the shouty macro and instead use the inline function that
> matches other state/feature check wrapper naming. This conversion
> was done with sed.
> 
> Signed-off-by: Dave Chinner <dchinner@redhat.com>

<snip>

> diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
> index 0b9b84b31179..d4da6f54e7ae 100644
> --- a/fs/xfs/xfs_mount.h
> +++ b/fs/xfs/xfs_mount.h
> @@ -324,7 +324,7 @@ __XFS_HAS_FEAT(needsrepair, NEEDSREPAIR)
>   * Mount features
>   *
>   * These do not change dynamically - features that can come and go,
> - * such as 32 bit inodes and read-only state, are kept as flags rather than
> + * such as 32 bit inodes and read-only state, are kept as state rather than

I think this comment update belongs in the previous patch?

Otherwise this is a straight conversion, so once that's fixed up, you
may add

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

--D

>   * features.
>   */
>  __XFS_HAS_FEAT(noattr2, NOATTR2)
> @@ -373,7 +373,7 @@ __XFS_IS_STATE(readonly, READONLY)
>  #define XFS_MAX_IO_LOG		30	/* 1G */
>  #define XFS_MIN_IO_LOG		PAGE_SHIFT
>  
> -#define XFS_FORCED_SHUTDOWN(mp)		xfs_is_shutdown(mp)
> +#define xfs_is_shutdown(mp)		xfs_is_shutdown(mp)
>  void xfs_do_force_shutdown(struct xfs_mount *mp, int flags, char *fname,
>  		int lnnum);
>  #define xfs_force_shutdown(m,f)	\
> diff --git a/fs/xfs/xfs_pnfs.c b/fs/xfs/xfs_pnfs.c
> index 956cca24e67f..5e1d29d8b2e7 100644
> --- a/fs/xfs/xfs_pnfs.c
> +++ b/fs/xfs/xfs_pnfs.c
> @@ -92,7 +92,7 @@ xfs_fs_map_blocks(
>  	uint			lock_flags;
>  	int			error = 0;
>  
> -	if (XFS_FORCED_SHUTDOWN(mp))
> +	if (xfs_is_shutdown(mp))
>  		return -EIO;
>  
>  	/*
> diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
> index b327b9dcca04..5f24720e0ba2 100644
> --- a/fs/xfs/xfs_qm.c
> +++ b/fs/xfs/xfs_qm.c
> @@ -157,7 +157,7 @@ xfs_qm_dqpurge(
>  	}
>  
>  	ASSERT(atomic_read(&dqp->q_pincount) == 0);
> -	ASSERT(XFS_FORCED_SHUTDOWN(mp) ||
> +	ASSERT(xfs_is_shutdown(mp) ||
>  		!test_bit(XFS_LI_IN_AIL, &dqp->q_logitem.qli_item.li_flags));
>  
>  	xfs_dqfunlock(dqp);
> @@ -829,7 +829,7 @@ xfs_qm_qino_alloc(
>  
>  	error = xfs_trans_commit(tp);
>  	if (error) {
> -		ASSERT(XFS_FORCED_SHUTDOWN(mp));
> +		ASSERT(xfs_is_shutdown(mp));
>  		xfs_alert(mp, "%s failed (error %d)!", __func__, error);
>  	}
>  	if (need_alloc)
> diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
> index cc7eb9a73e85..2463848f92ff 100644
> --- a/fs/xfs/xfs_super.c
> +++ b/fs/xfs/xfs_super.c
> @@ -639,7 +639,7 @@ xfs_fs_destroy_inode(
>  
>  	xfs_inactive(ip);
>  
> -	if (!XFS_FORCED_SHUTDOWN(ip->i_mount) && ip->i_delayed_blks) {
> +	if (!xfs_is_shutdown(ip->i_mount) && ip->i_delayed_blks) {
>  		xfs_check_delalloc(ip, XFS_DATA_FORK);
>  		xfs_check_delalloc(ip, XFS_COW_FORK);
>  		ASSERT(0);
> @@ -1010,7 +1010,7 @@ xfs_destroy_percpu_counters(
>  	percpu_counter_destroy(&mp->m_icount);
>  	percpu_counter_destroy(&mp->m_ifree);
>  	percpu_counter_destroy(&mp->m_fdblocks);
> -	ASSERT(XFS_FORCED_SHUTDOWN(mp) ||
> +	ASSERT(xfs_is_shutdown(mp) ||
>  	       percpu_counter_sum(&mp->m_delalloc_blks) == 0);
>  	percpu_counter_destroy(&mp->m_delalloc_blks);
>  }
> diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c
> index 701a78fbf7a9..fc2c6a404647 100644
> --- a/fs/xfs/xfs_symlink.c
> +++ b/fs/xfs/xfs_symlink.c
> @@ -107,7 +107,7 @@ xfs_readlink(
>  
>  	ASSERT(ip->i_df.if_format != XFS_DINODE_FMT_LOCAL);
>  
> -	if (XFS_FORCED_SHUTDOWN(mp))
> +	if (xfs_is_shutdown(mp))
>  		return -EIO;
>  
>  	xfs_ilock(ip, XFS_ILOCK_SHARED);
> @@ -168,7 +168,7 @@ xfs_symlink(
>  
>  	trace_xfs_symlink(dp, link_name);
>  
> -	if (XFS_FORCED_SHUTDOWN(mp))
> +	if (xfs_is_shutdown(mp))
>  		return -EIO;
>  
>  	/*
> @@ -444,7 +444,7 @@ xfs_inactive_symlink_rmt(
>  	xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
>  	error = xfs_trans_commit(tp);
>  	if (error) {
> -		ASSERT(XFS_FORCED_SHUTDOWN(mp));
> +		ASSERT(xfs_is_shutdown(mp));
>  		goto error_unlock;
>  	}
>  
> @@ -477,7 +477,7 @@ xfs_inactive_symlink(
>  
>  	trace_xfs_inactive_symlink(ip);
>  
> -	if (XFS_FORCED_SHUTDOWN(mp))
> +	if (xfs_is_shutdown(mp))
>  		return -EIO;
>  
>  	xfs_ilock(ip, XFS_ILOCK_EXCL);
> diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
> index bc1cad33daf8..c5f111235e44 100644
> --- a/fs/xfs/xfs_trans.c
> +++ b/fs/xfs/xfs_trans.c
> @@ -778,7 +778,7 @@ xfs_trans_committed_bulk(
>  		 * object into the AIL as we are in a shutdown situation.
>  		 */
>  		if (aborted) {
> -			ASSERT(XFS_FORCED_SHUTDOWN(ailp->ail_mount));
> +			ASSERT(xfs_is_shutdown(ailp->ail_mount));
>  			if (lip->li_ops->iop_unpin)
>  				lip->li_ops->iop_unpin(lip, 1);
>  			continue;
> @@ -867,7 +867,7 @@ __xfs_trans_commit(
>  	if (!(tp->t_flags & XFS_TRANS_DIRTY))
>  		goto out_unreserve;
>  
> -	if (XFS_FORCED_SHUTDOWN(mp)) {
> +	if (xfs_is_shutdown(mp)) {
>  		error = -EIO;
>  		goto out_unreserve;
>  	}
> @@ -953,12 +953,12 @@ xfs_trans_cancel(
>  	 * filesystem.  This happens in paths where we detect
>  	 * corruption and decide to give up.
>  	 */
> -	if (dirty && !XFS_FORCED_SHUTDOWN(mp)) {
> +	if (dirty && !xfs_is_shutdown(mp)) {
>  		XFS_ERROR_REPORT("xfs_trans_cancel", XFS_ERRLEVEL_LOW, mp);
>  		xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE);
>  	}
>  #ifdef DEBUG
> -	if (!dirty && !XFS_FORCED_SHUTDOWN(mp)) {
> +	if (!dirty && !xfs_is_shutdown(mp)) {
>  		struct xfs_log_item *lip;
>  
>  		list_for_each_entry(lip, &tp->t_items, li_trans)
> diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c
> index dbb69b4bf3ed..fd9b04b6bbb4 100644
> --- a/fs/xfs/xfs_trans_ail.c
> +++ b/fs/xfs/xfs_trans_ail.c
> @@ -615,7 +615,7 @@ xfsaild(
>  			 * opportunity to release such buffers from the queue.
>  			 */
>  			ASSERT(list_empty(&ailp->ail_buf_list) ||
> -			       XFS_FORCED_SHUTDOWN(ailp->ail_mount));
> +			       xfs_is_shutdown(ailp->ail_mount));
>  			xfs_buf_delwri_cancel(&ailp->ail_buf_list);
>  			break;
>  		}
> @@ -678,7 +678,7 @@ xfs_ail_push(
>  	struct xfs_log_item	*lip;
>  
>  	lip = xfs_ail_min(ailp);
> -	if (!lip || XFS_FORCED_SHUTDOWN(ailp->ail_mount) ||
> +	if (!lip || xfs_is_shutdown(ailp->ail_mount) ||
>  	    XFS_LSN_CMP(threshold_lsn, ailp->ail_target) <= 0)
>  		return;
>  
> @@ -743,7 +743,7 @@ xfs_ail_update_finish(
>  		return;
>  	}
>  
> -	if (!XFS_FORCED_SHUTDOWN(mp))
> +	if (!xfs_is_shutdown(mp))
>  		xlog_assign_tail_lsn_locked(mp);
>  
>  	if (list_empty(&ailp->ail_head))
> @@ -863,7 +863,7 @@ xfs_trans_ail_delete(
>  	spin_lock(&ailp->ail_lock);
>  	if (!test_bit(XFS_LI_IN_AIL, &lip->li_flags)) {
>  		spin_unlock(&ailp->ail_lock);
> -		if (shutdown_type && !XFS_FORCED_SHUTDOWN(mp)) {
> +		if (shutdown_type && !xfs_is_shutdown(mp)) {
>  			xfs_alert_tag(mp, XFS_PTAG_AILDELETE,
>  	"%s: attempting to delete a log item that is not in the AIL",
>  					__func__);
> diff --git a/fs/xfs/xfs_trans_buf.c b/fs/xfs/xfs_trans_buf.c
> index d11d032da0b4..4ff274ce31c4 100644
> --- a/fs/xfs/xfs_trans_buf.c
> +++ b/fs/xfs/xfs_trans_buf.c
> @@ -138,7 +138,7 @@ xfs_trans_get_buf_map(
>  	bp = xfs_trans_buf_item_match(tp, target, map, nmaps);
>  	if (bp != NULL) {
>  		ASSERT(xfs_buf_islocked(bp));
> -		if (XFS_FORCED_SHUTDOWN(tp->t_mountp)) {
> +		if (xfs_is_shutdown(tp->t_mountp)) {
>  			xfs_buf_stale(bp);
>  			bp->b_flags |= XBF_DONE;
>  		}
> @@ -244,7 +244,7 @@ xfs_trans_read_buf_map(
>  		 * We never locked this buf ourselves, so we shouldn't
>  		 * brelse it either. Just get out.
>  		 */
> -		if (XFS_FORCED_SHUTDOWN(mp)) {
> +		if (xfs_is_shutdown(mp)) {
>  			trace_xfs_trans_read_buf_shut(bp, _RET_IP_);
>  			return -EIO;
>  		}
> @@ -300,7 +300,7 @@ xfs_trans_read_buf_map(
>  		return error;
>  	}
>  
> -	if (XFS_FORCED_SHUTDOWN(mp)) {
> +	if (xfs_is_shutdown(mp)) {
>  		xfs_buf_relse(bp);
>  		trace_xfs_trans_read_buf_shut(bp, _RET_IP_);
>  		return -EIO;
> -- 
> 2.31.1
> 

  reply	other threads:[~2021-07-14 23:11 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-14  4:18 [PATCH 00/16] xfs: rework feature flags Dave Chinner
2021-07-14  4:18 ` [PATCH 01/16] xfs: sb verifier doesn't handle uncached sb buffer Dave Chinner
2021-07-14  6:43   ` Christoph Hellwig
2021-07-14  9:37     ` Dave Chinner
2021-07-14 22:44   ` Darrick J. Wong
2021-07-14 23:00     ` Dave Chinner
2021-07-14 23:03       ` Darrick J. Wong
2021-07-14  4:18 ` [PATCH 02/16] xfs: rename xfs_has_attr() Dave Chinner
2021-07-14  6:49   ` Christoph Hellwig
2021-07-14 22:46   ` Darrick J. Wong
2021-07-14  4:18 ` [PATCH 03/16] xfs: rework attr2 feature and mount options Dave Chinner
2021-07-14  6:58   ` Christoph Hellwig
2021-07-14  9:45     ` Dave Chinner
2021-07-15  5:55       ` Christoph Hellwig
2021-07-15 23:47         ` Dave Chinner
2021-07-16  9:43           ` Christoph Hellwig
2021-07-14 22:51   ` Darrick J. Wong
2021-07-14  4:19 ` [PATCH 04/16] xfs: reflect sb features in xfs_mount Dave Chinner
2021-07-14  7:01   ` Christoph Hellwig
2021-07-14 22:56   ` Darrick J. Wong
2021-07-14 23:07     ` Dave Chinner
2021-07-14 23:17       ` Darrick J. Wong
2021-07-14  4:19 ` [PATCH 05/16] xfs: replace xfs_sb_version checks with feature flag checks Dave Chinner
2021-07-14  7:03   ` Christoph Hellwig
2021-07-14 22:57   ` Darrick J. Wong
2021-07-14  4:19 ` [PATCH 06/16] xfs: consolidate mount option features in m_features Dave Chinner
2021-07-14  7:05   ` Christoph Hellwig
2021-07-14  9:55     ` Dave Chinner
2021-07-15  5:59       ` Christoph Hellwig
2021-07-15 23:43         ` Dave Chinner
2021-07-14 23:02   ` Darrick J. Wong
2021-07-14  4:19 ` [PATCH 07/16] xfs: convert mount flags to features Dave Chinner
2021-07-14 23:07   ` Darrick J. Wong
2021-07-14  4:19 ` [PATCH 08/16] xfs: convert remaining mount flags to state flags Dave Chinner
2021-07-14 23:10   ` Darrick J. Wong
2021-07-14  4:19 ` [PATCH 09/16] xfs: replace XFS_FORCED_SHUTDOWN with xfs_is_shutdown Dave Chinner
2021-07-14 23:11   ` Darrick J. Wong [this message]
2021-07-14  4:19 ` [PATCH 10/16] xfs: convert xfs_fs_geometry to use mount feature checks Dave Chinner
2021-07-14  7:11   ` Christoph Hellwig
2021-07-14 23:15   ` Darrick J. Wong
2021-07-14 23:35     ` Dave Chinner
2021-07-14 23:38       ` Darrick J. Wong
2021-07-14  4:19 ` [PATCH 11/16] xfs: open code sb verifier " Dave Chinner
2021-07-14  7:19   ` Christoph Hellwig
2021-07-16  0:26   ` Darrick J. Wong
2021-07-14  4:19 ` [PATCH 12/16] xfs: convert scrub to use mount-based " Dave Chinner
2021-07-14 23:18   ` Darrick J. Wong
2021-07-14  4:19 ` [PATCH 13/16] xfs: convert xfs_sb_version_has checks to use mount features Dave Chinner
2021-07-14 23:19   ` Darrick J. Wong
2021-07-14  4:19 ` [PATCH 14/16] xfs: remove unused xfs_sb_version_has wrappers Dave Chinner
2021-07-14 23:21   ` Darrick J. Wong
2021-07-14  4:19 ` [PATCH 15/16] xfs: introduce xfs_sb_is_v5 helper Dave Chinner
2021-07-14 23:24   ` Darrick J. Wong
2021-07-14  4:19 ` [PATCH 16/16] xfs: kill xfs_sb_version_has_v3inode() Dave Chinner
2021-07-14 23:24   ` Darrick J. Wong
  -- strict thread matches above, loose matches on Subject: below --
2021-08-10  5:24 [PATCH 00/16 v2] xfs: rework feature flags Dave Chinner
2021-08-10  5:24 ` [PATCH 09/16] xfs: replace XFS_FORCED_SHUTDOWN with xfs_is_shutdown Dave Chinner
2021-08-18 23:59 [PATCH 00/16 v3] xfs: rework feature flags Dave Chinner
2021-08-18 23:59 ` [PATCH 09/16] xfs: replace XFS_FORCED_SHUTDOWN with xfs_is_shutdown Dave Chinner

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=20210714231138.GC22402@magnolia \
    --to=djwong@kernel.org \
    --cc=david@fromorbit.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox