1IOCTL-XFS-FSBULKSTAT(2)       System Calls Manual      IOCTL-XFS-FSBULKSTAT(2)
2
3
4

NAME

6       ioctl_xfs_fsbulkstat - query information for a batch of XFS inodes
7

SYNOPSIS

9       #include <xfs/xfs_fs.h>
10
11       int ioctl(int fd, XFS_IOC_FSBULKSTAT, struct xfs_fsop_bulkreq *arg);
12       int  ioctl(int  fd,  XFS_IOC_FSBULKSTAT_SINGLE, struct xfs_fsop_bulkreq
13       *arg);
14

DESCRIPTION

16       Query stat information for a group of XFS  inodes.   These  ioctls  use
17       struct xfs_fsop_bulkreq to set up a bulk transfer with the kernel:
18
19           struct xfs_fsop_bulkreq {
20                __u64             *lastip;
21                __s32             count;
22                void              *ubuffer;
23                __s32             *ocount;
24           };
25
26       lastip  points  to  a  value  that will receive the number of the "last
27       inode."  This cannot be NULL.  For FSBULKSTAT, this should  be  set  to
28       one  less than the number of the first inode for which the caller wants
29       information, or zero to start with the first inode in  the  filesystem.
30       For  FSBULKSTAT_SINGLE,  this  should be set to the number of the inode
31       for which the caller wants information.  After  the  call,  this  value
32       will  be  set to the number of the last inode for which information was
33       supplied.  This field will not be updated if ocount is NULL.
34
35       count is the number of elements in the ubuffer array and therefore  the
36       number of inodes for which to return stat information.  This value must
37       be set to 1 for FSBULKSTAT_SINGLE.
38
39       ocount points to a value  that  will  receive  the  number  of  records
40       returned.   If  this value is NULL, then neither ocount nor lastip will
41       be updated.
42
43       ubuffer points to a memory buffer into  which  inode  stat  information
44       will be copied.  This buffer must be an array of struct xfs_bstat which
45       is described below.  The array must have at least count elements.
46
47           struct xfs_bstat {
48                __u64             bs_ino;
49                __u16             bs_mode;
50                __u16             bs_nlink;
51                __u32             bs_uid;
52                __u32             bs_gid;
53                __u32             bs_rdev;
54                __s32             bs_blksize;
55                __s64             bs_size;
56                struct xfs_bstime bs_atime;
57                struct xfs_bstime bs_mtime;
58                struct xfs_bstime bs_ctime;
59                int64_t           bs_blocks;
60                __u32             bs_xflags;
61                __s32             bs_extsize;
62                __s32             bs_extents;
63                __u32             bs_gen;
64                __u16             bs_projid_lo;
65                __u16             bs_forkoff;
66                __u16             bs_projid_hi;
67                unsigned char     bs_pad[6];
68                __u32             bs_cowextsize;
69                __u32             bs_dmevmask;
70                __u16             bs_dmstate;
71                __u16             bs_aextents;
72           };
73
74       The structure members are as follows:
75
76       bs_ino is the inode number for this record.
77
78       bs_mode is the file type and mode.
79
80       bs_nlink is the number of hard links to this inode.
81
82       bs_uid is the user id.
83
84       bs_gid is the group id.
85
86       bs_rdev is the encoded device id if this is a special file.
87
88       bs_blksize is the size of a data block  for  this  file,  in  units  of
89       bytes.
90
91       bs_size is the size of the file, in bytes.
92
93       bs_atime is the last time this file was accessed.
94
95       bs_mtime is the last time the contents of this file were modified.
96
97       bs_ctime is the last time this inode record was modified.
98
99       bs_blocks  is  the  number of filesystem blocks allocated to this file,
100       including metadata.
101
102       bs_xflags contains the extended flags  that  are  set  on  this  inode.
103       These flags are the same values as those defined in the XFS INODE FLAGS
104       section of the ioctl_xfs_fsgetxattr(2) manpage.
105
106
107       bs_extsize is the extent size hint for this file, in bytes.
108
109       bs_extents is the number  of  storage  mappings  associated  with  this
110       file's data.
111
112       bs_gen is the generation number of the inode record.
113
114       bs_projid_lo is the lower 16-bits of the project id.
115
116       bs_forkoff  is the offset of the attribute fork in the inode record, in
117       bytes.
118
119       bs_projid_hi is the upper 16-bits of the project id.
120
121       bs_pad[6] is zeroed.
122
123       bs_cowextsize is the Copy on Write extent size hint for this  file,  in
124       bytes.
125
126       bs_dmevmask is unused on Linux.
127
128       bs_dmstate is unused on Linux.
129
130       bs_aextents  is  the  number  of  storage mappings associated with this
131       file's extended attributes.
132

RETURN VALUE

134       On error, -1 is returned, and errno is set to indicate the error.
135

ERRORS

137       Error codes can be one of, but are not limited to, the following:
138
139       EFAULT The kernel was not able to copy into the userspace buffer.
140
141       EFSBADCRC
142              Metadata checksum validation failed while performing the query.
143
144       EFSCORRUPTED
145              Metadata corruption was encountered while performing the query.
146
147       EINVAL One of the arguments was not valid.
148
149       EIO    An I/O error was encountered while performing the query.
150
151       ENOMEM There was insufficient memory to perform the query.
152

CONFORMING TO

154       This API is specific to XFS filesystem on the Linux kernel.
155

SEE ALSO

157       ioctl(2), ioctl_xfs_fsgetxattr(2)
158
159
160
161XFS                               2019-06-17           IOCTL-XFS-FSBULKSTAT(2)
Impressum