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.
17
18       NOTE: This ioctl has been superseded.  Please see  the  ioctl_xfs_bulk‐
19       stat(2) manpage for information about its replacement.
20
21       These ioctls use struct xfs_fsop_bulkreq to set up a bulk transfer with
22       the kernel:
23
24           struct xfs_fsop_bulkreq {
25                __u64             *lastip;
26                __s32             count;
27                void              *ubuffer;
28                __s32             *ocount;
29           };
30
31       lastip points to a value that will receive  the  number  of  the  "last
32       inode."   This  cannot  be NULL.  For FSBULKSTAT, this should be set to
33       one less than the number of the first inode for which the caller  wants
34       information,  or  zero to start with the first inode in the filesystem.
35       For FSBULKSTAT_SINGLE, this should be set to the number  of  the  inode
36       for  which  the  caller  wants information.  After the call, this value
37       will be set to the number of the last inode for which  information  was
38       supplied.  This field will not be updated if ocount is NULL.
39
40       count  is the number of elements in the ubuffer array and therefore the
41       number of inodes for which to return stat information.  This value must
42       be set to 1 for FSBULKSTAT_SINGLE.
43
44       ocount  points  to  a  value  that  will  receive the number of records
45       returned.  If this value is NULL, then neither ocount nor  lastip  will
46       be updated.
47
48       ubuffer  points  to  a  memory buffer into which inode stat information
49       will be copied.  This buffer must be an array of struct xfs_bstat which
50       is described below.  The array must have at least count elements.
51
52           struct xfs_bstat {
53                __u64             bs_ino;
54                __u16             bs_mode;
55                __u16             bs_nlink;
56                __u32             bs_uid;
57                __u32             bs_gid;
58                __u32             bs_rdev;
59                __s32             bs_blksize;
60                __s64             bs_size;
61                struct xfs_bstime bs_atime;
62                struct xfs_bstime bs_mtime;
63                struct xfs_bstime bs_ctime;
64                int64_t           bs_blocks;
65                __u32             bs_xflags;
66                __s32             bs_extsize;
67                __s32             bs_extents;
68                __u32             bs_gen;
69                __u16             bs_projid_lo;
70                __u16             bs_forkoff;
71                __u16             bs_projid_hi;
72                uint16_t          bs_sick;
73                uint16_t          bs_checked;
74                unsigned char     bs_pad[2];
75                __u32             bs_cowextsize;
76                __u32             bs_dmevmask;
77                __u16             bs_dmstate;
78                __u16             bs_aextents;
79           };
80
81       The structure members are as follows:
82
83       bs_ino is the inode number for this record.
84
85       bs_mode is the file type and mode.
86
87       bs_nlink is the number of hard links to this inode.
88
89       bs_uid is the user id.
90
91       bs_gid is the group id.
92
93       bs_rdev is the encoded device id if this is a special file.
94
95       bs_blksize  is  the  size  of  a  data block for this file, in units of
96       bytes.
97
98       bs_size is the size of the file, in bytes.
99
100       bs_atime is the last time this file was accessed.
101
102       bs_mtime is the last time the contents of this file were modified.
103
104       bs_ctime is the last time this inode record was modified.
105
106       bs_blocks is the number of filesystem blocks allocated  to  this  file,
107       including metadata.
108
109       bs_xflags  contains  the  extended  flags  that  are set on this inode.
110       These flags are the same values as those defined in the XFS INODE FLAGS
111       section of the ioctl_xfs_fsgetxattr(2) manpage.
112
113
114       bs_extsize is the extent size hint for this file, in bytes.
115
116       bs_extents  is  the  number  of  storage  mappings associated with this
117       file's data.
118
119       bs_gen is the generation number of the inode record.
120
121       bs_projid_lo is the lower 16-bits of the project id.
122
123       bs_forkoff is the offset of the attribute fork in the inode record,  in
124       bytes.
125
126       bs_projid_hi is the upper 16-bits of the project id.
127
128       bs_pad[6] is zeroed.
129
130       bs_cowextsize  is  the Copy on Write extent size hint for this file, in
131       bytes.
132
133       bs_dmevmask is unused on Linux.
134
135       bs_dmstate is unused on Linux.
136
137       bs_aextents is the number of  storage  mappings  associated  with  this
138       file's extended attributes.
139
140       The fields bs_sick and bs_checked indicate the relative health of vari‐
141       ous inode metadata:
142
143       · If a given sick flag is set in bs_sick, then that piece  of  metadata
144         has  been  observed  to  be  damaged.   The same bit should be set in
145         bs_checked.
146
147       · If a given sick flag is set in bs_checked but is not set in  bs_sick,
148         then that piece of metadata has been checked and is not faulty.
149
150       · If a given sick flag is not set in bs_checked, then no conclusion can
151         be made.
152
153       The following flags apply to these fields:
154
155           XFS_BS_SICK_INODE
156                  The inode's record itself.
157
158           XFS_BS_SICK_BMBTD
159                  File data extent mappings.
160
161           XFS_BS_SICK_BMBTA
162                  Extended attribute extent mappings.
163
164           XFS_BS_SICK_BMBTC
165                  Copy on Write staging extent mappings.
166
167           XFS_BS_SICK_DIR
168                  Directory information.
169
170           XFS_BS_SICK_XATTR
171                  Extended attribute data.
172
173           XFS_BS_SICK_SYMLINK
174                  Symbolic link target.
175
176           XFS_BS_SICK_PARENT
177                  Parent pointers.
178

RETURN VALUE

180       On error, -1 is returned, and errno is set to indicate the error.
181

ERRORS

183       Error codes can be one of, but are not limited to, the following:
184
185       EFAULT The kernel was not able to copy into the userspace buffer.
186
187       EFSBADCRC
188              Metadata checksum validation failed while performing the query.
189
190       EFSCORRUPTED
191              Metadata corruption was encountered while performing the query.
192
193       EINVAL One of the arguments was not valid.
194
195       EIO    An I/O error was encountered while performing the query.
196
197       ENOMEM There was insufficient memory to perform the query.
198

CONFORMING TO

200       This API is specific to XFS filesystem on the Linux kernel.
201

SEE ALSO

203       ioctl(2), ioctl_xfs_fsgetxattr(2)
204
205
206
207XFS                               2019-06-17           IOCTL-XFS-FSBULKSTAT(2)
Impressum