Content-type: text/html; charset=UTF-8
Man page of IOCTL-XFS-FSBULKSTAT
IOCTL-XFS-FSBULKSTAT
Section: System Calls (2)
Updated: 2019-04-11
Index
Return to Main Contents
NAME
ioctl_xfs_fsbulkstat - query information for a batch of XFS inodes
SYNOPSIS
#include <xfs/xfs_fs.h>
int ioctl(int dest_fd, XFS_IOC_FSBULKSTAT, struct xfs_fsop_bulkreq *arg);
DESCRIPTION
Query stat information for a bunch of XFS inodes.
This ioctl uses
struct xfs_fsop_bulkreq
to set up a bulk transfer with the kernel:
struct xfs_fsop_bulkreq {
__u64 *lastip;
__s32 count;
void *ubuffer;
__s32 *ocount;
} xfs_fsop_bulkreq_t;
lastip
points to a value that will receive the number of the "last inode".
Prior to the call, this value should be set to one less than the number of the
first inode for which the caller wants information.
After the call, this value will be set to the number of the last inode for
which information is supplied.
count
is the number of inodes to examine.
ocount
points to a value that will receive the number of records returned.
ubuffer
points to a memory buffer where information will be copied.
This buffer must be an array of
struct xfs_bstat
which is described below:
struct xfs_bstat {
__u64 bs_ino;
__u16 bs_mode;
__u16 bs_nlink;
__u32 bs_uid;
__u32 bs_gid;
__u32 bs_rdev;
__s32 bs_blksize;
__s64 bs_size;
struct xfs_bstime bs_atime;
struct xfs_bstime bs_mtime;
struct xfs_bstime bs_ctime;
int64_t bs_blocks;
__u32 bs_xflags;
__s32 bs_extsize;
__s32 bs_extents;
__u32 bs_gen;
__u16 bs_projid_lo;
__u16 bs_forkoff;
__u16 bs_projid_hi;
uint16_t bs_sick;
uint16_t bs_checked;
unsigned char bs_pad[2];
__u32 bs_cowextsize;
__u32 bs_dmevmask;
__u16 bs_dmstate;
__u16 bs_aextents;
};
bs_ino
is the number of this inode record.
bs_mode
is the file type and mode.
bs_nlink
is the number of hard links to this inode.
bs_uid
is the user id.
bs_gid
is the group id.
bs_rdev
is the encoded device id if this is a special file.
bs_blksize
is the size of a data block for this file, in units of bytes.
bs_size
is the size of the file, in bytes.
bs_atime
is the last time this file was accessed.
bs_mtime
is the last time the contents of this file were modified.
bs_ctime
is the last time this inode record was modified.
bs_blocks
is the number of filesystem blocks allocated to this file, including metadata.
bs_xflags
tell us what features are enabled for this inode.
This field can be any combination of the following:
-
- FS_XFLAG_REALTIME
-
File data is stored on the realtime device.
- FS_XFLAG_PREALLOC
-
File has post-EOF space preallocated for data.
- FS_XFLAG_IMMUTABLE
-
File data and inode record cannot be modified.
- FS_XFLAG_APPEND
-
File only permits appending writes.
- FS_XFLAG_SYNC
-
All data writes are synchronous.
- FS_XFLAG_NOATIME
-
Do not update access time.
- FS_XFLAG_NODUMP
-
Do not back up this file.
- FS_XFLAG_RTINHERIT
-
Files created in this directory will default to the realtime device.
- FS_XFLAG_PROJINHERIT
-
Files created in this directory will inherit the directory's project id.
- FS_XFLAG_NOSYMLINKS
-
Do not allow symbolic links to be created in this directory.
- FS_XFLAG_EXTSIZE
-
This file has an extent size hint set.
- FS_XFLAG_EXTSZINHERIT
-
Files created in this directory will inherit the directory's extent size hint.
- FS_XFLAG_NODEFRAG
-
Do not defragment this file.
- FS_XFLAG_FILESTREAM
-
Use the filestream allocator for data blocks.
- FS_XFLAG_DAX
-
Use DAX for file access if the filesystem is stored on persistent memory.
- FS_XFLAG_COWEXTSIZE
-
If this is a file, then the Copy on Write extent size is set.
If this is a directory, then files created in the directory will inherit the
directory's Copy on Write extent size hint.
- FS_XFLAG_HASATTR
-
File has extended attributes.
bs_extsize
is the extent size hint for this file, in bytes.
bs_extents
is the number of storage space extents associated with this file's data.
bs_gen
is the generation number of the inode record.
bs_projid_lo
is the lower 16-bits of the project id.
bs_forkoff
is the offset of the attribute fork in the inode record, in bytes.
bs_projid_hi
is the upper 16-bits of the project id.
bs_pad[6]
is zeroed.
bs_cowextsize
is the Copy on Write extent size hint for this file, in bytes.
bs_dmevmask
is unused on Linux.
bs_dmstate
is unused on Linux.
bs_aextents
is the number of storage space extents associated with this file's extended
attributes.
The fields
bs_sick and bs_checked
indicate the relative health of various allocation group metadata:
- •
-
If a given sick flag is set in
bs_sick,
then that piece of metadata has been observed to be damaged.
The same bit should be set in
bs_checked.
- •
-
If a given sick flag is set in
bs_checked
but is not set in
bs_sick,
then that piece of metadata has been checked and is not faulty.
- •
-
If a given sick flag is not set in
bs_checked,
then no conclusion can be made.
The following flags apply to these fields:
-
- XFS_BS_SICK_INODE
-
The inode's record itself.
- XFS_BS_SICK_BMBTD
-
File data extent mappings.
- XFS_BS_SICK_BMBTA
-
Extended attribute extent mappings.
- XFS_BS_SICK_BMBTC
-
Copy on Write staging extent mappings.
- XFS_BS_SICK_DIR
-
Directory information.
- XFS_BS_SICK_XATTR
-
Extended attribute data.
- XFS_BS_SICK_SYMLINK
-
Symbolic link target.
- XFS_BS_SICK_PARENT
-
Parent pointers.
RETURN VALUE
On error, -1 is returned, and
errno
is set to indicate the error.
ERRORS
Error 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 TO
This API is specific to XFS filesystem on the Linux kernel.
SEE ALSO
ioctl(2)
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- RETURN VALUE
-
- ERRORS
-
- CONFORMING TO
-
- SEE ALSO
-
This document was created by
man2html,
using the manual pages.
Time: 14:54:29 GMT, April 11, 2019