mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-04 11:43:54 +08:00
0a9633fa2f
For repairs, we need to reserve at least as many blocks as we think we're going to need to rebuild the data structure, and we're going to need some helpers to roll transactions while maintaining locks on the AG headers so that other threads cannot wander into the middle of a repair. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
69 lines
1.9 KiB
C
69 lines
1.9 KiB
C
/*
|
|
* Copyright (C) 2018 Oracle. All Rights Reserved.
|
|
*
|
|
* Author: Darrick J. Wong <darrick.wong@oracle.com>
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version 2
|
|
* of the License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it would be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write the Free Software Foundation,
|
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
*/
|
|
#ifndef __XFS_SCRUB_REPAIR_H__
|
|
#define __XFS_SCRUB_REPAIR_H__
|
|
|
|
static inline int xfs_repair_notsupported(struct xfs_scrub_context *sc)
|
|
{
|
|
return -EOPNOTSUPP;
|
|
}
|
|
|
|
#ifdef CONFIG_XFS_ONLINE_REPAIR
|
|
|
|
/* Repair helpers */
|
|
|
|
int xfs_repair_attempt(struct xfs_inode *ip, struct xfs_scrub_context *sc,
|
|
bool *fixed);
|
|
void xfs_repair_failure(struct xfs_mount *mp);
|
|
int xfs_repair_roll_ag_trans(struct xfs_scrub_context *sc);
|
|
bool xfs_repair_ag_has_space(struct xfs_perag *pag, xfs_extlen_t nr_blocks,
|
|
enum xfs_ag_resv_type type);
|
|
xfs_extlen_t xfs_repair_calc_ag_resblks(struct xfs_scrub_context *sc);
|
|
|
|
/* Metadata repairers */
|
|
|
|
int xfs_repair_probe(struct xfs_scrub_context *sc);
|
|
|
|
#else
|
|
|
|
static inline int xfs_repair_attempt(
|
|
struct xfs_inode *ip,
|
|
struct xfs_scrub_context *sc,
|
|
bool *fixed)
|
|
{
|
|
return -EOPNOTSUPP;
|
|
}
|
|
|
|
static inline void xfs_repair_failure(struct xfs_mount *mp) {}
|
|
|
|
static inline xfs_extlen_t
|
|
xfs_repair_calc_ag_resblks(
|
|
struct xfs_scrub_context *sc)
|
|
{
|
|
ASSERT(!(sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR));
|
|
return 0;
|
|
}
|
|
|
|
#define xfs_repair_probe xfs_repair_notsupported
|
|
|
|
#endif /* CONFIG_XFS_ONLINE_REPAIR */
|
|
|
|
#endif /* __XFS_SCRUB_REPAIR_H__ */
|