xfs: convert GETPARENTS structures to flex arrays

The current definition of the GETPARENTS ioctl doesn't use the buffer
space terribly efficiently because each parent pointer record struct
incorporates enough space to hold the maximally sized dirent name.  Most
dirent names are much less than 255 bytes long, which means we're
wasting a lot of space.

Convert the xfs_getparents_rec structure to use a flex array to store
the dirent name as a null terminated string, which allows us to pack the
information much more densely.  For this to work, augment the
xfs_getparents struct to end with a flex array of buffer offsets to each
xfs_getparents_rec object, much as we do for the attrlist multi ioctl.
Record objects are allocated from the end of the buffer towards the
head.

Reduce the amount of data that we copy to userspace to the head array
containg the offsets, and however much of the buffer's end is used for
the parent records.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2 files changed