xfs: replace XFS_FORCED_SHUTDOWN with xfs_is_shutdown

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>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
This commit is contained in:
Dave Chinner 2021-08-18 18:46:53 -07:00 committed by Darrick J. Wong
parent 2e973b2cd4
commit 75c8c50fa1
29 changed files with 90 additions and 90 deletions

View File

@ -3079,7 +3079,7 @@ xfs_alloc_read_agf(
atomic64_add(allocbt_blks, &mp->m_allocbt_blks); atomic64_add(allocbt_blks, &mp->m_allocbt_blks);
} }
#ifdef DEBUG #ifdef DEBUG
else if (!XFS_FORCED_SHUTDOWN(mp)) { else if (!xfs_is_shutdown(mp)) {
ASSERT(pag->pagf_freeblks == be32_to_cpu(agf->agf_freeblks)); ASSERT(pag->pagf_freeblks == be32_to_cpu(agf->agf_freeblks));
ASSERT(pag->pagf_btreeblks == be32_to_cpu(agf->agf_btreeblks)); ASSERT(pag->pagf_btreeblks == be32_to_cpu(agf->agf_btreeblks));
ASSERT(pag->pagf_flcount == be32_to_cpu(agf->agf_flcount)); ASSERT(pag->pagf_flcount == be32_to_cpu(agf->agf_flcount));

View File

@ -146,7 +146,7 @@ xfs_attr_get(
XFS_STATS_INC(args->dp->i_mount, xs_attr_get); XFS_STATS_INC(args->dp->i_mount, xs_attr_get);
if (XFS_FORCED_SHUTDOWN(args->dp->i_mount)) if (xfs_is_shutdown(args->dp->i_mount))
return -EIO; return -EIO;
args->geo = args->dp->i_mount->m_attr_geo; args->geo = args->dp->i_mount->m_attr_geo;
@ -710,7 +710,7 @@ xfs_attr_set(
int rmt_blks = 0; int rmt_blks = 0;
unsigned int total; unsigned int total;
if (XFS_FORCED_SHUTDOWN(dp->i_mount)) if (xfs_is_shutdown(dp->i_mount))
return -EIO; return -EIO;
error = xfs_qm_dqattach(dp); error = xfs_qm_dqattach(dp);

View File

@ -3938,7 +3938,7 @@ xfs_bmapi_read(
XFS_TEST_ERROR(false, mp, XFS_ERRTAG_BMAPIFORMAT)) XFS_TEST_ERROR(false, mp, XFS_ERRTAG_BMAPIFORMAT))
return -EFSCORRUPTED; return -EFSCORRUPTED;
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
XFS_STATS_INC(mp, xs_blk_mapr); XFS_STATS_INC(mp, xs_blk_mapr);
@ -4420,7 +4420,7 @@ xfs_bmapi_write(
return -EFSCORRUPTED; return -EFSCORRUPTED;
} }
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
XFS_STATS_INC(mp, xs_blk_mapw); XFS_STATS_INC(mp, xs_blk_mapw);
@ -4703,7 +4703,7 @@ xfs_bmapi_remap(
return -EFSCORRUPTED; return -EFSCORRUPTED;
} }
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
error = xfs_iread_extents(tp, ip, whichfork); error = xfs_iread_extents(tp, ip, whichfork);
@ -5361,7 +5361,7 @@ __xfs_bunmapi(
ifp = XFS_IFORK_PTR(ip, whichfork); ifp = XFS_IFORK_PTR(ip, whichfork);
if (XFS_IS_CORRUPT(mp, !xfs_ifork_has_extents(ifp))) if (XFS_IS_CORRUPT(mp, !xfs_ifork_has_extents(ifp)))
return -EFSCORRUPTED; return -EFSCORRUPTED;
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
@ -5852,7 +5852,7 @@ xfs_bmap_collapse_extents(
return -EFSCORRUPTED; return -EFSCORRUPTED;
} }
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL)); ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL));
@ -5930,7 +5930,7 @@ xfs_bmap_can_insert_extents(
ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL)); ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL));
if (XFS_FORCED_SHUTDOWN(ip->i_mount)) if (xfs_is_shutdown(ip->i_mount))
return -EIO; return -EIO;
xfs_ilock(ip, XFS_ILOCK_EXCL); xfs_ilock(ip, XFS_ILOCK_EXCL);
@ -5967,7 +5967,7 @@ xfs_bmap_insert_extents(
return -EFSCORRUPTED; return -EFSCORRUPTED;
} }
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL)); ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL));
@ -6070,7 +6070,7 @@ xfs_bmap_split_extent(
return -EFSCORRUPTED; return -EFSCORRUPTED;
} }
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
/* Read in all the extents */ /* Read in all the extents */

View File

@ -374,7 +374,7 @@ xfs_btree_del_cursor(
} }
ASSERT(cur->bc_btnum != XFS_BTNUM_BMAP || cur->bc_ino.allocated == 0 || ASSERT(cur->bc_btnum != XFS_BTNUM_BMAP || cur->bc_ino.allocated == 0 ||
XFS_FORCED_SHUTDOWN(cur->bc_mp)); xfs_is_shutdown(cur->bc_mp));
if (unlikely(cur->bc_flags & XFS_BTREE_STAGING)) if (unlikely(cur->bc_flags & XFS_BTREE_STAGING))
kmem_free(cur->bc_ops); kmem_free(cur->bc_ops);
if (!(cur->bc_flags & XFS_BTREE_LONG_PTRS) && cur->bc_ag.pag) if (!(cur->bc_flags & XFS_BTREE_LONG_PTRS) && cur->bc_ag.pag)

View File

@ -241,7 +241,7 @@ xfs_check_agi_freecount(
} }
} while (i == 1); } while (i == 1);
if (!XFS_FORCED_SHUTDOWN(cur->bc_mp)) if (!xfs_is_shutdown(cur->bc_mp))
ASSERT(freecount == cur->bc_ag.pag->pagi_freecount); ASSERT(freecount == cur->bc_ag.pag->pagi_freecount);
} }
return 0; return 0;
@ -1784,7 +1784,7 @@ xfs_dialloc(
break; break;
} }
if (XFS_FORCED_SHUTDOWN(mp)) { if (xfs_is_shutdown(mp)) {
error = -EFSCORRUPTED; error = -EFSCORRUPTED;
break; break;
} }
@ -2624,7 +2624,7 @@ xfs_ialloc_read_agi(
* we are in the middle of a forced shutdown. * we are in the middle of a forced shutdown.
*/ */
ASSERT(pag->pagi_freecount == be32_to_cpu(agi->agi_freecount) || ASSERT(pag->pagi_freecount == be32_to_cpu(agi->agi_freecount) ||
XFS_FORCED_SHUTDOWN(mp)); xfs_is_shutdown(mp));
return 0; return 0;
} }

View File

@ -477,7 +477,7 @@ xfs_scrub_metadata(
/* Forbidden if we are shut down or mounted norecovery. */ /* Forbidden if we are shut down or mounted norecovery. */
error = -ESHUTDOWN; error = -ESHUTDOWN;
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
goto out; goto out;
error = -ENOTRECOVERABLE; error = -ENOTRECOVERABLE;
if (xfs_has_norecovery(mp)) if (xfs_has_norecovery(mp))

View File

@ -97,7 +97,7 @@ xfs_end_ioend(
/* /*
* Just clean up the in-memory structures if the fs has been shut down. * Just clean up the in-memory structures if the fs has been shut down.
*/ */
if (XFS_FORCED_SHUTDOWN(ip->i_mount)) { if (xfs_is_shutdown(ip->i_mount)) {
error = -EIO; error = -EIO;
goto done; goto done;
} }
@ -260,7 +260,7 @@ xfs_map_blocks(
int retries = 0; int retries = 0;
int error = 0; int error = 0;
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
/* /*
@ -440,7 +440,7 @@ xfs_discard_page(
xfs_fileoff_t pageoff_fsb = XFS_B_TO_FSBT(mp, pageoff); xfs_fileoff_t pageoff_fsb = XFS_B_TO_FSBT(mp, pageoff);
int error; int error;
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
goto out_invalidate; goto out_invalidate;
xfs_alert_ratelimited(mp, xfs_alert_ratelimited(mp,
@ -449,7 +449,7 @@ xfs_discard_page(
error = xfs_bmap_punch_delalloc_range(ip, start_fsb, error = xfs_bmap_punch_delalloc_range(ip, start_fsb,
i_blocks_per_page(inode, page) - pageoff_fsb); i_blocks_per_page(inode, page) - pageoff_fsb);
if (error && !XFS_FORCED_SHUTDOWN(mp)) if (error && !xfs_is_shutdown(mp))
xfs_alert(mp, "page discard unable to remove delalloc mapping."); xfs_alert(mp, "page discard unable to remove delalloc mapping.");
out_invalidate: out_invalidate:
iomap_invalidatepage(page, pageoff, PAGE_SIZE - pageoff); iomap_invalidatepage(page, pageoff, PAGE_SIZE - pageoff);

View File

@ -529,7 +529,7 @@ xfs_attr_list(
XFS_STATS_INC(dp->i_mount, xs_attr_list); XFS_STATS_INC(dp->i_mount, xs_attr_list);
if (XFS_FORCED_SHUTDOWN(dp->i_mount)) if (xfs_is_shutdown(dp->i_mount))
return -EIO; return -EIO;
lock_mode = xfs_ilock_attr_map_shared(dp); lock_mode = xfs_ilock_attr_map_shared(dp);

View File

@ -731,7 +731,7 @@ xfs_free_eofblocks(
error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate, 0, 0, 0, &tp); error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate, 0, 0, 0, &tp);
if (error) { if (error) {
ASSERT(XFS_FORCED_SHUTDOWN(mp)); ASSERT(xfs_is_shutdown(mp));
return error; return error;
} }
@ -789,7 +789,7 @@ xfs_alloc_file_space(
trace_xfs_alloc_file_space(ip); trace_xfs_alloc_file_space(ip);
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
error = xfs_qm_dqattach(ip); error = xfs_qm_dqattach(ip);

View File

@ -813,7 +813,7 @@ xfs_buf_read_map(
* buffer. * buffer.
*/ */
if (error) { if (error) {
if (!XFS_FORCED_SHUTDOWN(target->bt_mount)) if (!xfs_is_shutdown(target->bt_mount))
xfs_buf_ioerror_alert(bp, fa); xfs_buf_ioerror_alert(bp, fa);
bp->b_flags &= ~XBF_DONE; bp->b_flags &= ~XBF_DONE;
@ -1178,7 +1178,7 @@ xfs_buf_ioend_handle_error(
* If we've already decided to shutdown the filesystem because of I/O * If we've already decided to shutdown the filesystem because of I/O
* errors, there's no point in giving this a retry. * errors, there's no point in giving this a retry.
*/ */
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
goto out_stale; goto out_stale;
xfs_buf_ioerror_alert_ratelimited(bp); xfs_buf_ioerror_alert_ratelimited(bp);
@ -1591,7 +1591,7 @@ __xfs_buf_submit(
ASSERT(!(bp->b_flags & _XBF_DELWRI_Q)); ASSERT(!(bp->b_flags & _XBF_DELWRI_Q));
/* on shutdown we stale and complete the buffer immediately */ /* on shutdown we stale and complete the buffer immediately */
if (XFS_FORCED_SHUTDOWN(bp->b_mount)) { if (xfs_is_shutdown(bp->b_mount)) {
xfs_buf_ioend_fail(bp); xfs_buf_ioend_fail(bp);
return -EIO; return -EIO;
} }
@ -1808,7 +1808,7 @@ xfs_buftarg_drain(
* down the fs. * down the fs.
*/ */
if (write_fail) { if (write_fail) {
ASSERT(XFS_FORCED_SHUTDOWN(btp->bt_mount)); ASSERT(xfs_is_shutdown(btp->bt_mount));
xfs_alert(btp->bt_mount, xfs_alert(btp->bt_mount,
"Please run xfs_repair to determine the extent of the problem."); "Please run xfs_repair to determine the extent of the problem.");
} }

View File

@ -616,7 +616,7 @@ xfs_buf_item_put(
* that case, the bli is freed on buffer writeback completion. * that case, the bli is freed on buffer writeback completion.
*/ */
aborted = test_bit(XFS_LI_ABORTED, &lip->li_flags) || aborted = test_bit(XFS_LI_ABORTED, &lip->li_flags) ||
XFS_FORCED_SHUTDOWN(lip->li_mountp); xfs_is_shutdown(lip->li_mountp);
dirty = bip->bli_flags & XFS_BLI_DIRTY; dirty = bip->bli_flags & XFS_BLI_DIRTY;
if (dirty && !aborted) if (dirty && !aborted)
return false; return false;

View File

@ -512,7 +512,7 @@ xfs_readdir(
trace_xfs_readdir(dp); trace_xfs_readdir(dp);
if (XFS_FORCED_SHUTDOWN(dp->i_mount)) if (xfs_is_shutdown(dp->i_mount))
return -EIO; return -EIO;
ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); ASSERT(S_ISDIR(VFS_I(dp)->i_mode));

View File

@ -185,7 +185,7 @@ xfs_file_fsync(
if (error) if (error)
return error; return error;
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
xfs_iflags_clear(ip, XFS_ITRUNCATED); xfs_iflags_clear(ip, XFS_ITRUNCATED);
@ -318,7 +318,7 @@ xfs_file_read_iter(
XFS_STATS_INC(mp, xs_read_calls); XFS_STATS_INC(mp, xs_read_calls);
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
if (IS_DAX(inode)) if (IS_DAX(inode))
@ -462,7 +462,7 @@ xfs_dio_write_end_io(
trace_xfs_end_io_direct_write(ip, offset, size); trace_xfs_end_io_direct_write(ip, offset, size);
if (XFS_FORCED_SHUTDOWN(ip->i_mount)) if (xfs_is_shutdown(ip->i_mount))
return -EIO; return -EIO;
if (error) if (error)
@ -814,7 +814,7 @@ xfs_file_write_iter(
if (ocount == 0) if (ocount == 0)
return 0; return 0;
if (XFS_FORCED_SHUTDOWN(ip->i_mount)) if (xfs_is_shutdown(ip->i_mount))
return -EIO; return -EIO;
if (IS_DAX(inode)) if (IS_DAX(inode))
@ -1156,7 +1156,7 @@ xfs_file_remap_range(
if (!xfs_has_reflink(mp)) if (!xfs_has_reflink(mp))
return -EOPNOTSUPP; return -EOPNOTSUPP;
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
/* Prepare and then clone file data. */ /* Prepare and then clone file data. */
@ -1205,7 +1205,7 @@ xfs_file_open(
{ {
if (!(file->f_flags & O_LARGEFILE) && i_size_read(inode) > MAX_NON_LFS) if (!(file->f_flags & O_LARGEFILE) && i_size_read(inode) > MAX_NON_LFS)
return -EFBIG; return -EFBIG;
if (XFS_FORCED_SHUTDOWN(XFS_M(inode->i_sb))) if (xfs_is_shutdown(XFS_M(inode->i_sb)))
return -EIO; return -EIO;
file->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC; file->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC;
return 0; return 0;
@ -1277,7 +1277,7 @@ xfs_file_llseek(
{ {
struct inode *inode = file->f_mapping->host; struct inode *inode = file->f_mapping->host;
if (XFS_FORCED_SHUTDOWN(XFS_I(inode)->i_mount)) if (xfs_is_shutdown(XFS_I(inode)->i_mount))
return -EIO; return -EIO;
switch (whence) { switch (whence) {

View File

@ -30,7 +30,7 @@ xfs_health_unmount(
unsigned int checked = 0; unsigned int checked = 0;
bool warn = false; bool warn = false;
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return; return;
/* Measure AG corruption levels. */ /* Measure AG corruption levels. */

View File

@ -890,7 +890,7 @@ xfs_reclaim_inode(
if (xfs_iflags_test_and_set(ip, XFS_IFLUSHING)) if (xfs_iflags_test_and_set(ip, XFS_IFLUSHING))
goto out_iunlock; goto out_iunlock;
if (XFS_FORCED_SHUTDOWN(ip->i_mount)) { if (xfs_is_shutdown(ip->i_mount)) {
xfs_iunpin_wait(ip); xfs_iunpin_wait(ip);
xfs_iflush_abort(ip); xfs_iflush_abort(ip);
goto reclaim; goto reclaim;
@ -968,7 +968,7 @@ xfs_want_reclaim_sick(
struct xfs_mount *mp) struct xfs_mount *mp)
{ {
return xfs_is_unmounting(mp) || xfs_has_norecovery(mp) || return xfs_is_unmounting(mp) || xfs_has_norecovery(mp) ||
XFS_FORCED_SHUTDOWN(mp); xfs_is_shutdown(mp);
} }
void void
@ -1414,7 +1414,7 @@ xfs_blockgc_igrab(
spin_unlock(&ip->i_flags_lock); spin_unlock(&ip->i_flags_lock);
/* nothing to sync during shutdown */ /* nothing to sync during shutdown */
if (XFS_FORCED_SHUTDOWN(ip->i_mount)) if (xfs_is_shutdown(ip->i_mount))
return false; return false;
/* If we can't grab the inode, it must on it's way to reclaim. */ /* If we can't grab the inode, it must on it's way to reclaim. */
@ -1811,7 +1811,7 @@ xfs_inodegc_set_reclaimable(
struct xfs_mount *mp = ip->i_mount; struct xfs_mount *mp = ip->i_mount;
struct xfs_perag *pag; struct xfs_perag *pag;
if (!XFS_FORCED_SHUTDOWN(mp) && ip->i_delayed_blks) { if (!xfs_is_shutdown(mp) && ip->i_delayed_blks) {
xfs_check_delalloc(ip, XFS_DATA_FORK); xfs_check_delalloc(ip, XFS_DATA_FORK);
xfs_check_delalloc(ip, XFS_COW_FORK); xfs_check_delalloc(ip, XFS_COW_FORK);
ASSERT(0); ASSERT(0);

View File

@ -663,7 +663,7 @@ xfs_lookup(
trace_xfs_lookup(dp, name); trace_xfs_lookup(dp, name);
if (XFS_FORCED_SHUTDOWN(dp->i_mount)) if (xfs_is_shutdown(dp->i_mount))
return -EIO; return -EIO;
error = xfs_dir_lookup(NULL, dp, name, &inum, ci_name); error = xfs_dir_lookup(NULL, dp, name, &inum, ci_name);
@ -975,7 +975,7 @@ xfs_create(
trace_xfs_create(dp, name); trace_xfs_create(dp, name);
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
prid = xfs_get_initial_prid(dp); prid = xfs_get_initial_prid(dp);
@ -1129,7 +1129,7 @@ xfs_create_tmpfile(
uint resblks; uint resblks;
xfs_ino_t ino; xfs_ino_t ino;
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
prid = xfs_get_initial_prid(dp); prid = xfs_get_initial_prid(dp);
@ -1219,7 +1219,7 @@ xfs_link(
ASSERT(!S_ISDIR(VFS_I(sip)->i_mode)); ASSERT(!S_ISDIR(VFS_I(sip)->i_mode));
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
error = xfs_qm_dqattach(sip); error = xfs_qm_dqattach(sip);
@ -1437,7 +1437,7 @@ xfs_release(
if (xfs_is_readonly(mp)) if (xfs_is_readonly(mp))
return 0; return 0;
if (!XFS_FORCED_SHUTDOWN(mp)) { if (!xfs_is_shutdown(mp)) {
int truncated; int truncated;
/* /*
@ -1520,7 +1520,7 @@ xfs_inactive_truncate(
error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate, 0, 0, 0, &tp); error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate, 0, 0, 0, &tp);
if (error) { if (error) {
ASSERT(XFS_FORCED_SHUTDOWN(mp)); ASSERT(xfs_is_shutdown(mp));
return error; return error;
} }
xfs_ilock(ip, XFS_ILOCK_EXCL); xfs_ilock(ip, XFS_ILOCK_EXCL);
@ -1591,7 +1591,7 @@ xfs_inactive_ifree(
"Failed to remove inode(s) from unlinked list. " "Failed to remove inode(s) from unlinked list. "
"Please free space, unmount and run xfs_repair."); "Please free space, unmount and run xfs_repair.");
} else { } else {
ASSERT(XFS_FORCED_SHUTDOWN(mp)); ASSERT(xfs_is_shutdown(mp));
} }
return error; return error;
} }
@ -1627,7 +1627,7 @@ xfs_inactive_ifree(
* might do that, we need to make sure. Otherwise the * might do that, we need to make sure. Otherwise the
* inode might be lost for a long time or forever. * inode might be lost for a long time or forever.
*/ */
if (!XFS_FORCED_SHUTDOWN(mp)) { if (!xfs_is_shutdown(mp)) {
xfs_notice(mp, "%s: xfs_ifree returned error %d", xfs_notice(mp, "%s: xfs_ifree returned error %d",
__func__, error); __func__, error);
xfs_force_shutdown(mp, SHUTDOWN_META_IO_ERROR); xfs_force_shutdown(mp, SHUTDOWN_META_IO_ERROR);
@ -1678,7 +1678,7 @@ xfs_inode_needs_inactive(
return false; return false;
/* If the log isn't running, push inodes straight to reclaim. */ /* If the log isn't running, push inodes straight to reclaim. */
if (XFS_FORCED_SHUTDOWN(mp) || xfs_has_norecovery(mp)) if (xfs_is_shutdown(mp) || xfs_has_norecovery(mp))
return false; return false;
/* Metadata inodes require explicit resource cleanup. */ /* Metadata inodes require explicit resource cleanup. */
@ -2010,7 +2010,7 @@ xfs_iunlink_destroy(
rhashtable_free_and_destroy(&pag->pagi_unlinked_hash, rhashtable_free_and_destroy(&pag->pagi_unlinked_hash,
xfs_iunlink_free_item, &freed_anything); xfs_iunlink_free_item, &freed_anything);
ASSERT(freed_anything == false || XFS_FORCED_SHUTDOWN(pag->pag_mount)); ASSERT(freed_anything == false || xfs_is_shutdown(pag->pag_mount));
} }
/* /*
@ -2755,7 +2755,7 @@ xfs_remove(
trace_xfs_remove(dp, name); trace_xfs_remove(dp, name);
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
error = xfs_qm_dqattach(dp); error = xfs_qm_dqattach(dp);
@ -3655,7 +3655,7 @@ xfs_iflush_cluster(
* AIL, leaving a dirty/unpinned inode attached to the buffer * AIL, leaving a dirty/unpinned inode attached to the buffer
* that otherwise looks like it should be flushed. * that otherwise looks like it should be flushed.
*/ */
if (XFS_FORCED_SHUTDOWN(mp)) { if (xfs_is_shutdown(mp)) {
xfs_iunpin_wait(ip); xfs_iunpin_wait(ip);
xfs_iflush_abort(ip); xfs_iflush_abort(ip);
xfs_iunlock(ip, XFS_ILOCK_SHARED); xfs_iunlock(ip, XFS_ILOCK_SHARED);

View File

@ -756,7 +756,7 @@ xfs_ioc_fsbulkstat(
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
if (copy_from_user(&bulkreq, arg, sizeof(struct xfs_fsop_bulkreq))) if (copy_from_user(&bulkreq, arg, sizeof(struct xfs_fsop_bulkreq)))
@ -927,7 +927,7 @@ xfs_ioc_bulkstat(
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
if (copy_from_user(&hdr, &arg->hdr, sizeof(hdr))) if (copy_from_user(&hdr, &arg->hdr, sizeof(hdr)))
@ -977,7 +977,7 @@ xfs_ioc_inumbers(
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
if (copy_from_user(&hdr, &arg->hdr, sizeof(hdr))) if (copy_from_user(&hdr, &arg->hdr, sizeof(hdr)))
@ -1265,7 +1265,7 @@ xfs_ioctl_setattr_get_trans(
if (xfs_is_readonly(mp)) if (xfs_is_readonly(mp))
goto out_error; goto out_error;
error = -EIO; error = -EIO;
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
goto out_error; goto out_error;
error = xfs_trans_alloc_ichange(ip, NULL, NULL, pdqp, error = xfs_trans_alloc_ichange(ip, NULL, NULL, pdqp,
@ -1791,7 +1791,7 @@ xfs_ioc_swapext(
goto out_put_tmp_file; goto out_put_tmp_file;
} }
if (XFS_FORCED_SHUTDOWN(ip->i_mount)) { if (xfs_is_shutdown(ip->i_mount)) {
error = -EIO; error = -EIO;
goto out_put_tmp_file; goto out_put_tmp_file;
} }

View File

@ -254,7 +254,7 @@ xfs_compat_ioc_fsbulkstat(
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
if (get_user(addr, &p32->lastip)) if (get_user(addr, &p32->lastip))

View File

@ -734,7 +734,7 @@ xfs_direct_write_iomap_begin(
ASSERT(flags & (IOMAP_WRITE | IOMAP_ZERO)); ASSERT(flags & (IOMAP_WRITE | IOMAP_ZERO));
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
/* /*
@ -874,7 +874,7 @@ xfs_buffered_write_iomap_begin(
int allocfork = XFS_DATA_FORK; int allocfork = XFS_DATA_FORK;
int error = 0; int error = 0;
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
/* we can't use delayed allocations when using extent size hints */ /* we can't use delayed allocations when using extent size hints */
@ -1127,7 +1127,7 @@ xfs_buffered_write_iomap_end(
error = xfs_bmap_punch_delalloc_range(ip, start_fsb, error = xfs_bmap_punch_delalloc_range(ip, start_fsb,
end_fsb - start_fsb); end_fsb - start_fsb);
if (error && !XFS_FORCED_SHUTDOWN(mp)) { if (error && !xfs_is_shutdown(mp)) {
xfs_alert(mp, "%s: unable to clean up ino %lld", xfs_alert(mp, "%s: unable to clean up ino %lld",
__func__, ip->i_ino); __func__, ip->i_ino);
return error; return error;
@ -1162,7 +1162,7 @@ xfs_read_iomap_begin(
ASSERT(!(flags & (IOMAP_WRITE | IOMAP_ZERO))); ASSERT(!(flags & (IOMAP_WRITE | IOMAP_ZERO)));
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
error = xfs_ilock_for_iomap(ip, flags, &lockmode); error = xfs_ilock_for_iomap(ip, flags, &lockmode);
@ -1203,7 +1203,7 @@ xfs_seek_iomap_begin(
int error = 0; int error = 0;
unsigned lockmode; unsigned lockmode;
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
lockmode = xfs_ilock_data_map_shared(ip); lockmode = xfs_ilock_data_map_shared(ip);
@ -1285,7 +1285,7 @@ xfs_xattr_iomap_begin(
int nimaps = 1, error = 0; int nimaps = 1, error = 0;
unsigned lockmode; unsigned lockmode;
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
lockmode = xfs_ilock_attr_map_shared(ip); lockmode = xfs_ilock_attr_map_shared(ip);

View File

@ -582,7 +582,7 @@ xfs_vn_getattr(
trace_xfs_getattr(ip); trace_xfs_getattr(ip);
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
stat->size = XFS_ISIZE(ip); stat->size = XFS_ISIZE(ip);
@ -676,7 +676,7 @@ xfs_vn_change_ok(
if (xfs_is_readonly(mp)) if (xfs_is_readonly(mp))
return -EROFS; return -EROFS;
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
return setattr_prepare(mnt_userns, dentry, iattr); return setattr_prepare(mnt_userns, dentry, iattr);

View File

@ -1076,7 +1076,7 @@ xfs_fs_writable(
{ {
ASSERT(level > SB_UNFROZEN); ASSERT(level > SB_UNFROZEN);
if ((mp->m_super->s_writers.frozen >= level) || if ((mp->m_super->s_writers.frozen >= level) ||
XFS_FORCED_SHUTDOWN(mp) || xfs_is_readonly(mp)) xfs_is_shutdown(mp) || xfs_is_readonly(mp))
return false; return false;
return true; return true;
@ -1268,7 +1268,7 @@ xfs_add_incompat_log_feature(
xfs_buf_lock(mp->m_sb_bp); xfs_buf_lock(mp->m_sb_bp);
xfs_buf_hold(mp->m_sb_bp); xfs_buf_hold(mp->m_sb_bp);
if (XFS_FORCED_SHUTDOWN(mp)) { if (xfs_is_shutdown(mp)) {
error = -EIO; error = -EIO;
goto rele; goto rele;
} }
@ -1323,7 +1323,7 @@ xfs_clear_incompat_log_features(
if (!xfs_sb_version_hascrc(&mp->m_sb) || if (!xfs_sb_version_hascrc(&mp->m_sb) ||
!xfs_sb_has_incompat_log_feature(&mp->m_sb, !xfs_sb_has_incompat_log_feature(&mp->m_sb,
XFS_SB_FEAT_INCOMPAT_LOG_ALL) || XFS_SB_FEAT_INCOMPAT_LOG_ALL) ||
XFS_FORCED_SHUTDOWN(mp)) xfs_is_shutdown(mp))
return false; return false;
/* /*

View File

@ -424,7 +424,7 @@ __XFS_IS_OPSTATE(blockgc_enabled, BLOCKGC_ENABLED)
#define XFS_MAX_IO_LOG 30 /* 1G */ #define XFS_MAX_IO_LOG 30 /* 1G */
#define XFS_MIN_IO_LOG PAGE_SHIFT #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, void xfs_do_force_shutdown(struct xfs_mount *mp, int flags, char *fname,
int lnnum); int lnnum);
#define xfs_force_shutdown(m,f) \ #define xfs_force_shutdown(m,f) \

View File

@ -92,7 +92,7 @@ xfs_fs_map_blocks(
uint lock_flags; uint lock_flags;
int error = 0; int error = 0;
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
/* /*

View File

@ -157,7 +157,7 @@ xfs_qm_dqpurge(
} }
ASSERT(atomic_read(&dqp->q_pincount) == 0); 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)); !test_bit(XFS_LI_IN_AIL, &dqp->q_logitem.qli_item.li_flags));
xfs_dqfunlock(dqp); xfs_dqfunlock(dqp);
@ -823,7 +823,7 @@ xfs_qm_qino_alloc(
error = xfs_trans_commit(tp); error = xfs_trans_commit(tp);
if (error) { if (error) {
ASSERT(XFS_FORCED_SHUTDOWN(mp)); ASSERT(xfs_is_shutdown(mp));
xfs_alert(mp, "%s failed (error %d)!", __func__, error); xfs_alert(mp, "%s failed (error %d)!", __func__, error);
} }
if (need_alloc) if (need_alloc)

View File

@ -1024,7 +1024,7 @@ xfs_destroy_percpu_counters(
percpu_counter_destroy(&mp->m_icount); percpu_counter_destroy(&mp->m_icount);
percpu_counter_destroy(&mp->m_ifree); percpu_counter_destroy(&mp->m_ifree);
percpu_counter_destroy(&mp->m_fdblocks); 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_sum(&mp->m_delalloc_blks) == 0);
percpu_counter_destroy(&mp->m_delalloc_blks); percpu_counter_destroy(&mp->m_delalloc_blks);
} }

View File

@ -107,7 +107,7 @@ xfs_readlink(
ASSERT(ip->i_df.if_format != XFS_DINODE_FMT_LOCAL); ASSERT(ip->i_df.if_format != XFS_DINODE_FMT_LOCAL);
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
xfs_ilock(ip, XFS_ILOCK_SHARED); xfs_ilock(ip, XFS_ILOCK_SHARED);
@ -168,7 +168,7 @@ xfs_symlink(
trace_xfs_symlink(dp, link_name); trace_xfs_symlink(dp, link_name);
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
/* /*
@ -444,7 +444,7 @@ xfs_inactive_symlink_rmt(
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
error = xfs_trans_commit(tp); error = xfs_trans_commit(tp);
if (error) { if (error) {
ASSERT(XFS_FORCED_SHUTDOWN(mp)); ASSERT(xfs_is_shutdown(mp));
goto error_unlock; goto error_unlock;
} }
@ -477,7 +477,7 @@ xfs_inactive_symlink(
trace_xfs_inactive_symlink(ip); trace_xfs_inactive_symlink(ip);
if (XFS_FORCED_SHUTDOWN(mp)) if (xfs_is_shutdown(mp))
return -EIO; return -EIO;
xfs_ilock(ip, XFS_ILOCK_EXCL); xfs_ilock(ip, XFS_ILOCK_EXCL);

View File

@ -775,7 +775,7 @@ xfs_trans_committed_bulk(
* object into the AIL as we are in a shutdown situation. * object into the AIL as we are in a shutdown situation.
*/ */
if (aborted) { if (aborted) {
ASSERT(XFS_FORCED_SHUTDOWN(ailp->ail_mount)); ASSERT(xfs_is_shutdown(ailp->ail_mount));
if (lip->li_ops->iop_unpin) if (lip->li_ops->iop_unpin)
lip->li_ops->iop_unpin(lip, 1); lip->li_ops->iop_unpin(lip, 1);
continue; continue;
@ -864,7 +864,7 @@ __xfs_trans_commit(
if (!(tp->t_flags & XFS_TRANS_DIRTY)) if (!(tp->t_flags & XFS_TRANS_DIRTY))
goto out_unreserve; goto out_unreserve;
if (XFS_FORCED_SHUTDOWN(mp)) { if (xfs_is_shutdown(mp)) {
error = -EIO; error = -EIO;
goto out_unreserve; goto out_unreserve;
} }
@ -950,12 +950,12 @@ xfs_trans_cancel(
* filesystem. This happens in paths where we detect * filesystem. This happens in paths where we detect
* corruption and decide to give up. * 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_ERROR_REPORT("xfs_trans_cancel", XFS_ERRLEVEL_LOW, mp);
xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE);
} }
#ifdef DEBUG #ifdef DEBUG
if (!dirty && !XFS_FORCED_SHUTDOWN(mp)) { if (!dirty && !xfs_is_shutdown(mp)) {
struct xfs_log_item *lip; struct xfs_log_item *lip;
list_for_each_entry(lip, &tp->t_items, li_trans) list_for_each_entry(lip, &tp->t_items, li_trans)

View File

@ -620,7 +620,7 @@ xfsaild(
* opportunity to release such buffers from the queue. * opportunity to release such buffers from the queue.
*/ */
ASSERT(list_empty(&ailp->ail_buf_list) || 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); xfs_buf_delwri_cancel(&ailp->ail_buf_list);
break; break;
} }
@ -683,7 +683,7 @@ xfs_ail_push(
struct xfs_log_item *lip; struct xfs_log_item *lip;
lip = xfs_ail_min(ailp); 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) XFS_LSN_CMP(threshold_lsn, ailp->ail_target) <= 0)
return; return;
@ -748,7 +748,7 @@ xfs_ail_update_finish(
return; return;
} }
if (!XFS_FORCED_SHUTDOWN(mp)) if (!xfs_is_shutdown(mp))
xlog_assign_tail_lsn_locked(mp); xlog_assign_tail_lsn_locked(mp);
if (list_empty(&ailp->ail_head)) if (list_empty(&ailp->ail_head))
@ -868,7 +868,7 @@ xfs_trans_ail_delete(
spin_lock(&ailp->ail_lock); spin_lock(&ailp->ail_lock);
if (!test_bit(XFS_LI_IN_AIL, &lip->li_flags)) { if (!test_bit(XFS_LI_IN_AIL, &lip->li_flags)) {
spin_unlock(&ailp->ail_lock); 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, xfs_alert_tag(mp, XFS_PTAG_AILDELETE,
"%s: attempting to delete a log item that is not in the AIL", "%s: attempting to delete a log item that is not in the AIL",
__func__); __func__);

View File

@ -138,7 +138,7 @@ xfs_trans_get_buf_map(
bp = xfs_trans_buf_item_match(tp, target, map, nmaps); bp = xfs_trans_buf_item_match(tp, target, map, nmaps);
if (bp != NULL) { if (bp != NULL) {
ASSERT(xfs_buf_islocked(bp)); ASSERT(xfs_buf_islocked(bp));
if (XFS_FORCED_SHUTDOWN(tp->t_mountp)) { if (xfs_is_shutdown(tp->t_mountp)) {
xfs_buf_stale(bp); xfs_buf_stale(bp);
bp->b_flags |= XBF_DONE; bp->b_flags |= XBF_DONE;
} }
@ -244,7 +244,7 @@ xfs_trans_read_buf_map(
* We never locked this buf ourselves, so we shouldn't * We never locked this buf ourselves, so we shouldn't
* brelse it either. Just get out. * 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_); trace_xfs_trans_read_buf_shut(bp, _RET_IP_);
return -EIO; return -EIO;
} }
@ -300,7 +300,7 @@ xfs_trans_read_buf_map(
return error; return error;
} }
if (XFS_FORCED_SHUTDOWN(mp)) { if (xfs_is_shutdown(mp)) {
xfs_buf_relse(bp); xfs_buf_relse(bp);
trace_xfs_trans_read_buf_shut(bp, _RET_IP_); trace_xfs_trans_read_buf_shut(bp, _RET_IP_);
return -EIO; return -EIO;