]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: export various function for the online scrubber
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 31 Jul 2017 20:08:11 +0000 (15:08 -0500)
committerEric Sandeen <sandeen@redhat.com>
Mon, 31 Jul 2017 20:08:11 +0000 (15:08 -0500)
Source kernel commit: 2678809799e6e37db0800725157f5ebfc03a9df7

Export various internal functions so that the online scrubber can use
them to check the state of metadata.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_alloc.c
libxfs/xfs_alloc.h
libxfs/xfs_btree.c
libxfs/xfs_btree.h
libxfs/xfs_dir2_leaf.c
libxfs/xfs_dir2_priv.h
libxfs/xfs_inode_buf.c
libxfs/xfs_inode_buf.h
libxfs/xfs_rmap.c
libxfs/xfs_rmap.h
libxfs/xfs_rtbitmap.c

index aee7844480347ac4785c3865487898bae84b24c6..dc849b7cc9ca27eba327a1bd00ae47599e816fbe 100644 (file)
@@ -602,7 +602,7 @@ const struct xfs_buf_ops xfs_agfl_buf_ops = {
 /*
  * Read in the allocation group free block array.
  */
-STATIC int                             /* error */
+int                                    /* error */
 xfs_alloc_read_agfl(
        xfs_mount_t     *mp,            /* mount point structure */
        xfs_trans_t     *tp,            /* transaction pointer */
index 77d9c27330abc2fbe7dbf192a8d25e8c2352fa17..ef26edc2e938349b918157d20557fac6ab9d10b0 100644 (file)
@@ -213,6 +213,8 @@ xfs_alloc_get_rec(
 
 int xfs_read_agf(struct xfs_mount *mp, struct xfs_trans *tp,
                        xfs_agnumber_t agno, int flags, struct xfs_buf **bpp);
+int xfs_alloc_read_agfl(struct xfs_mount *mp, struct xfs_trans *tp,
+                       xfs_agnumber_t agno, struct xfs_buf **bpp);
 int xfs_alloc_fix_freelist(struct xfs_alloc_arg *args, int flags);
 int xfs_free_extent_fix_freelist(struct xfs_trans *tp, xfs_agnumber_t agno,
                struct xfs_buf **agbp);
index 56b50a5bb3c52142ad252db8a76080290a68a301..2a1c72a378e918d61d4adf29406591481ccd8ae3 100644 (file)
@@ -564,7 +564,7 @@ xfs_btree_ptr_offset(
 /*
  * Return a pointer to the n-th record in the btree block.
  */
-STATIC union xfs_btree_rec *
+union xfs_btree_rec *
 xfs_btree_rec_addr(
        struct xfs_btree_cur    *cur,
        int                     n,
@@ -577,7 +577,7 @@ xfs_btree_rec_addr(
 /*
  * Return a pointer to the n-th key in the btree block.
  */
-STATIC union xfs_btree_key *
+union xfs_btree_key *
 xfs_btree_key_addr(
        struct xfs_btree_cur    *cur,
        int                     n,
@@ -590,7 +590,7 @@ xfs_btree_key_addr(
 /*
  * Return a pointer to the n-th high key in the btree block.
  */
-STATIC union xfs_btree_key *
+union xfs_btree_key *
 xfs_btree_high_key_addr(
        struct xfs_btree_cur    *cur,
        int                     n,
@@ -603,7 +603,7 @@ xfs_btree_high_key_addr(
 /*
  * Return a pointer to the n-th block pointer in the btree block.
  */
-STATIC union xfs_btree_ptr *
+union xfs_btree_ptr *
 xfs_btree_ptr_addr(
        struct xfs_btree_cur    *cur,
        int                     n,
@@ -637,7 +637,7 @@ xfs_btree_get_iroot(
  * Retrieve the block pointer from the cursor at the given level.
  * This may be an inode btree root or from a buffer.
  */
-STATIC struct xfs_btree_block *                /* generic btree block pointer */
+struct xfs_btree_block *               /* generic btree block pointer */
 xfs_btree_get_block(
        struct xfs_btree_cur    *cur,   /* btree cursor */
        int                     level,  /* level in btree */
@@ -1752,7 +1752,7 @@ error0:
        return error;
 }
 
-STATIC int
+int
 xfs_btree_lookup_get_block(
        struct xfs_btree_cur    *cur,   /* btree cursor */
        int                     level,  /* level in the btree */
index f56d4b831abc32baca80ca0154677c1f6cbcd335..f9ce370626c2c2154622ea2497edf1206651e3c3 100644 (file)
@@ -504,4 +504,17 @@ int xfs_btree_visit_blocks(struct xfs_btree_cur *cur,
 
 int xfs_btree_count_blocks(struct xfs_btree_cur *cur, xfs_extlen_t *blocks);
 
+union xfs_btree_rec *xfs_btree_rec_addr(struct xfs_btree_cur *cur, int n,
+               struct xfs_btree_block *block);
+union xfs_btree_key *xfs_btree_key_addr(struct xfs_btree_cur *cur, int n,
+               struct xfs_btree_block *block);
+union xfs_btree_key *xfs_btree_high_key_addr(struct xfs_btree_cur *cur, int n,
+               struct xfs_btree_block *block);
+union xfs_btree_ptr *xfs_btree_ptr_addr(struct xfs_btree_cur *cur, int n,
+               struct xfs_btree_block *block);
+int xfs_btree_lookup_get_block(struct xfs_btree_cur *cur, int level,
+               union xfs_btree_ptr *pp, struct xfs_btree_block **blkp);
+struct xfs_btree_block *xfs_btree_get_block(struct xfs_btree_cur *cur,
+               int level, struct xfs_buf **bpp);
+
 #endif /* __XFS_BTREE_H__ */
index 40a35b84a7d25a9ad5c099265862b60a48899ff2..e93f12a22e5a0600bf73506e43d52240928f95da 100644 (file)
@@ -253,7 +253,7 @@ const struct xfs_buf_ops xfs_dir3_leafn_buf_ops = {
        .verify_write = xfs_dir3_leafn_write_verify,
 };
 
-static int
+int
 xfs_dir3_leaf_read(
        struct xfs_trans        *tp,
        struct xfs_inode        *dp,
index 011df4da6cc23a85f6f6784466bd79ee99278237..576f2d267fa73895acb211f7ad1627c92e5b6239 100644 (file)
@@ -58,6 +58,8 @@ extern int xfs_dir3_data_init(struct xfs_da_args *args, xfs_dir2_db_t blkno,
                struct xfs_buf **bpp);
 
 /* xfs_dir2_leaf.c */
+extern int xfs_dir3_leaf_read(struct xfs_trans *tp, struct xfs_inode *dp,
+               xfs_dablk_t fbno, xfs_daddr_t mappedbno, struct xfs_buf **bpp);
 extern int xfs_dir3_leafn_read(struct xfs_trans *tp, struct xfs_inode *dp,
                xfs_dablk_t fbno, xfs_daddr_t mappedbno, struct xfs_buf **bpp);
 extern int xfs_dir2_block_to_leaf(struct xfs_da_args *args,
index fcc6fb8e1d1aa60479b880b69dd4c10de1f341a7..18a18f970fb398cffd3614b7358a69072ca518e1 100644 (file)
@@ -379,7 +379,7 @@ xfs_log_dinode_to_disk(
        }
 }
 
-static bool
+bool
 xfs_dinode_verify(
        struct xfs_mount        *mp,
        xfs_ino_t               ino,
index 0827d7def1ce2f6a8eeca4a1018d02500ccd5155..a9c97a356c3062a39634f76d57bb156c167cac93 100644 (file)
@@ -82,4 +82,7 @@ void  xfs_inobp_check(struct xfs_mount *, struct xfs_buf *);
 #define        xfs_inobp_check(mp, bp)
 #endif /* DEBUG */
 
+bool   xfs_dinode_verify(struct xfs_mount *mp, xfs_ino_t ino,
+                         struct xfs_dinode *dip);
+
 #endif /* __XFS_INODE_BUF_H__ */
index 0d6b5d41231b9b88b44f71f2a9ab2432ed976890..b94784ac104dc4080596e83ccae23fdbac6af643 100644 (file)
@@ -177,7 +177,8 @@ done:
        return error;
 }
 
-static int
+/* Convert an internal btree record to an rmap record. */
+int
 xfs_rmap_btrec_to_irec(
        union xfs_btree_rec     *rec,
        struct xfs_rmap_irec    *irec)
index 265116d044f42baa8f952889e696fce77e8f7718..466ede637080e5832046a96d62789eb2e46ed03f 100644 (file)
@@ -216,5 +216,8 @@ int xfs_rmap_lookup_le_range(struct xfs_btree_cur *cur, xfs_agblock_t bno,
                struct xfs_rmap_irec *irec, int *stat);
 int xfs_rmap_compare(const struct xfs_rmap_irec *a,
                const struct xfs_rmap_irec *b);
+union xfs_btree_rec;
+int xfs_rmap_btrec_to_irec(union xfs_btree_rec *rec,
+               struct xfs_rmap_irec *irec);
 
 #endif /* __XFS_RMAP_H__ */
index 8f8a99d69c97ac885c10acf1883f54b77bc959a5..453dbb9ae38a90a25ad6e1056411ccbb5a28e929 100644 (file)
@@ -65,7 +65,7 @@ const struct xfs_buf_ops xfs_rtbuf_ops = {
  * Get a buffer for the bitmap or summary file block specified.
  * The buffer is returned read and locked.
  */
-static int
+int
 xfs_rtbuf_get(
        xfs_mount_t     *mp,            /* file system mount structure */
        xfs_trans_t     *tp,            /* transaction pointer */