@@ -2751,7 +2751,7 @@ xfs_alloc_read_agf(
pag->pagf_agflreset = xfs_agfl_needs_reset(mp, agf);
}
#ifdef DEBUG
- else if (!XFS_FORCED_SHUTDOWN(mp)) {
+ else if (!xfs_is_shut_down(mp)) {
ASSERT(pag->pagf_freeblks == be32_to_cpu(agf->agf_freeblks));
ASSERT(pag->pagf_btreeblks == be32_to_cpu(agf->agf_btreeblks));
ASSERT(pag->pagf_flcount == be32_to_cpu(agf->agf_flcount));
@@ -135,7 +135,7 @@ xfs_attr_get(
XFS_STATS_INC(ip->i_mount, xs_attr_get);
- if (XFS_FORCED_SHUTDOWN(ip->i_mount))
+ if (xfs_is_shut_down(ip->i_mount))
return -EIO;
error = xfs_attr_args_init(&args, ip, name, flags);
@@ -208,7 +208,7 @@ xfs_attr_set(
XFS_STATS_INC(mp, xs_attr_set);
- if (XFS_FORCED_SHUTDOWN(dp->i_mount))
+ if (xfs_is_shut_down(dp->i_mount))
return -EIO;
error = xfs_attr_args_init(&args, dp, name, flags);
@@ -387,7 +387,7 @@ xfs_attr_remove(
XFS_STATS_INC(mp, xs_attr_remove);
- if (XFS_FORCED_SHUTDOWN(dp->i_mount))
+ if (xfs_is_shut_down(dp->i_mount))
return -EIO;
error = xfs_attr_args_init(&args, dp, name, flags);
@@ -3816,7 +3816,7 @@ xfs_bmapi_read(
return -EFSCORRUPTED;
}
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
XFS_STATS_INC(mp, xs_blk_mapr);
@@ -4260,7 +4260,7 @@ xfs_bmapi_write(
return -EFSCORRUPTED;
}
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
ifp = XFS_IFORK_PTR(ip, whichfork);
@@ -4485,7 +4485,7 @@ xfs_bmapi_remap(
return -EFSCORRUPTED;
}
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
if (!(ifp->if_flags & XFS_IFEXTENTS)) {
@@ -5124,7 +5124,7 @@ __xfs_bunmapi(
return -EFSCORRUPTED;
}
mp = ip->i_mount;
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
@@ -5632,7 +5632,7 @@ xfs_bmap_collapse_extents(
return -EFSCORRUPTED;
}
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL));
@@ -5710,7 +5710,7 @@ xfs_bmap_can_insert_extents(
ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL));
- if (XFS_FORCED_SHUTDOWN(ip->i_mount))
+ if (xfs_is_shut_down(ip->i_mount))
return -EIO;
xfs_ilock(ip, XFS_ILOCK_EXCL);
@@ -5750,7 +5750,7 @@ xfs_bmap_insert_extents(
return -EFSCORRUPTED;
}
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL));
@@ -5857,7 +5857,7 @@ xfs_bmap_split_extent_at(
return -EFSCORRUPTED;
}
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
ifp = XFS_IFORK_PTR(ip, whichfork);
@@ -1080,7 +1080,7 @@ xfs_dir2_sf_to_block(
* Bomb out if the shortform directory is way too short.
*/
if (dp->i_d.di_size < offsetof(xfs_dir2_sf_hdr_t, parent)) {
- ASSERT(XFS_FORCED_SHUTDOWN(mp));
+ ASSERT(xfs_is_shut_down(mp));
return -EIO;
}
@@ -284,7 +284,7 @@ xfs_dir2_sf_addname(
* Make sure the shortform value has some of its header.
*/
if (dp->i_d.di_size < offsetof(xfs_dir2_sf_hdr_t, parent)) {
- ASSERT(XFS_FORCED_SHUTDOWN(dp->i_mount));
+ ASSERT(xfs_is_shut_down(dp->i_mount));
return -EIO;
}
ASSERT(dp->i_df.if_bytes == dp->i_d.di_size);
@@ -800,7 +800,7 @@ xfs_dir2_sf_lookup(
* Bail out if the directory is way too short.
*/
if (dp->i_d.di_size < offsetof(xfs_dir2_sf_hdr_t, parent)) {
- ASSERT(XFS_FORCED_SHUTDOWN(dp->i_mount));
+ ASSERT(xfs_is_shut_down(dp->i_mount));
return -EIO;
}
ASSERT(dp->i_df.if_bytes == dp->i_d.di_size);
@@ -886,7 +886,7 @@ xfs_dir2_sf_removename(
* Bail out if the directory is way too short.
*/
if (oldsize < offsetof(xfs_dir2_sf_hdr_t, parent)) {
- ASSERT(XFS_FORCED_SHUTDOWN(dp->i_mount));
+ ASSERT(xfs_is_shut_down(dp->i_mount));
return -EIO;
}
ASSERT(dp->i_df.if_bytes == oldsize);
@@ -970,7 +970,7 @@ xfs_dir2_sf_replace(
* Bail out if the shortform directory is way too small.
*/
if (dp->i_d.di_size < offsetof(xfs_dir2_sf_hdr_t, parent)) {
- ASSERT(XFS_FORCED_SHUTDOWN(dp->i_mount));
+ ASSERT(xfs_is_shut_down(dp->i_mount));
return -EIO;
}
ASSERT(dp->i_df.if_bytes == dp->i_d.di_size);
@@ -260,7 +260,7 @@ xfs_check_agi_freecount(
}
} while (i == 1);
- if (!XFS_FORCED_SHUTDOWN(cur->bc_mp))
+ if (!xfs_is_shut_down(cur->bc_mp))
ASSERT(freecount == be32_to_cpu(agi->agi_freecount));
}
return 0;
@@ -1035,7 +1035,7 @@ xfs_ialloc_ag_select(
* No point in iterating over the rest, if we're shutting
* down.
*/
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return NULLAGNUMBER;
agno++;
if (agno >= agcount)
@@ -2648,7 +2648,7 @@ xfs_ialloc_read_agi(
* we are in the middle of a forced shutdown.
*/
ASSERT(pag->pagi_freecount == be32_to_cpu(agi->agi_freecount) ||
- XFS_FORCED_SHUTDOWN(mp));
+ xfs_is_shut_down(mp));
xfs_perag_put(pag);
return 0;
}
@@ -492,7 +492,7 @@ xfs_scrub_metadata(
/* Forbidden if we are shut down or mounted norecovery. */
error = -ESHUTDOWN;
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
goto out;
error = -ENOTRECOVERABLE;
if (xfs_has_norecovery(mp))
@@ -245,7 +245,7 @@ xfs_end_io(
/*
* Just clean up the in-memory strutures if the fs has been shut down.
*/
- if (XFS_FORCED_SHUTDOWN(ip->i_mount)) {
+ if (xfs_is_shut_down(ip->i_mount)) {
error = -EIO;
goto done;
}
@@ -354,7 +354,7 @@ xfs_map_blocks(
wpc->cow_seq == READ_ONCE(ip->i_cowfp->if_seq)))
return 0;
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
/*
@@ -658,7 +658,7 @@ xfs_aops_discard_page(
xfs_fileoff_t start_fsb = XFS_B_TO_FSBT(mp, offset);
int error;
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
goto out_invalidate;
xfs_alert(mp,
@@ -667,7 +667,7 @@ xfs_aops_discard_page(
error = xfs_bmap_punch_delalloc_range(ip, start_fsb,
PAGE_SIZE / i_blocksize(inode));
- if (error && !XFS_FORCED_SHUTDOWN(mp))
+ if (error && !xfs_is_shut_down(mp))
xfs_alert(mp, "page discard unable to remove delalloc mapping.");
out_invalidate:
xfs_vm_invalidatepage(page, 0, PAGE_SIZE);
@@ -523,7 +523,7 @@ xfs_attr_list_int(
XFS_STATS_INC(dp->i_mount, xs_attr_list);
- if (XFS_FORCED_SHUTDOWN(dp->i_mount))
+ if (xfs_is_shut_down(dp->i_mount))
return -EIO;
lock_mode = xfs_ilock_attr_map_shared(dp);
@@ -828,7 +828,7 @@ xfs_free_eofblocks(
error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate, 0, 0, 0,
&tp);
if (error) {
- ASSERT(XFS_FORCED_SHUTDOWN(mp));
+ ASSERT(xfs_is_shut_down(mp));
return error;
}
@@ -883,7 +883,7 @@ xfs_alloc_file_space(
trace_xfs_alloc_file_space(ip);
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
error = xfs_qm_dqattach(ip);
@@ -959,7 +959,7 @@ xfs_alloc_file_space(
/*
* Free the transaction structure.
*/
- ASSERT(error == -ENOSPC || XFS_FORCED_SHUTDOWN(mp));
+ ASSERT(error == -ENOSPC || xfs_is_shut_down(mp));
break;
}
xfs_ilock(ip, XFS_ILOCK_EXCL);
@@ -1020,7 +1020,7 @@ xfs_unmap_extent(
error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write, resblks, 0, 0, &tp);
if (error) {
- ASSERT(error == -ENOSPC || XFS_FORCED_SHUTDOWN(mp));
+ ASSERT(error == -ENOSPC || xfs_is_shut_down(mp));
return error;
}
@@ -1466,7 +1466,7 @@ __xfs_buf_submit(
ASSERT(!(bp->b_flags & _XBF_DELWRI_Q));
/* on shutdown we stale and complete the buffer immediately */
- if (XFS_FORCED_SHUTDOWN(bp->b_target->bt_mount)) {
+ if (xfs_is_shut_down(bp->b_target->bt_mount)) {
xfs_buf_ioerror(bp, -EIO);
bp->b_flags &= ~XBF_DONE;
xfs_buf_stale(bp);
@@ -617,7 +617,7 @@ xfs_buf_item_unlock(
*/
if (atomic_dec_and_test(&bip->bli_refcount)) {
if (aborted) {
- ASSERT(XFS_FORCED_SHUTDOWN(lip->li_mountp));
+ ASSERT(xfs_is_shut_down(lip->li_mountp));
xfs_trans_ail_remove(lip, SHUTDOWN_LOG_IO_ERROR);
xfs_buf_item_relse(bp);
} else if (!dirty)
@@ -1081,7 +1081,7 @@ xfs_buf_iodone_callback_error(
* If we've already decided to shutdown the filesystem because of
* I/O errors, there's no point in giving this a retry.
*/
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
goto out_stale;
if (bp->b_target != lasttarg ||
@@ -506,7 +506,7 @@ xfs_readdir(
trace_xfs_readdir(dp);
- if (XFS_FORCED_SHUTDOWN(dp->i_mount))
+ if (xfs_is_shut_down(dp->i_mount))
return -EIO;
ASSERT(S_ISDIR(VFS_I(dp)->i_mode));
@@ -1094,7 +1094,7 @@ xfs_qm_dqflush(
* We also have to remove the log item from the AIL in this case,
* as we wait for an emptry AIL as part of the unmount process.
*/
- if (XFS_FORCED_SHUTDOWN(mp)) {
+ if (xfs_is_shut_down(mp)) {
struct xfs_log_item *lip = &dqp->q_logitem.qli_item;
dqp->dq_flags &= ~XFS_DQ_DIRTY;
@@ -119,7 +119,7 @@ xfs_file_fsync(
if (error)
return error;
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
xfs_iflags_clear(ip, XFS_ITRUNCATED);
@@ -259,7 +259,7 @@ xfs_file_read_iter(
XFS_STATS_INC(mp, xs_read_calls);
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
if (IS_DAX(inode))
@@ -396,7 +396,7 @@ xfs_dio_write_end_io(
trace_xfs_end_io_direct_write(ip, offset, size);
- if (XFS_FORCED_SHUTDOWN(ip->i_mount))
+ if (xfs_is_shut_down(ip->i_mount))
return -EIO;
if (size <= 0)
@@ -698,7 +698,7 @@ xfs_file_write_iter(
if (ocount == 0)
return 0;
- if (XFS_FORCED_SHUTDOWN(ip->i_mount))
+ if (xfs_is_shut_down(ip->i_mount))
return -EIO;
if (IS_DAX(inode))
@@ -965,7 +965,7 @@ xfs_file_open(
{
if (!(file->f_flags & O_LARGEFILE) && i_size_read(inode) > MAX_NON_LFS)
return -EFBIG;
- if (XFS_FORCED_SHUTDOWN(XFS_M(inode->i_sb)))
+ if (xfs_is_shut_down(XFS_M(inode->i_sb)))
return -EIO;
file->f_mode |= FMODE_NOWAIT;
return 0;
@@ -1037,7 +1037,7 @@ xfs_file_llseek(
{
struct inode *inode = file->f_mapping->host;
- if (XFS_FORCED_SHUTDOWN(XFS_I(inode)->i_mount))
+ if (xfs_is_shut_down(XFS_I(inode)->i_mount))
return -EIO;
switch (whence) {
@@ -487,7 +487,7 @@ xfs_do_force_shutdown(
/*
* No need to duplicate efforts.
*/
- if (XFS_FORCED_SHUTDOWN(mp) && !logerror)
+ if (xfs_is_shut_down(mp) && !logerror)
return;
/*
@@ -758,7 +758,7 @@ xfs_inode_ag_walk_grab(
spin_unlock(&ip->i_flags_lock);
/* nothing to sync during shutdown */
- if (XFS_FORCED_SHUTDOWN(ip->i_mount))
+ if (xfs_is_shut_down(ip->i_mount))
return -EFSCORRUPTED;
/* If we can't grab the inode, it must on it's way to reclaim. */
@@ -1106,7 +1106,7 @@ xfs_reclaim_inode(
xfs_iflock(ip);
}
- if (XFS_FORCED_SHUTDOWN(ip->i_mount)) {
+ if (xfs_is_shut_down(ip->i_mount)) {
xfs_iunpin_wait(ip);
/* xfs_iflush_abort() drops the flush lock */
xfs_iflush_abort(ip, false);
@@ -693,7 +693,7 @@ xfs_lookup(
trace_xfs_lookup(dp, name);
- if (XFS_FORCED_SHUTDOWN(dp->i_mount))
+ if (xfs_is_shut_down(dp->i_mount))
return -EIO;
error = xfs_dir_lookup(NULL, dp, name, &inum, ci_name);
@@ -1152,7 +1152,7 @@ xfs_create(
trace_xfs_create(dp, name);
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
prid = xfs_get_initial_prid(dp);
@@ -1305,7 +1305,7 @@ xfs_create_tmpfile(
struct xfs_trans_res *tres;
uint resblks;
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
prid = xfs_get_initial_prid(dp);
@@ -1396,7 +1396,7 @@ xfs_link(
ASSERT(!S_ISDIR(VFS_I(sip)->i_mode));
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
error = xfs_qm_dqattach(sip);
@@ -1623,7 +1623,7 @@ xfs_release(
if (xfs_is_readonly(mp))
return 0;
- if (!XFS_FORCED_SHUTDOWN(mp)) {
+ if (!xfs_is_shut_down(mp)) {
int truncated;
/*
@@ -1704,7 +1704,7 @@ xfs_inactive_truncate(
error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate, 0, 0, 0, &tp);
if (error) {
- ASSERT(XFS_FORCED_SHUTDOWN(mp));
+ ASSERT(xfs_is_shut_down(mp));
return error;
}
xfs_ilock(ip, XFS_ILOCK_EXCL);
@@ -1775,7 +1775,7 @@ xfs_inactive_ifree(
"Failed to remove inode(s) from unlinked list. "
"Please free space, unmount and run xfs_repair.");
} else {
- ASSERT(XFS_FORCED_SHUTDOWN(mp));
+ ASSERT(xfs_is_shut_down(mp));
}
return error;
}
@@ -1790,7 +1790,7 @@ xfs_inactive_ifree(
* might do that, we need to make sure. Otherwise the
* inode might be lost for a long time or forever.
*/
- if (!XFS_FORCED_SHUTDOWN(mp)) {
+ if (!xfs_is_shut_down(mp)) {
xfs_notice(mp, "%s: xfs_ifree returned error %d",
__func__, error);
xfs_force_shutdown(mp, SHUTDOWN_META_IO_ERROR);
@@ -2541,7 +2541,7 @@ xfs_remove(
trace_xfs_remove(dp, name);
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
error = xfs_qm_dqattach(dp);
@@ -3352,7 +3352,7 @@ xfs_iflush(
* We also have to remove the log item from the AIL in this case,
* as we wait for an empty AIL as part of the unmount process.
*/
- if (XFS_FORCED_SHUTDOWN(mp)) {
+ if (xfs_is_shut_down(mp)) {
error = -EIO;
goto abort_out;
}
@@ -543,8 +543,8 @@ xfs_inode_item_push(
goto out_unlock;
}
- ASSERT(iip->ili_fields != 0 || XFS_FORCED_SHUTDOWN(ip->i_mount));
- ASSERT(iip->ili_logged == 0 || XFS_FORCED_SHUTDOWN(ip->i_mount));
+ ASSERT(iip->ili_fields != 0 || xfs_is_shut_down(ip->i_mount));
+ ASSERT(iip->ili_logged == 0 || xfs_is_shut_down(ip->i_mount));
spin_unlock(&lip->li_ailp->ail_lock);
@@ -747,7 +747,7 @@ xfs_iflush_done(
}
if (mlip_changed) {
- if (!XFS_FORCED_SHUTDOWN(ailp->ail_mount))
+ if (!xfs_is_shut_down(ailp->ail_mount))
xlog_assign_tail_lsn_locked(ailp->ail_mount);
if (list_empty(&ailp->ail_head))
wake_up_all(&ailp->ail_empty);
@@ -309,7 +309,7 @@ xfs_set_dmattrs(
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
error = xfs_trans_alloc(mp, &M_RES(mp)->tr_ichange, 0, 0, 0, &tp);
@@ -745,7 +745,7 @@ xfs_ioc_bulkstat(
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
if (copy_from_user(&bulkreq, arg, sizeof(xfs_fsop_bulkreq_t)))
@@ -1145,7 +1145,7 @@ xfs_ioctl_setattr_get_trans(
if (xfs_is_readonly(mp))
goto out_unlock;
error = -EIO;
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
goto out_unlock;
error = xfs_trans_alloc(mp, &M_RES(mp)->tr_ichange, 0, 0, 0, &tp);
@@ -1786,7 +1786,7 @@ xfs_ioc_swapext(
goto out_put_tmp_file;
}
- if (XFS_FORCED_SHUTDOWN(ip->i_mount)) {
+ if (xfs_is_shut_down(ip->i_mount)) {
error = -EIO;
goto out_put_tmp_file;
}
@@ -247,7 +247,7 @@ xfs_compat_ioc_bulkstat(
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
if (get_user(addr, &p32->lastip))
@@ -1006,7 +1006,7 @@ xfs_file_iomap_begin(
bool shared = false, trimmed = false;
unsigned lockmode;
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
if (((flags & (IOMAP_WRITE | IOMAP_DIRECT)) == IOMAP_WRITE) &&
@@ -1181,7 +1181,7 @@ xfs_file_iomap_end_delalloc(
error = xfs_bmap_punch_delalloc_range(ip, start_fsb,
end_fsb - start_fsb);
- if (error && !XFS_FORCED_SHUTDOWN(mp)) {
+ if (error && !xfs_is_shut_down(mp)) {
xfs_alert(mp, "%s: unable to clean up ino %lld",
__func__, ip->i_ino);
return error;
@@ -1227,7 +1227,7 @@ xfs_xattr_iomap_begin(
int nimaps = 1, error = 0;
unsigned lockmode;
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
lockmode = xfs_ilock_attr_map_shared(ip);
@@ -488,7 +488,7 @@ xfs_vn_getattr(
trace_xfs_getattr(ip);
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
stat->size = XFS_ISIZE(ip);
@@ -584,7 +584,7 @@ xfs_vn_change_ok(
if (xfs_is_readonly(mp))
return -EROFS;
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
return setattr_prepare(dentry, iattr);
@@ -197,7 +197,7 @@ xlog_bread_noalign(
bp->b_error = 0;
error = xfs_buf_submit(bp);
- if (error && !XFS_FORCED_SHUTDOWN(log->l_mp))
+ if (error && !xfs_is_shut_down(log->l_mp))
xfs_buf_ioerror_alert(bp, __func__);
return error;
}
@@ -377,7 +377,7 @@ xlog_recover_iodone(
* We're not going to bother about retrying
* this during recovery. One strike!
*/
- if (!XFS_FORCED_SHUTDOWN(bp->b_target->bt_mount)) {
+ if (!xfs_is_shut_down(bp->b_target->bt_mount)) {
xfs_buf_ioerror_alert(bp, __func__);
xfs_force_shutdown(bp->b_target->bt_mount,
SHUTDOWN_META_IO_ERROR);
@@ -5682,7 +5682,7 @@ xlog_do_recover(
/*
* If IO errors happened during recovery, bail out.
*/
- if (XFS_FORCED_SHUTDOWN(mp)) {
+ if (xfs_is_shut_down(mp)) {
return -EIO;
}
@@ -5709,7 +5709,7 @@ xlog_do_recover(
error = xfs_buf_submit(bp);
if (error) {
- if (!XFS_FORCED_SHUTDOWN(mp)) {
+ if (!xfs_is_shut_down(mp)) {
xfs_buf_ioerror_alert(bp, __func__);
ASSERT(0);
}
@@ -1187,7 +1187,7 @@ xfs_fs_writable(
{
ASSERT(level > SB_UNFROZEN);
if ((mp->m_super->s_writers.frozen >= level) ||
- XFS_FORCED_SHUTDOWN(mp) || xfs_is_readonly(mp))
+ xfs_is_shut_down(mp) || xfs_is_readonly(mp))
return false;
return true;
@@ -296,7 +296,7 @@ __XFS_HAS_FEAT(realtime, REALTIME)
* 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
* features.
*/
__XFS_HAS_FEAT(wsync, WSYNC)
@@ -383,8 +383,6 @@ xfs_preferred_iosize(xfs_mount_t *mp)
return PAGE_SIZE;
}
-#define XFS_FORCED_SHUTDOWN(mp) \
- test_bit(XFS_STATE_SHUTDOWN, &(mp)->m_state)
void xfs_do_force_shutdown(struct xfs_mount *mp, int flags, char *fname,
int lnnum);
#define xfs_force_shutdown(m,f) \
@@ -99,7 +99,7 @@ xfs_fs_map_blocks(
uint lock_flags;
int error = 0;
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
/*
@@ -157,7 +157,7 @@ xfs_qm_dqpurge(
}
ASSERT(atomic_read(&dqp->q_pincount) == 0);
- ASSERT(XFS_FORCED_SHUTDOWN(mp) ||
+ ASSERT(xfs_is_shut_down(mp) ||
!test_bit(XFS_LI_IN_AIL, &dqp->q_logitem.qli_item.li_flags));
xfs_dqfunlock(dqp);
@@ -815,7 +815,7 @@ xfs_qm_qino_alloc(
error = xfs_trans_commit(tp);
if (error) {
- ASSERT(XFS_FORCED_SHUTDOWN(mp));
+ ASSERT(xfs_is_shut_down(mp));
xfs_alert(mp, "%s failed (error %d)!", __func__, error);
}
if (need_alloc)
@@ -1221,7 +1221,7 @@ xfs_reflink_remap_range(
if (!xfs_has_reflink(mp))
return -EOPNOTSUPP;
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
/* Lock both files against IO */
@@ -949,7 +949,7 @@ xfs_fs_destroy_inode(
xfs_inactive(ip);
- ASSERT(XFS_FORCED_SHUTDOWN(ip->i_mount) || ip->i_delayed_blks == 0);
+ ASSERT(xfs_is_shut_down(ip->i_mount) || ip->i_delayed_blks == 0);
XFS_STATS_INC(ip->i_mount, vn_reclaim);
/*
@@ -124,7 +124,7 @@ xfs_readlink(
ASSERT(!(ip->i_df.if_flags & XFS_IFINLINE));
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
xfs_ilock(ip, XFS_ILOCK_SHARED);
@@ -183,7 +183,7 @@ xfs_symlink(
trace_xfs_symlink(dp, link_name);
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
/*
@@ -456,7 +456,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_shut_down(mp));
goto error_unlock;
}
@@ -489,7 +489,7 @@ xfs_inactive_symlink(
trace_xfs_inactive_symlink(ip);
- if (XFS_FORCED_SHUTDOWN(mp))
+ if (xfs_is_shut_down(mp))
return -EIO;
xfs_ilock(ip, XFS_ILOCK_EXCL);
@@ -857,7 +857,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_shut_down(ailp->ail_mount));
lip->li_ops->iop_unpin(lip, 1);
continue;
}
@@ -944,7 +944,7 @@ __xfs_trans_commit(
if (!(tp->t_flags & XFS_TRANS_DIRTY))
goto out_unreserve;
- if (XFS_FORCED_SHUTDOWN(mp)) {
+ if (xfs_is_shut_down(mp)) {
error = -EIO;
goto out_unreserve;
}
@@ -1031,12 +1031,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_shut_down(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_shut_down(mp)) {
struct xfs_log_item *lip;
list_for_each_entry(lip, &tp->t_items, li_trans)
@@ -601,7 +601,7 @@ xfs_ail_push(
xfs_log_item_t *lip;
lip = xfs_ail_min(ailp);
- if (!lip || XFS_FORCED_SHUTDOWN(ailp->ail_mount) ||
+ if (!lip || xfs_is_shut_down(ailp->ail_mount) ||
XFS_LSN_CMP(threshold_lsn, ailp->ail_target) <= 0)
return;
@@ -713,7 +713,7 @@ xfs_trans_ail_update_bulk(
xfs_ail_splice(ailp, cur, &tmp, lsn);
if (mlip_changed) {
- if (!XFS_FORCED_SHUTDOWN(ailp->ail_mount))
+ if (!xfs_is_shut_down(ailp->ail_mount))
xlog_assign_tail_lsn_locked(ailp->ail_mount);
spin_unlock(&ailp->ail_lock);
@@ -771,7 +771,7 @@ xfs_trans_ail_delete(
if (!test_bit(XFS_LI_IN_AIL, &lip->li_flags)) {
spin_unlock(&ailp->ail_lock);
- if (!XFS_FORCED_SHUTDOWN(mp)) {
+ if (!xfs_is_shut_down(mp)) {
xfs_alert_tag(mp, XFS_PTAG_AILDELETE,
"%s: attempting to delete a log item that is not in the AIL",
__func__);
@@ -782,7 +782,7 @@ xfs_trans_ail_delete(
mlip_changed = xfs_ail_delete_one(ailp, lip);
if (mlip_changed) {
- if (!XFS_FORCED_SHUTDOWN(mp))
+ if (!xfs_is_shut_down(mp))
xlog_assign_tail_lsn_locked(mp);
if (list_empty(&ailp->ail_head))
wake_up_all(&ailp->ail_empty);
@@ -137,7 +137,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_shut_down(tp->t_mountp)) {
xfs_buf_stale(bp);
bp->b_flags |= XBF_DONE;
}
@@ -259,7 +259,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_shut_down(mp)) {
trace_xfs_trans_read_buf_shut(bp, _RET_IP_);
return -EIO;
}
@@ -291,7 +291,7 @@ xfs_trans_read_buf_map(
*/
if (bp->b_error) {
error = bp->b_error;
- if (!XFS_FORCED_SHUTDOWN(mp))
+ if (!xfs_is_shut_down(mp))
xfs_buf_ioerror_alert(bp, __func__);
bp->b_flags &= ~XBF_DONE;
xfs_buf_stale(bp);
@@ -306,7 +306,7 @@ xfs_trans_read_buf_map(
return error;
}
- if (XFS_FORCED_SHUTDOWN(mp)) {
+ if (xfs_is_shut_down(mp)) {
xfs_buf_relse(bp);
trace_xfs_trans_read_buf_shut(bp, _RET_IP_);
return -EIO;
@@ -418,7 +418,7 @@ xfs_trans_brelse(
* due to our reference). Since we're already shutdown and need
* ail_lock, just force remove from the AIL and release the bli here.
*/
- if (XFS_FORCED_SHUTDOWN(tp->t_mountp) && freed) {
+ if (xfs_is_shut_down(tp->t_mountp) && freed) {
xfs_trans_ail_remove(&bip->bli_item, SHUTDOWN_LOG_IO_ERROR);
xfs_buf_item_relse(bp);
} else if (!(bip->bli_flags & XFS_BLI_DIRTY)) {