IOCTL-XFS-GETBMAPX(2) | System Calls Manual | IOCTL-XFS-GETBMAPX(2) |
ioctl_xfs_getbmapx - query extent information for an open file
#include <xfs/xfs_fs.h>
int ioctl(int fd, XFS_IOC_GETBMAP, struct getbmap
*arg);
int ioctl(int fd, XFS_IOC_GETBMAPA, struct getbmap
*arg);
int ioctl(int fd, XFS_IOC_GETBMAPX, struct getbmapx
*arg);
Get the block map for a segment of a file in an XFS file system. The mapping information is conveyed via an array of structures of the following form:
struct getbmap { __s64 bmv_offset; __s64 bmv_block; __s64 bmv_length; __s32 bmv_count; __s32 bmv_entries; };
The XFS_IOC_GETBMAPX ioctl uses a larger version of that structure:
struct getbmapx { __s64 bmv_offset; __s64 bmv_block; __s64 bmv_length; __s32 bmv_count; __s32 bmv_entries; __s32 bmv_iflags; __s32 bmv_oflags; __s32 bmv_unused1; __s32 bmv_unused2; };
All sizes and offsets in the structure are in units of 512 bytes.
The first structure in the array is a header and the remaining structures in the array contain block map information on return. The header controls iterative calls to the command and should be filled out as follows:
The other bmv_* fields in the header are ignored.
On successful return from a call, the offset and length values in the header are updated so that the command can be reused to obtain more information. The remaining elements of the array will be filled out by the call as follows:
The other bmv_* fields are unused in the array of output records.
The XFS_IOC_GETBMAPA command is identical to XFS_IOC_GETBMAP except that information about the attribute fork of the file is returned.
On error, -1 is returned, and errno is set to indicate the error.
Error codes can be one of, but are not limited to, the following:
This API is specific to XFS filesystem on the Linux kernel.
2019-06-17 | XFS |