Skip to content

Commit

Permalink
xfs: create a shared header file for format-related information
Browse files Browse the repository at this point in the history
All of the buffer operations structures are needed to be exported
for xfs_db, so move them all to a common location rather than
spreading them all over the place. They are verifying the on-disk
format, so while xfs_format.h might be a good place, it is not part
of the on disk format.

Hence we need to create a new header file that we centralise these
related definitions. Start by moving the bffer operations
structures, and then also move all the other definitions that have
crept into xfs_log_format.h and xfs_format.h as there was no other
shared header file to put them in.

Signed-off-by: Dave Chinner <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Ben Myers <[email protected]>
  • Loading branch information
Dave Chinner authored and Ben Myers committed Oct 23, 2013
1 parent 865e944 commit 70a9883
Show file tree
Hide file tree
Showing 54 changed files with 289 additions and 232 deletions.
4 changes: 0 additions & 4 deletions fs/xfs/xfs_ag.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ typedef struct xfs_agf {
extern int xfs_read_agf(struct xfs_mount *mp, struct xfs_trans *tp,
xfs_agnumber_t agno, int flags, struct xfs_buf **bpp);

extern const struct xfs_buf_ops xfs_agf_buf_ops;

/*
* Size of the unlinked inode hash table in the agi.
*/
Expand Down Expand Up @@ -191,8 +189,6 @@ typedef struct xfs_agi {
extern int xfs_read_agi(struct xfs_mount *mp, struct xfs_trans *tp,
xfs_agnumber_t agno, struct xfs_buf **bpp);

extern const struct xfs_buf_ops xfs_agi_buf_ops;

/*
* The third a.g. block contains the a.g. freelist, an array
* of block pointers to blocks owned by the allocation btree code.
Expand Down
3 changes: 2 additions & 1 deletion fs/xfs/xfs_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
*/
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_types.h"
#include "xfs_format.h"
#include "xfs_shared.h"
#include "xfs_bit.h"
#include "xfs_log.h"
#include "xfs_trans.h"
Expand Down
3 changes: 0 additions & 3 deletions fs/xfs/xfs_alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,4 @@ xfs_alloc_get_rec(
xfs_extlen_t *len, /* output: length of extent */
int *stat); /* output: success/failure */

extern const struct xfs_buf_ops xfs_agf_buf_ops;
extern const struct xfs_buf_ops xfs_agfl_buf_ops;

#endif /* __XFS_ALLOC_H__ */
2 changes: 0 additions & 2 deletions fs/xfs/xfs_alloc_btree.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,4 @@ extern struct xfs_btree_cur *xfs_allocbt_init_cursor(struct xfs_mount *,
xfs_agnumber_t, xfs_btnum_t);
extern int xfs_allocbt_maxrecs(struct xfs_mount *, int, int);

extern const struct xfs_buf_ops xfs_allocbt_buf_ops;

#endif /* __XFS_ALLOC_BTREE_H__ */
4 changes: 3 additions & 1 deletion fs/xfs/xfs_aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "xfs.h"
#include "xfs_log.h"
#include "xfs_format.h"
#include "xfs_shared.h"
#include "xfs_sb.h"
#include "xfs_ag.h"
#include "xfs_log.h"
#include "xfs_trans.h"
#include "xfs_mount.h"
#include "xfs_bmap_btree.h"
Expand Down
1 change: 1 addition & 0 deletions fs/xfs/xfs_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_format.h"
#include "xfs_shared.h"
#include "xfs_bit.h"
#include "xfs_log.h"
#include "xfs_trans.h"
Expand Down
1 change: 1 addition & 0 deletions fs/xfs/xfs_attr_inactive.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_format.h"
#include "xfs_shared.h"
#include "xfs_bit.h"
#include "xfs_log.h"
#include "xfs_trans.h"
Expand Down
2 changes: 0 additions & 2 deletions fs/xfs/xfs_attr_leaf.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,4 @@ void xfs_attr3_leaf_hdr_from_disk(struct xfs_attr3_icleaf_hdr *to,
void xfs_attr3_leaf_hdr_to_disk(struct xfs_attr_leafblock *to,
struct xfs_attr3_icleaf_hdr *from);

extern const struct xfs_buf_ops xfs_attr3_leaf_buf_ops;

#endif /* __XFS_ATTR_LEAF_H__ */
2 changes: 0 additions & 2 deletions fs/xfs/xfs_attr_remote.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ struct xfs_attr3_rmt_hdr {
((bufsize) - (xfs_sb_version_hascrc(&(mp)->m_sb) ? \
sizeof(struct xfs_attr3_rmt_hdr) : 0))

extern const struct xfs_buf_ops xfs_attr3_rmt_buf_ops;

int xfs_attr3_rmt_blocks(struct xfs_mount *mp, int attrlen);

int xfs_attr_rmtval_get(struct xfs_da_args *args);
Expand Down
1 change: 1 addition & 0 deletions fs/xfs/xfs_bmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_format.h"
#include "xfs_shared.h"
#include "xfs_bit.h"
#include "xfs_log.h"
#include "xfs_inum.h"
Expand Down
2 changes: 0 additions & 2 deletions fs/xfs/xfs_bmap_btree.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,4 @@ extern int xfs_bmbt_change_owner(struct xfs_trans *tp, struct xfs_inode *ip,
extern struct xfs_btree_cur *xfs_bmbt_init_cursor(struct xfs_mount *,
struct xfs_trans *, struct xfs_inode *, int);

extern const struct xfs_buf_ops xfs_bmbt_buf_ops;

#endif /* __XFS_BMAP_BTREE_H__ */
1 change: 1 addition & 0 deletions fs/xfs/xfs_bmap_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_format.h"
#include "xfs_shared.h"
#include "xfs_bit.h"
#include "xfs_log.h"
#include "xfs_inum.h"
Expand Down
2 changes: 1 addition & 1 deletion fs/xfs/xfs_btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_types.h"
#include "xfs_shared.h"
#include "xfs_bit.h"
#include "xfs_log.h"
#include "xfs_trans.h"
Expand Down
3 changes: 2 additions & 1 deletion fs/xfs/xfs_da_btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
*/
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_types.h"
#include "xfs_format.h"
#include "xfs_shared.h"
#include "xfs_bit.h"
#include "xfs_log.h"
#include "xfs_trans.h"
Expand Down
2 changes: 0 additions & 2 deletions fs/xfs/xfs_da_btree.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,6 @@ int xfs_da3_node_read(struct xfs_trans *tp, struct xfs_inode *dp,
xfs_dablk_t bno, xfs_daddr_t mappedbno,
struct xfs_buf **bpp, int which_fork);

extern const struct xfs_buf_ops xfs_da3_node_buf_ops;

/*
* Utility routines.
*/
Expand Down
1 change: 1 addition & 0 deletions fs/xfs/xfs_dquot.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_format.h"
#include "xfs_shared.h"
#include "xfs_bit.h"
#include "xfs_log.h"
#include "xfs_trans.h"
Expand Down
2 changes: 0 additions & 2 deletions fs/xfs/xfs_dquot.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,4 @@ static inline struct xfs_dquot *xfs_qm_dqhold(struct xfs_dquot *dqp)
return dqp;
}

extern const struct xfs_buf_ops xfs_dquot_buf_ops;

#endif /* __XFS_DQUOT_H__ */
3 changes: 2 additions & 1 deletion fs/xfs/xfs_extent_busy.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
*/
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_types.h"
#include "xfs_format.h"
#include "xfs_shared.h"
#include "xfs_log.h"
#include "xfs_trans.h"
#include "xfs_sb.h"
Expand Down
1 change: 1 addition & 0 deletions fs/xfs/xfs_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_shared.h"
#include "xfs_log.h"
#include "xfs_sb.h"
#include "xfs_ag.h"
Expand Down
10 changes: 0 additions & 10 deletions fs/xfs/xfs_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,4 @@ struct xfs_dsymlink_hdr {
((bufsize) - (xfs_sb_version_hascrc(&(mp)->m_sb) ? \
sizeof(struct xfs_dsymlink_hdr) : 0))

int xfs_symlink_blocks(struct xfs_mount *mp, int pathlen);
int xfs_symlink_hdr_set(struct xfs_mount *mp, xfs_ino_t ino, uint32_t offset,
uint32_t size, struct xfs_buf *bp);
bool xfs_symlink_hdr_ok(struct xfs_mount *mp, xfs_ino_t ino, uint32_t offset,
uint32_t size, struct xfs_buf *bp);
void xfs_symlink_local_to_remote(struct xfs_trans *tp, struct xfs_buf *bp,
struct xfs_inode *ip, struct xfs_ifork *ifp);

extern const struct xfs_buf_ops xfs_symlink_buf_ops;

#endif /* __XFS_FORMAT_H__ */
2 changes: 2 additions & 0 deletions fs/xfs/xfs_fsops.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_types.h"
#include "xfs_format.h"
#include "xfs_shared.h"
#include "xfs_log.h"
#include "xfs_trans.h"
#include "xfs_sb.h"
Expand Down
3 changes: 2 additions & 1 deletion fs/xfs/xfs_ialloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
*/
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_types.h"
#include "xfs_format.h"
#include "xfs_shared.h"
#include "xfs_bit.h"
#include "xfs_log.h"
#include "xfs_inum.h"
Expand Down
2 changes: 0 additions & 2 deletions fs/xfs/xfs_ialloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,4 @@ int xfs_ialloc_inode_init(struct xfs_mount *mp, struct xfs_trans *tp,
xfs_agnumber_t agno, xfs_agblock_t agbno,
xfs_agblock_t length, unsigned int gen);

extern const struct xfs_buf_ops xfs_agi_buf_ops;

#endif /* __XFS_IALLOC_H__ */
2 changes: 0 additions & 2 deletions fs/xfs/xfs_ialloc_btree.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,4 @@ extern struct xfs_btree_cur *xfs_inobt_init_cursor(struct xfs_mount *,
struct xfs_trans *, struct xfs_buf *, xfs_agnumber_t);
extern int xfs_inobt_maxrecs(struct xfs_mount *, int, int);

extern const struct xfs_buf_ops xfs_inobt_buf_ops;

#endif /* __XFS_IALLOC_BTREE_H__ */
2 changes: 1 addition & 1 deletion fs/xfs/xfs_icreate_item.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_types.h"
#include "xfs_shared.h"
#include "xfs_bit.h"
#include "xfs_log.h"
#include "xfs_trans.h"
Expand Down
1 change: 1 addition & 0 deletions fs/xfs/xfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_format.h"
#include "xfs_shared.h"
#include "xfs_log.h"
#include "xfs_inum.h"
#include "xfs_trans.h"
Expand Down
1 change: 1 addition & 0 deletions fs/xfs/xfs_inode_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_format.h"
#include "xfs_shared.h"
#include "xfs_log.h"
#include "xfs_trans.h"
#include "xfs_sb.h"
Expand Down
3 changes: 0 additions & 3 deletions fs/xfs/xfs_inode_buf.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,4 @@ void xfs_inobp_check(struct xfs_mount *, struct xfs_buf *);
#define xfs_inobp_check(mp, bp)
#endif /* DEBUG */

extern const struct xfs_buf_ops xfs_inode_buf_ops;
extern const struct xfs_buf_ops xfs_inode_buf_ra_ops;

#endif /* __XFS_INODE_BUF_H__ */
1 change: 1 addition & 0 deletions fs/xfs/xfs_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_format.h"
#include "xfs_shared.h"
#include "xfs_log.h"
#include "xfs_trans.h"
#include "xfs_sb.h"
Expand Down
1 change: 1 addition & 0 deletions fs/xfs/xfs_iomap.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_format.h"
#include "xfs_shared.h"
#include "xfs_log.h"
#include "xfs_trans.h"
#include "xfs_sb.h"
Expand Down
1 change: 1 addition & 0 deletions fs/xfs/xfs_iops.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_format.h"
#include "xfs_shared.h"
#include "xfs_acl.h"
#include "xfs_log.h"
#include "xfs_trans.h"
Expand Down
2 changes: 1 addition & 1 deletion fs/xfs/xfs_itable.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_types.h"
#include "xfs_shared.h"
#include "xfs_log.h"
#include "xfs_inum.h"
#include "xfs_trans.h"
Expand Down
2 changes: 1 addition & 1 deletion fs/xfs/xfs_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_types.h"
#include "xfs_shared.h"
#include "xfs_log.h"
#include "xfs_trans.h"
#include "xfs_sb.h"
Expand Down
2 changes: 1 addition & 1 deletion fs/xfs/xfs_log_cil.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_types.h"
#include "xfs_shared.h"
#include "xfs_log.h"
#include "xfs_trans.h"
#include "xfs_trans_priv.h"
Expand Down
Loading

0 comments on commit 70a9883

Please sign in to comment.