| 1 |
.\" Copyright (c) 2019, Oracle. All rights reserved. |
| 2 |
.\" |
| 3 |
.\" %%%LICENSE_START(GPLv2+_DOC_FULL) |
| 4 |
.\" SPDX-License-Identifier: GPL-2.0+ |
| 5 |
.\" %%%LICENSE_END |
| 6 |
.TH IOCTL-XFS-FSCOUNTS 2 2019-06-17 "XFS" |
| 7 |
.SH NAME |
| 8 |
ioctl_xfs_fscounts \- query XFS summary counter information |
| 9 |
.SH SYNOPSIS |
| 10 |
.br |
| 11 |
.B #include <xfs/xfs_fs.h> |
| 12 |
.PP |
| 13 |
.BI "int ioctl(int " fd ", XFS_IOC_FSCOUNTS, struct xfs_fsop_counts *" arg ); |
| 14 |
.SH DESCRIPTION |
| 15 |
Query the raw filesystem summary counters. |
| 16 |
Unlike |
| 17 |
.BR statvfs (3), |
| 18 |
the values returned here are the raw values, which do not reflect any |
| 19 |
alterations or limits set by project quotas. |
| 20 |
The counter information is conveyed in a structure of the following form: |
| 21 |
.PP |
| 22 |
.in +4n |
| 23 |
.nf |
| 24 |
struct xfs_fsop_counts { |
| 25 |
__u64 freedata; |
| 26 |
__u64 freertx; |
| 27 |
__u64 freeino; |
| 28 |
__u64 allocino; |
| 29 |
}; |
| 30 |
.fi |
| 31 |
.in |
| 32 |
.PP |
| 33 |
The fields of this structure are as follows: |
| 34 |
.PP |
| 35 |
.I freedata |
| 36 |
is the number of free filesystem blocks on the data device. |
| 37 |
.PP |
| 38 |
.I freertx |
| 39 |
is the number of free extents on the realtime device. |
| 40 |
.PP |
| 41 |
.I freeino |
| 42 |
is the number of inode records that are not in use within the space that has |
| 43 |
been allocated for them. |
| 44 |
.PP |
| 45 |
.I allocino |
| 46 |
is the number of inode records for which space has been allocated. |
| 47 |
.SH RETURN VALUE |
| 48 |
On error, \-1 is returned, and |
| 49 |
.I errno |
| 50 |
is set to indicate the error. |
| 51 |
.PP |
| 52 |
.SH ERRORS |
| 53 |
Error codes can be one of, but are not limited to, the following: |
| 54 |
.TP |
| 55 |
.B EFSBADCRC |
| 56 |
Metadata checksum validation failed while performing the query. |
| 57 |
.TP |
| 58 |
.B EFSCORRUPTED |
| 59 |
Metadata corruption was encountered while performing the query. |
| 60 |
.TP |
| 61 |
.B EINVAL |
| 62 |
The specified allocation group number is not valid for this filesystem. |
| 63 |
.TP |
| 64 |
.B EIO |
| 65 |
An I/O error was encountered while performing the query. |
| 66 |
.SH CONFORMING TO |
| 67 |
This API is specific to XFS filesystem on the Linux kernel. |
| 68 |
.SH SEE ALSO |
| 69 |
.BR ioctl (2) |