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

NAME

6       ioctl_xfs_fsinumbers  -  extract  a list of valid inode numbers from an
7       XFS filesystem
8

SYNOPSIS

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

DESCRIPTION

15       Queries inode allocation information from an  XFS  filesystem.   It  is
16       intended  to  be called iteratively to obtain the entire set of inodes.
17       These ioctls use struct xfs_fsop_bulkreq to set up a bulk transfer with
18       the kernel:
19
20           struct xfs_fsop_bulkreq {
21                __u64   *lastip;
22                __s32   count;
23                void    *ubuffer;
24                __s32   *ocount;
25           };
26
27       lastip  points  to  a  value  that will receive the number of the "last
28       inode."  This should be set to one less than the number  of  the  first
29       inode for which the caller wants information, or zero to start with the
30       first inode in the filesystem.  After the call, this value will be  set
31       to  the  number  of  the  last inode for which information is supplied.
32       This field will not be updated if ocount is NULL.
33
34       count is the number of elements in the ubuffer array and therefore  the
35       number of inode groups for which to return allocation information.
36
37       ocount  points  to  a  value  that  will  receive the number of records
38       returned.  An output value of zero means that there are no  more  inode
39       groups  left  to enumerate.  If this value is NULL, then neither ocount
40       nor lastip will be updated.
41
42       ubuffer points to a memory buffer where inode group information will be
43       copied.   This  buffer  must  be an array of struct xfs_inogrp which is
44       described below.  The array must have at least count elements.
45
46           struct xfs_inogrp {
47                __u64   xi_startino;
48                __s32   xi_alloccount;
49                __u64   xi_allocmask;
50           }
51
52       This structure describes inode usage information for a group of 64 con‐
53       secutive inode numbers.  The fields are as follows:
54
55       xi_startino is the first inode number of this group.
56
57       xi_alloccount is the number of bits that are set in xi_allocmask.  This
58       is the number of inodes allocated in this group.
59
60       xi_allocmask is a bitmask of inodes that are allocated  in  this  inode
61       group.  The bitmask is 64 bits long, and the least significant bit cor‐
62       responds to inode xi_startino.
63

RETURN VALUE

65       On error, -1 is returned, and errno is set to indicate the error.
66

ERRORS

68       Error codes can be one of, but are not limited to, the following:
69
70       EFAULT The kernel was not able to copy into the userspace buffer.
71
72       EFSBADCRC
73              Metadata checksum validation failed while performing the query.
74
75       EFSCORRUPTED
76              Metadata corruption was encountered while performing the query.
77
78       EINVAL One of the arguments was not valid.
79
80       EIO    An I/O error was encountered while performing the query.
81
82       ENOMEM There was insufficient memory to perform the query.
83

CONFORMING TO

85       This API is specific to XFS filesystem on the Linux kernel.
86

SEE ALSO

88       ioctl(2)
89
90
91
92XFS                               2019-06-17           IOCTL-XFS-FSINUMBERS(2)
Impressum