xfs: fix logging of AGF refcount btree fields
PATCH 1/1 xfs: fix logging of AGF refcount btree fields
These fields are separate from the existing roots and levels array and thus need a separate logging flag.
That being said the API to logs the AGI/AGF is a bit of a nightmare, and I have an idea how to improve it. Stay tuned..
Signed-off-by Christoph Hellwig <[email protected]>
--- fs/xfs/libxfs/xfs_alloc.c | 4 ++++ fs/xfs/libxfs/xfs_format.h | 5 ++++- fs/xfs/libxfs/xfs_refcount_btree.c | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-)
fs/xfs/libxfs/xfs_alloc.c +4 -0
@@ -2327,6 +2327,10 @@ xfs_alloc_log_agf( offsetof(xfs_agf_t , agf_longest), offsetof(xfs_agf_t , agf_btreeblks), offsetof(xfs_agf_t , agf_uuid), + offsetof(xfs_agf_t , agf_refcount_root), + offsetof(xfs_agf_t , agf_refcount_level), +/* needed so that we don't log the whole rest of the structure: */ + offsetof(xfs_agf_t , agf_spare64), sizeof(xfs_agf_t) };
fs/xfs/libxfs/xfs_format.h +4 -1
@@ -681,7 +681,10 @@ typedef struct xfs_agf {#define XFS_AGF_LONGEST 0x00000400#define XFS_AGF_BTREEBLKS 0x00000800#define XFS_AGF_UUID 0x00001000 -#define XFS_AGF_NUM_BITS 13 +#define XFS_AGF_REFCOUNT_ROOT 0x00002000 +#define XFS_AGF_REFCOUNT_LEVEL 0x00004000 +#define XFS_AGF_SPARE64 0x00008000 +#define XFS_AGF_NUM_BITS 16#define XFS_AGF_ALL_BITS ((1 << XFS_AGF_NUM_BITS) - 1)#define XFS_AGF_FLAGS \
fs/xfs/libxfs/xfs_refcount_btree.c +2 -1
@@ -61,7 +61,8 @@ xfs_refcountbt_set_root( pag->pagf_refcount_level += inc;xfs_perag_put (pag); -xfs_alloc_log_agf (cur->bc_tp, agbp,XFS_AGF_ROOTS |XFS_AGF_LEVELS ); +xfs_alloc_log_agf (cur->bc_tp, agbp, +XFS_AGF_REFCOUNT_ROOT |XFS_AGF_REFCOUNT_LEVEL ); }STATIC int
Signature · 6 lines
2.1.4 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 5 lines · Christoph Hellwig
These fields are separate from the existing roots and levels array and thus need a separate logging flag.
That being said the API to logs the AGI/AGF is a bit of a nightmare, and I have an idea how to improve it. Stay tuned..
Looks good, tests great!,
Reviewed-by Darrick J. Wong <[email protected]>
(Will keep ears open.)
--D
Quoted 60 lines
Signed-off-by Christoph Hellwig <[email protected]>--- fs/xfs/libxfs/xfs_alloc.c | 4 ++++ fs/xfs/libxfs/xfs_format.h | 5 ++++- fs/xfs/libxfs/xfs_refcount_btree.c | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-)fs/xfs/libxfs/xfs_alloc.c +4
-0@@ -2327,6 +2327,10 @@ xfs_alloc_log_agf( offsetof(xfs_agf_t , agf_longest), offsetof(xfs_agf_t , agf_btreeblks), offsetof(xfs_agf_t , agf_uuid), + offsetof(xfs_agf_t , agf_refcount_root), + offsetof(xfs_agf_t , agf_refcount_level), +/* needed so that we don't log the whole rest of the structure: */ + offsetof(xfs_agf_t , agf_spare64), sizeof(xfs_agf_t) };fs/xfs/libxfs/xfs_format.h +4
-1@@ -681,7 +681,10 @@ typedef struct xfs_agf {#define XFS_AGF_LONGEST 0x00000400#define XFS_AGF_BTREEBLKS 0x00000800#define XFS_AGF_UUID 0x00001000 -#define XFS_AGF_NUM_BITS 13 +#define XFS_AGF_REFCOUNT_ROOT 0x00002000 +#define XFS_AGF_REFCOUNT_LEVEL 0x00004000 +#define XFS_AGF_SPARE64 0x00008000 +#define XFS_AGF_NUM_BITS 16#define XFS_AGF_ALL_BITS ((1 << XFS_AGF_NUM_BITS) - 1)#define XFS_AGF_FLAGS \fs/xfs/libxfs/xfs_refcount_btree.c +2
-1@@ -61,7 +61,8 @@ xfs_refcountbt_set_root( pag->pagf_refcount_level += inc;xfs_perag_put (pag); -xfs_alloc_log_agf (cur->bc_tp, agbp,XFS_AGF_ROOTS |XFS_AGF_LEVELS ); +xfs_alloc_log_agf (cur->bc_tp, agbp, +XFS_AGF_REFCOUNT_ROOT |XFS_AGF_REFCOUNT_LEVEL ); }STATIC intSignature · 6 lines
2.1.4 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs