IOCTL-XFS-GETBMAPX - Online Linux Manual PageSection : 2
Updated : 2019-06-17
Source : XFS

NAMEioctl_xfs_getbmapx − query extent information for an open file

SYNOPSIS
#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);

DESCRIPTIONGet 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: bmv_offset  The file offset of the area of interest in the file. bmv_length  The length of the area of interest in the file. If this value is set to -1, the length of the interesting area is the rest of the file. bmv_count  The number of elements in the array, including this header. The minimum value is 2. bmv_entries  The number of entries actually filled in by the call. This does not need to be filled out before the call. This value may be zero if no extents were found in the requested range, or if iterated calls have reached the end of the requested range. bmv_iflags  For the XFS_IOC_GETBMAPX function, this is a bitmask containing a combination of the following flags: BMV_IF_ATTRFORK  Return information about the extended attribute fork. BMV_IF_PREALLOC  Return information about unwritten pre-allocated segments. BMV_IF_DELALLOC  Return information about delayed allocation reservation segments. BMV_IF_NO_HOLES  Do not return information about holes. 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: bmv_offset  File offset of segment. bmv_block  Physical starting block of segment. If this is -1, then the segment is a hole. bmv_length  Length of segment. bmv_oflags  The XFS_IOC_GETBMAPX function will fill this field with a combination of the following flags: BMV_OF_PREALLOC  The segment is an unwritten pre-allocation. BMV_OF_DELALLOC  The segment is a delayed allocation reservation. BMV_OF_LAST  This segment is the last in the file. BMV_OF_SHARED  This segment shares blocks with other files. 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.

RETURN VALUEOn error, −1 is returned, and errno is set to indicate the error.

ERRORSError codes can be one of, but are not limited to, the following: EFAULT  The kernel was not able to copy into the userspace buffer. EFSBADCRC  Metadata checksum validation failed while performing the query. EFSCORRUPTED  Metadata corruption was encountered while performing the query. EINVAL  One of the arguments was not valid. EIO  An I/O error was encountered while performing the query. ENOMEM  There was insufficient memory to perform the query.

CONFORMING TOThis API is specific to XFS filesystem on the Linux kernel.

SEE ALSOioctl(2)
0
Johanes Gumabo
Data Size   :   13,185 byte
man-ioctl_xfs_getbmapx.2Build   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   3 / 181,113
Visitor ID   :     :  
Visitor IP   :   3.149.244.92   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.