~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/fs/xfs/scrub/repair.h

Version: ~ [ linux-5.5 ] ~ [ linux-5.4.15 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.98 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.167 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.211 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.211 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.81 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0+
  2 /*
  3  * Copyright (C) 2018 Oracle.  All Rights Reserved.
  4  * Author: Darrick J. Wong <darrick.wong@oracle.com>
  5  */
  6 #ifndef __XFS_SCRUB_REPAIR_H__
  7 #define __XFS_SCRUB_REPAIR_H__
  8 
  9 static inline int xrep_notsupported(struct xfs_scrub *sc)
 10 {
 11         return -EOPNOTSUPP;
 12 }
 13 
 14 #ifdef CONFIG_XFS_ONLINE_REPAIR
 15 
 16 /* Repair helpers */
 17 
 18 int xrep_attempt(struct xfs_inode *ip, struct xfs_scrub *sc, bool *fixed);
 19 void xrep_failure(struct xfs_mount *mp);
 20 int xrep_roll_ag_trans(struct xfs_scrub *sc);
 21 bool xrep_ag_has_space(struct xfs_perag *pag, xfs_extlen_t nr_blocks,
 22                 enum xfs_ag_resv_type type);
 23 xfs_extlen_t xrep_calc_ag_resblks(struct xfs_scrub *sc);
 24 int xrep_alloc_ag_block(struct xfs_scrub *sc, struct xfs_owner_info *oinfo,
 25                 xfs_fsblock_t *fsbno, enum xfs_ag_resv_type resv);
 26 int xrep_init_btblock(struct xfs_scrub *sc, xfs_fsblock_t fsb,
 27                 struct xfs_buf **bpp, xfs_btnum_t btnum,
 28                 const struct xfs_buf_ops *ops);
 29 
 30 struct xfs_bitmap;
 31 
 32 int xrep_fix_freelist(struct xfs_scrub *sc, bool can_shrink);
 33 int xrep_invalidate_blocks(struct xfs_scrub *sc, struct xfs_bitmap *btlist);
 34 int xrep_reap_extents(struct xfs_scrub *sc, struct xfs_bitmap *exlist,
 35                 struct xfs_owner_info *oinfo, enum xfs_ag_resv_type type);
 36 
 37 struct xrep_find_ag_btree {
 38         /* in: rmap owner of the btree we're looking for */
 39         uint64_t                        rmap_owner;
 40 
 41         /* in: buffer ops */
 42         const struct xfs_buf_ops        *buf_ops;
 43 
 44         /* in: magic number of the btree */
 45         uint32_t                        magic;
 46 
 47         /* out: the highest btree block found and the tree height */
 48         xfs_agblock_t                   root;
 49         unsigned int                    height;
 50 };
 51 
 52 int xrep_find_ag_btree_roots(struct xfs_scrub *sc, struct xfs_buf *agf_bp,
 53                 struct xrep_find_ag_btree *btree_info, struct xfs_buf *agfl_bp);
 54 void xrep_force_quotacheck(struct xfs_scrub *sc, uint dqtype);
 55 int xrep_ino_dqattach(struct xfs_scrub *sc);
 56 
 57 /* Metadata repairers */
 58 
 59 int xrep_probe(struct xfs_scrub *sc);
 60 int xrep_superblock(struct xfs_scrub *sc);
 61 int xrep_agf(struct xfs_scrub *sc);
 62 int xrep_agfl(struct xfs_scrub *sc);
 63 int xrep_agi(struct xfs_scrub *sc);
 64 
 65 #else
 66 
 67 static inline int xrep_attempt(
 68         struct xfs_inode        *ip,
 69         struct xfs_scrub        *sc,
 70         bool                    *fixed)
 71 {
 72         return -EOPNOTSUPP;
 73 }
 74 
 75 static inline void xrep_failure(struct xfs_mount *mp) {}
 76 
 77 static inline xfs_extlen_t
 78 xrep_calc_ag_resblks(
 79         struct xfs_scrub        *sc)
 80 {
 81         ASSERT(!(sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR));
 82         return 0;
 83 }
 84 
 85 #define xrep_probe                      xrep_notsupported
 86 #define xrep_superblock                 xrep_notsupported
 87 #define xrep_agf                        xrep_notsupported
 88 #define xrep_agfl                       xrep_notsupported
 89 #define xrep_agi                        xrep_notsupported
 90 
 91 #endif /* CONFIG_XFS_ONLINE_REPAIR */
 92 
 93 #endif  /* __XFS_SCRUB_REPAIR_H__ */
 94 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp