From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 04/13] xfs: export various function for the online scrubber
Date: Tue, 6 Jun 2017 09:32:58 -0400 [thread overview]
Message-ID: <20170606133257.GC51630@bfoster.bfoster> (raw)
In-Reply-To: <149643866478.23065.11454082095408197778.stgit@birch.djwong.org>
On Fri, Jun 02, 2017 at 02:24:24PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> 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>
> fs/xfs/libxfs/xfs_alloc.c | 2 +-
> fs/xfs/libxfs/xfs_alloc.h | 2 ++
> fs/xfs/libxfs/xfs_btree.c | 12 ++++++------
> fs/xfs/libxfs/xfs_btree.h | 13 +++++++++++++
> fs/xfs/libxfs/xfs_dir2_leaf.c | 2 +-
> fs/xfs/libxfs/xfs_dir2_priv.h | 2 ++
> fs/xfs/libxfs/xfs_inode_buf.c | 2 +-
> fs/xfs/libxfs/xfs_inode_buf.h | 3 +++
> fs/xfs/libxfs/xfs_rmap.c | 3 ++-
> fs/xfs/libxfs/xfs_rmap.h | 3 +++
> fs/xfs/libxfs/xfs_rtbitmap.c | 2 +-
> fs/xfs/xfs_itable.c | 2 +-
> fs/xfs/xfs_itable.h | 2 ++
> fs/xfs/xfs_rtalloc.h | 3 +++
> 14 files changed, 41 insertions(+), 12 deletions(-)
>
>
> diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
> index 7486401..fefa8da 100644
> --- a/fs/xfs/libxfs/xfs_alloc.c
> +++ b/fs/xfs/libxfs/xfs_alloc.c
> @@ -606,7 +606,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 */
> diff --git a/fs/xfs/libxfs/xfs_alloc.h b/fs/xfs/libxfs/xfs_alloc.h
> index 77d9c27..ef26edc 100644
> --- a/fs/xfs/libxfs/xfs_alloc.h
> +++ b/fs/xfs/libxfs/xfs_alloc.h
> @@ -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);
> diff --git a/fs/xfs/libxfs/xfs_btree.c b/fs/xfs/libxfs/xfs_btree.c
> index 302dd4c..302dac5 100644
> --- a/fs/xfs/libxfs/xfs_btree.c
> +++ b/fs/xfs/libxfs/xfs_btree.c
> @@ -568,7 +568,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,
> @@ -581,7 +581,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,
> @@ -594,7 +594,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,
> @@ -607,7 +607,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,
> @@ -641,7 +641,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 */
> @@ -1756,7 +1756,7 @@ xfs_btree_decrement(
> return error;
> }
>
> -STATIC int
> +int
> xfs_btree_lookup_get_block(
> struct xfs_btree_cur *cur, /* btree cursor */
> int level, /* level in the btree */
> diff --git a/fs/xfs/libxfs/xfs_btree.h b/fs/xfs/libxfs/xfs_btree.h
> index 177a364..9c95e96 100644
> --- a/fs/xfs/libxfs/xfs_btree.h
> +++ b/fs/xfs/libxfs/xfs_btree.h
> @@ -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__ */
> diff --git a/fs/xfs/libxfs/xfs_dir2_leaf.c b/fs/xfs/libxfs/xfs_dir2_leaf.c
> index 68bf3e8..7002024 100644
> --- a/fs/xfs/libxfs/xfs_dir2_leaf.c
> +++ b/fs/xfs/libxfs/xfs_dir2_leaf.c
> @@ -256,7 +256,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,
> diff --git a/fs/xfs/libxfs/xfs_dir2_priv.h b/fs/xfs/libxfs/xfs_dir2_priv.h
> index 011df4d..576f2d2 100644
> --- a/fs/xfs/libxfs/xfs_dir2_priv.h
> +++ b/fs/xfs/libxfs/xfs_dir2_priv.h
> @@ -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,
> diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c
> index d887af9..0c970cf 100644
> --- a/fs/xfs/libxfs/xfs_inode_buf.c
> +++ b/fs/xfs/libxfs/xfs_inode_buf.c
> @@ -381,7 +381,7 @@ xfs_log_dinode_to_disk(
> }
> }
>
> -static bool
> +bool
> xfs_dinode_verify(
> struct xfs_mount *mp,
> xfs_ino_t ino,
> diff --git a/fs/xfs/libxfs/xfs_inode_buf.h b/fs/xfs/libxfs/xfs_inode_buf.h
> index 0827d7d..a9c97a3 100644
> --- a/fs/xfs/libxfs/xfs_inode_buf.h
> +++ b/fs/xfs/libxfs/xfs_inode_buf.h
> @@ -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__ */
> diff --git a/fs/xfs/libxfs/xfs_rmap.c b/fs/xfs/libxfs/xfs_rmap.c
> index 1bcb41f..eda275b 100644
> --- a/fs/xfs/libxfs/xfs_rmap.c
> +++ b/fs/xfs/libxfs/xfs_rmap.c
> @@ -179,7 +179,8 @@ xfs_rmap_delete(
> 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)
> diff --git a/fs/xfs/libxfs/xfs_rmap.h b/fs/xfs/libxfs/xfs_rmap.h
> index 265116d..466ede6 100644
> --- a/fs/xfs/libxfs/xfs_rmap.h
> +++ b/fs/xfs/libxfs/xfs_rmap.h
> @@ -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__ */
> diff --git a/fs/xfs/libxfs/xfs_rtbitmap.c b/fs/xfs/libxfs/xfs_rtbitmap.c
> index 26bba7f..5d4e43e 100644
> --- a/fs/xfs/libxfs/xfs_rtbitmap.c
> +++ b/fs/xfs/libxfs/xfs_rtbitmap.c
> @@ -70,7 +70,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 */
> diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c
> index 26d67ce..c393a2f 100644
> --- a/fs/xfs/xfs_itable.c
> +++ b/fs/xfs/xfs_itable.c
> @@ -31,7 +31,7 @@
> #include "xfs_trace.h"
> #include "xfs_icache.h"
>
> -STATIC int
> +int
> xfs_internal_inum(
> xfs_mount_t *mp,
> xfs_ino_t ino)
> diff --git a/fs/xfs/xfs_itable.h b/fs/xfs/xfs_itable.h
> index 6ea8b39..17e86e0 100644
> --- a/fs/xfs/xfs_itable.h
> +++ b/fs/xfs/xfs_itable.h
> @@ -96,4 +96,6 @@ xfs_inumbers(
> void __user *buffer, /* buffer with inode info */
> inumbers_fmt_pf formatter);
>
> +int xfs_internal_inum(struct xfs_mount *mp, xfs_ino_t ino);
> +
> #endif /* __XFS_ITABLE_H__ */
> diff --git a/fs/xfs/xfs_rtalloc.h b/fs/xfs/xfs_rtalloc.h
> index f13133e..79defa7 100644
> --- a/fs/xfs/xfs_rtalloc.h
> +++ b/fs/xfs/xfs_rtalloc.h
> @@ -107,6 +107,8 @@ xfs_growfs_rt(
> /*
> * From xfs_rtbitmap.c
> */
> +int xfs_rtbuf_get(struct xfs_mount *mp, struct xfs_trans *tp,
> + xfs_rtblock_t block, int issum, struct xfs_buf **bpp);
> int xfs_rtcheck_range(struct xfs_mount *mp, struct xfs_trans *tp,
> xfs_rtblock_t start, xfs_extlen_t len, int val,
> xfs_rtblock_t *new, int *stat);
> @@ -143,6 +145,7 @@ int xfs_rtalloc_query_all(struct xfs_trans *tp,
> # define xfs_growfs_rt(mp,in) (ENOSYS)
> # define xfs_rtalloc_query_range(t,l,h,f,p) (ENOSYS)
> # define xfs_rtalloc_query_all(t,f,p) (ENOSYS)
> +# define xfs_rtbuf_get(m,t,b,i,p) (ENOSYS)
> static inline int /* error */
> xfs_rtmount_init(
> xfs_mount_t *mp) /* file system mount structure */
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-06-06 13:33 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-02 21:24 [PATCH v7 00/13] xfs: preparing for online scrub support Darrick J. Wong
2017-06-02 21:24 ` [PATCH 01/13] xfs: optimize _btree_query_all Darrick J. Wong
2017-06-06 13:32 ` Brian Foster
2017-06-06 17:43 ` Darrick J. Wong
2017-06-07 1:18 ` [PATCH v2 " Darrick J. Wong
2017-06-07 14:22 ` Brian Foster
2017-06-02 21:24 ` [PATCH 02/13] xfs: remove double-underscore integer types Darrick J. Wong
2017-06-02 21:24 ` [PATCH 03/13] xfs: always compile the btree inorder check functions Darrick J. Wong
2017-06-06 13:32 ` Brian Foster
2017-06-02 21:24 ` [PATCH 04/13] xfs: export various function for the online scrubber Darrick J. Wong
2017-06-06 13:32 ` Brian Foster [this message]
2017-06-02 21:24 ` [PATCH 05/13] xfs: plumb in needed functions for range querying of various btrees Darrick J. Wong
2017-06-06 13:33 ` Brian Foster
2017-06-02 21:24 ` [PATCH 06/13] xfs: export _inobt_btrec_to_irec and _ialloc_cluster_alignment for scrub Darrick J. Wong
2017-06-06 16:27 ` Brian Foster
2017-06-06 17:46 ` Darrick J. Wong
2017-06-02 21:24 ` [PATCH 07/13] xfs: check if an inode is cached and allocated Darrick J. Wong
2017-06-06 16:28 ` Brian Foster
2017-06-06 18:40 ` Darrick J. Wong
2017-06-07 14:22 ` Brian Foster
2017-06-15 5:00 ` Darrick J. Wong
2017-06-07 1:21 ` [PATCH v2 " Darrick J. Wong
2017-06-16 17:59 ` [PATCH v3 " Darrick J. Wong
2017-06-19 12:07 ` Brian Foster
2017-06-02 21:24 ` [PATCH 08/13] xfs: reflink find shared should take a transaction Darrick J. Wong
2017-06-06 16:28 ` Brian Foster
2017-06-02 21:24 ` [PATCH 09/13] xfs: separate function to check if reflink flag needed Darrick J. Wong
2017-06-06 16:28 ` Brian Foster
2017-06-06 18:05 ` Darrick J. Wong
2017-06-07 1:26 ` [PATCH v2 " Darrick J. Wong
2017-06-07 14:22 ` Brian Foster
2017-06-02 21:25 ` [PATCH 10/13] xfs: refactor the ifork block counting function Darrick J. Wong
2017-06-06 16:29 ` Brian Foster
2017-06-06 18:51 ` Darrick J. Wong
2017-06-06 20:35 ` Darrick J. Wong
2017-06-07 1:29 ` [PATCH v2 9.9/13] xfs: make _bmap_count_blocks consistent wrt delalloc extent behavior Darrick J. Wong
2017-06-07 15:11 ` Brian Foster
2017-06-07 16:19 ` Darrick J. Wong
2017-06-07 1:29 ` [PATCH v2 10/13] xfs: refactor the ifork block counting function Darrick J. Wong
2017-06-07 15:11 ` Brian Foster
2017-06-02 21:25 ` [PATCH 11/13] xfs: return the hash value of a leaf1 directory block Darrick J. Wong
2017-06-08 13:02 ` Brian Foster
2017-06-08 15:53 ` Darrick J. Wong
2017-06-08 16:31 ` Brian Foster
2017-06-08 16:43 ` Darrick J. Wong
2017-06-08 16:52 ` Brian Foster
2017-06-08 18:22 ` [PATCH v2 " Darrick J. Wong
2017-06-09 12:54 ` Brian Foster
2017-06-02 21:25 ` [PATCH 12/13] xfs: pass along transaction context when reading directory block buffers Darrick J. Wong
2017-06-08 13:02 ` Brian Foster
2017-06-02 21:25 ` [PATCH 13/13] xfs: pass along transaction context when reading xattr " Darrick J. Wong
2017-06-08 13:02 ` Brian Foster
2017-06-02 22:19 ` [PATCH 14/13] xfs: allow reading of already-locked remote symbolic link Darrick J. Wong
2017-06-08 13:02 ` Brian Foster
2017-06-26 6:04 ` [PATCH 15/13] xfs: grab dquots without taking the ilock Darrick J. Wong
2017-06-27 11:00 ` Brian Foster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170606133257.GC51630@bfoster.bfoster \
--to=bfoster@redhat.com \
--cc=darrick.wong@oracle.com \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).