summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_itable.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2019-07-03 20:36:27 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2019-07-03 20:36:27 -0700
commit5f19c7fc6873351a3d81bbbb98c928343902d8d6 (patch)
treeb55f57cbbc13452bd06d5b42309459e34867fbb8 /fs/xfs/xfs_itable.c
parent7035f9724f8497c709077c08df2073bfcde9c2f5 (diff)
xfs: introduce v5 inode group structure
Introduce a new "v5" inode group structure that fixes the alignment and padding problems of the existing structure. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_itable.c')
-rw-r--r--fs/xfs/xfs_itable.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c
index 5d406915144d..687c873fa635 100644
--- a/fs/xfs/xfs_itable.c
+++ b/fs/xfs/xfs_itable.c
@@ -331,10 +331,11 @@ xfs_inumbers_walk(
const struct xfs_inobt_rec_incore *irec,
void *data)
{
- struct xfs_inogrp inogrp = {
+ struct xfs_inumbers inogrp = {
.xi_startino = XFS_AGINO_TO_INO(mp, agno, irec->ir_startino),
.xi_alloccount = irec->ir_count - irec->ir_freecount,
.xi_allocmask = ~irec->ir_free,
+ .xi_version = XFS_INUMBERS_VERSION_V5,
};
struct xfs_inumbers_chunk *ic = data;
xfs_agino_t agino;
@@ -381,3 +382,14 @@ xfs_inumbers(
return error;
}
+
+/* Convert an inumbers (v5) struct to a inogrp (v1) struct. */
+void
+xfs_inumbers_to_inogrp(
+ struct xfs_inogrp *ig1,
+ const struct xfs_inumbers *ig)
+{
+ ig1->xi_startino = ig->xi_startino;
+ ig1->xi_alloccount = ig->xi_alloccount;
+ ig1->xi_allocmask = ig->xi_allocmask;
+}