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

NAME

6       ioctl_xfs_inumbers  -  query  allocation  information for groups of XFS
7       inodes
8

SYNOPSIS

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

DESCRIPTION

15       Query inode allocation information for  groups  of  XFS  inodes.   This
16       ioctl  uses  struct xfs_inumbers_req to set up a bulk transfer from the
17       kernel:
18
19           struct xfs_inumbers_req {
20                struct xfs_bulk_ireq    hdr;
21                struct xfs_inumbers     inumbers[];
22           };
23
24       See below for the xfs_inumbers structure definition.
25
26           struct xfs_bulk_ireq {
27                uint64_t                ino;
28                uint32_t                flags;
29                uint32_t                icount;
30                uint32_t                ocount;
31                uint32_t                agno;
32                uint64_t                reserved[5];
33           };
34
35       hdr describes the information to query.  The layout  and  behavior  are
36       documented  in  the  ioctl_xfs_bulkstat(2) manpage and will not be dis‐
37       cussed further here.
38
39
40       inumbers is an array of struct xfs_inumbers which is  described  below.
41       The array must have at least icount elements.
42
43           struct xfs_inumbers {
44                uint64_t                xi_startino;
45                uint64_t                xi_allocmask;
46                uint8_t                 xi_alloccount;
47                uint8_t                 xi_version;
48                uint8_t                 xi_padding[6];
49           };
50
51       This structure describes inode usage information for a group of 64 con‐
52       secutive inode numbers.
53
54       xi_startino is the first inode number of this group.
55
56       xi_allocmask is a bitmask telling which inodes in this group are  allo‐
57       cated.  To clarify, bit N is set if inode xi_startino+N is allocated.
58
59       xi_alloccount is the number of inodes in this group that are allocated.
60       This should be equal to popcnt(xi_allocmask).
61
62       xi_version is the version of this data structure.  This will be set  to
63       XFS_INUMBERS_VERSION_V5 by the kernel.
64
65       xi_padding[6] is zeroed.
66

RETURN VALUE

68       On error, -1 is returned, and errno is set to indicate the error.
69

ERRORS

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

CONFORMING TO

88       This API is specific to XFS filesystem on the Linux kernel.
89

SEE ALSO

91       ioctl(2), ioctl_xfs_bulkstat(2).
92
93
94
95XFS                               2019-05-23             IOCTL-XFS-INUMBERS(2)
Impressum