mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-26 19:36:41 +00:00
xfs: refactor log recovery check
Add a predicate to decide if the log is actively in recovery and use that instead of open-coding a pagf_init check in the attr leaf verifier. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
This commit is contained in:
parent
ff23f4af7e
commit
0c60d3aa0e
@ -242,7 +242,6 @@ xfs_attr3_leaf_verify(
|
||||
struct xfs_attr3_icleaf_hdr ichdr;
|
||||
struct xfs_mount *mp = bp->b_target->bt_mount;
|
||||
struct xfs_attr_leafblock *leaf = bp->b_addr;
|
||||
struct xfs_perag *pag = bp->b_pag;
|
||||
struct xfs_attr_leaf_entry *entries;
|
||||
uint16_t end;
|
||||
int i;
|
||||
@ -270,7 +269,7 @@ xfs_attr3_leaf_verify(
|
||||
* because we may have transitioned an empty shortform attr to a leaf
|
||||
* if the attr didn't fit in shortform.
|
||||
*/
|
||||
if (pag && pag->pagf_init && ichdr.count == 0)
|
||||
if (!xfs_log_in_recovery(mp) && ichdr.count == 0)
|
||||
return __this_address;
|
||||
|
||||
/*
|
||||
|
@ -4104,3 +4104,12 @@ xfs_log_check_lsn(
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
bool
|
||||
xfs_log_in_recovery(
|
||||
struct xfs_mount *mp)
|
||||
{
|
||||
struct xlog *log = mp->m_log;
|
||||
|
||||
return log->l_flags & XLOG_ACTIVE_RECOVERY;
|
||||
}
|
||||
|
@ -153,5 +153,6 @@ bool xfs_log_item_in_current_chkpt(struct xfs_log_item *lip);
|
||||
void xfs_log_work_queue(struct xfs_mount *mp);
|
||||
void xfs_log_quiesce(struct xfs_mount *mp);
|
||||
bool xfs_log_check_lsn(struct xfs_mount *, xfs_lsn_t);
|
||||
bool xfs_log_in_recovery(struct xfs_mount *);
|
||||
|
||||
#endif /* __XFS_LOG_H__ */
|
||||
|
Loading…
Reference in New Issue
Block a user