diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2016-09-19 03:24:27 +0300 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2016-09-19 03:24:27 +0300 |
commit | cd00158ce34d6e2c42d8892e8499779b8ac1d2bf (patch) | |
tree | d35fb35e93820365979f4c8f8f293ab5d354b439 /fs/xfs/libxfs/xfs_log_format.h | |
parent | ea78d80866ce375defb2fdd1c8a3aafec95e0f85 (diff) | |
download | linux-cd00158ce34d6e2c42d8892e8499779b8ac1d2bf.tar.xz |
xfs: convert RUI log formats to use variable length arrays
Use variable length array declarations for RUI log items,
and replace the open coded sizeof formulae with a single function.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_log_format.h')
-rw-r--r-- | fs/xfs/libxfs/xfs_log_format.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_log_format.h b/fs/xfs/libxfs/xfs_log_format.h index a6eed43fa7cd..fc5eef85d61e 100644 --- a/fs/xfs/libxfs/xfs_log_format.h +++ b/fs/xfs/libxfs/xfs_log_format.h @@ -647,9 +647,17 @@ struct xfs_rui_log_format { __uint16_t rui_size; /* size of this item */ __uint32_t rui_nextents; /* # extents to free */ __uint64_t rui_id; /* rui identifier */ - struct xfs_map_extent rui_extents[1]; /* array of extents to rmap */ + struct xfs_map_extent rui_extents[]; /* array of extents to rmap */ }; +static inline size_t +xfs_rui_log_format_sizeof( + unsigned int nr) +{ + return sizeof(struct xfs_rui_log_format) + + nr * sizeof(struct xfs_map_extent); +} + /* * This is the structure used to lay out an rud log item in the * log. The rud_extents array is a variable size array whose |