]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs: rearrange xfs_da_args a bit to use less space
authorDarrick J. Wong <djwong@kernel.org>
Mon, 29 Jul 2024 23:22:43 +0000 (16:22 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 30 Jul 2024 00:01:01 +0000 (17:01 -0700)
commitf6fbc46862cc9a6e41968a8ff5c1c72923984c08
tree079266b47baa314fd1da75a4ec91edc1ff516717
parent8f07219cfee0a30c8ba024e2a296c083fc357dbb
xfs: rearrange xfs_da_args a bit to use less space

Source kernel commit: cda60317ac57add7a0a2865aa29afbc6caad3e9a

A few notes about struct xfs_da_args:

The XFS_ATTR_* flags only go up as far as XFS_ATTR_INCOMPLETE, which
means that attr_filter could be a u8 field.

I've reduced the number of XFS_DA_OP_* flags down to the point where
op_flags would also fit into a u8.

filetype has 7 bytes of slack after it, which is wasteful.

namelen will never be greater than MAXNAMELEN, which is 256.  This field
could be reduced to a short.

Rearrange the fields in xfs_da_args to waste less space.  This reduces
the structure size from 136 bytes to 128.  Later when we add extra
fields to support parent pointer replacement, this will only bloat the
structure to 144 bytes, instead of 168.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
libxfs/xfs_da_btree.h