.. | .. |
---|
1 | | -// SPDX-License-Identifier: LGPL-2.1 |
---|
| 1 | +/* SPDX-License-Identifier: LGPL-2.1 */ |
---|
2 | 2 | /* |
---|
3 | 3 | * Copyright (c) 1995-2005 Silicon Graphics, Inc. |
---|
4 | 4 | * All Rights Reserved. |
---|
.. | .. |
---|
97 | 97 | * For use by backup and restore programs to set the XFS on-disk inode |
---|
98 | 98 | * fields di_dmevmask and di_dmstate. These must be set to exactly and |
---|
99 | 99 | * only values previously obtained via xfs_bulkstat! (Specifically the |
---|
100 | | - * xfs_bstat_t fields bs_dmevmask and bs_dmstate.) |
---|
| 100 | + * struct xfs_bstat fields bs_dmevmask and bs_dmstate.) |
---|
101 | 101 | */ |
---|
102 | 102 | #ifndef HAVE_FSDMIDATA |
---|
103 | 103 | struct fsdmidata { |
---|
.. | .. |
---|
124 | 124 | /* |
---|
125 | 125 | * Output for XFS_IOC_FSGEOMETRY_V1 |
---|
126 | 126 | */ |
---|
127 | | -typedef struct xfs_fsop_geom_v1 { |
---|
| 127 | +struct xfs_fsop_geom_v1 { |
---|
128 | 128 | __u32 blocksize; /* filesystem (data) block size */ |
---|
129 | 129 | __u32 rtextsize; /* realtime extent size */ |
---|
130 | 130 | __u32 agblocks; /* fsblocks in an AG */ |
---|
.. | .. |
---|
145 | 145 | __u32 logsectsize; /* log sector size, bytes */ |
---|
146 | 146 | __u32 rtsectsize; /* realtime sector size, bytes */ |
---|
147 | 147 | __u32 dirblocksize; /* directory block size, bytes */ |
---|
148 | | -} xfs_fsop_geom_v1_t; |
---|
| 148 | +}; |
---|
| 149 | + |
---|
| 150 | +/* |
---|
| 151 | + * Output for XFS_IOC_FSGEOMETRY_V4 |
---|
| 152 | + */ |
---|
| 153 | +struct xfs_fsop_geom_v4 { |
---|
| 154 | + __u32 blocksize; /* filesystem (data) block size */ |
---|
| 155 | + __u32 rtextsize; /* realtime extent size */ |
---|
| 156 | + __u32 agblocks; /* fsblocks in an AG */ |
---|
| 157 | + __u32 agcount; /* number of allocation groups */ |
---|
| 158 | + __u32 logblocks; /* fsblocks in the log */ |
---|
| 159 | + __u32 sectsize; /* (data) sector size, bytes */ |
---|
| 160 | + __u32 inodesize; /* inode size in bytes */ |
---|
| 161 | + __u32 imaxpct; /* max allowed inode space(%) */ |
---|
| 162 | + __u64 datablocks; /* fsblocks in data subvolume */ |
---|
| 163 | + __u64 rtblocks; /* fsblocks in realtime subvol */ |
---|
| 164 | + __u64 rtextents; /* rt extents in realtime subvol*/ |
---|
| 165 | + __u64 logstart; /* starting fsblock of the log */ |
---|
| 166 | + unsigned char uuid[16]; /* unique id of the filesystem */ |
---|
| 167 | + __u32 sunit; /* stripe unit, fsblocks */ |
---|
| 168 | + __u32 swidth; /* stripe width, fsblocks */ |
---|
| 169 | + __s32 version; /* structure version */ |
---|
| 170 | + __u32 flags; /* superblock version flags */ |
---|
| 171 | + __u32 logsectsize; /* log sector size, bytes */ |
---|
| 172 | + __u32 rtsectsize; /* realtime sector size, bytes */ |
---|
| 173 | + __u32 dirblocksize; /* directory block size, bytes */ |
---|
| 174 | + __u32 logsunit; /* log stripe unit, bytes */ |
---|
| 175 | +}; |
---|
149 | 176 | |
---|
150 | 177 | /* |
---|
151 | 178 | * Output for XFS_IOC_FSGEOMETRY |
---|
152 | 179 | */ |
---|
153 | | -typedef struct xfs_fsop_geom { |
---|
| 180 | +struct xfs_fsop_geom { |
---|
154 | 181 | __u32 blocksize; /* filesystem (data) block size */ |
---|
155 | 182 | __u32 rtextsize; /* realtime extent size */ |
---|
156 | 183 | __u32 agblocks; /* fsblocks in an AG */ |
---|
.. | .. |
---|
171 | 198 | __u32 logsectsize; /* log sector size, bytes */ |
---|
172 | 199 | __u32 rtsectsize; /* realtime sector size, bytes */ |
---|
173 | 200 | __u32 dirblocksize; /* directory block size, bytes */ |
---|
174 | | - __u32 logsunit; /* log stripe unit, bytes */ |
---|
175 | | -} xfs_fsop_geom_t; |
---|
| 201 | + __u32 logsunit; /* log stripe unit, bytes */ |
---|
| 202 | + uint32_t sick; /* o: unhealthy fs & rt metadata */ |
---|
| 203 | + uint32_t checked; /* o: checked fs & rt metadata */ |
---|
| 204 | + __u64 reserved[17]; /* reserved space */ |
---|
| 205 | +}; |
---|
| 206 | + |
---|
| 207 | +#define XFS_FSOP_GEOM_SICK_COUNTERS (1 << 0) /* summary counters */ |
---|
| 208 | +#define XFS_FSOP_GEOM_SICK_UQUOTA (1 << 1) /* user quota */ |
---|
| 209 | +#define XFS_FSOP_GEOM_SICK_GQUOTA (1 << 2) /* group quota */ |
---|
| 210 | +#define XFS_FSOP_GEOM_SICK_PQUOTA (1 << 3) /* project quota */ |
---|
| 211 | +#define XFS_FSOP_GEOM_SICK_RT_BITMAP (1 << 4) /* realtime bitmap */ |
---|
| 212 | +#define XFS_FSOP_GEOM_SICK_RT_SUMMARY (1 << 5) /* realtime summary */ |
---|
176 | 213 | |
---|
177 | 214 | /* Output for XFS_FS_COUNTS */ |
---|
178 | 215 | typedef struct xfs_fsop_counts { |
---|
.. | .. |
---|
188 | 225 | __u64 resblks_avail; |
---|
189 | 226 | } xfs_fsop_resblks_t; |
---|
190 | 227 | |
---|
191 | | -#define XFS_FSOP_GEOM_VERSION 0 |
---|
| 228 | +#define XFS_FSOP_GEOM_VERSION 0 |
---|
| 229 | +#define XFS_FSOP_GEOM_VERSION_V5 5 |
---|
192 | 230 | |
---|
193 | | -#define XFS_FSOP_GEOM_FLAGS_ATTR 0x0001 /* attributes in use */ |
---|
194 | | -#define XFS_FSOP_GEOM_FLAGS_NLINK 0x0002 /* 32-bit nlink values */ |
---|
195 | | -#define XFS_FSOP_GEOM_FLAGS_QUOTA 0x0004 /* quotas enabled */ |
---|
196 | | -#define XFS_FSOP_GEOM_FLAGS_IALIGN 0x0008 /* inode alignment */ |
---|
197 | | -#define XFS_FSOP_GEOM_FLAGS_DALIGN 0x0010 /* large data alignment */ |
---|
198 | | -#define XFS_FSOP_GEOM_FLAGS_SHARED 0x0020 /* read-only shared */ |
---|
199 | | -#define XFS_FSOP_GEOM_FLAGS_EXTFLG 0x0040 /* special extent flag */ |
---|
200 | | -#define XFS_FSOP_GEOM_FLAGS_DIRV2 0x0080 /* directory version 2 */ |
---|
201 | | -#define XFS_FSOP_GEOM_FLAGS_LOGV2 0x0100 /* log format version 2 */ |
---|
202 | | -#define XFS_FSOP_GEOM_FLAGS_SECTOR 0x0200 /* sector sizes >1BB */ |
---|
203 | | -#define XFS_FSOP_GEOM_FLAGS_ATTR2 0x0400 /* inline attributes rework */ |
---|
204 | | -#define XFS_FSOP_GEOM_FLAGS_PROJID32 0x0800 /* 32-bit project IDs */ |
---|
205 | | -#define XFS_FSOP_GEOM_FLAGS_DIRV2CI 0x1000 /* ASCII only CI names */ |
---|
206 | | -#define XFS_FSOP_GEOM_FLAGS_LAZYSB 0x4000 /* lazy superblock counters */ |
---|
207 | | -#define XFS_FSOP_GEOM_FLAGS_V5SB 0x8000 /* version 5 superblock */ |
---|
208 | | -#define XFS_FSOP_GEOM_FLAGS_FTYPE 0x10000 /* inode directory types */ |
---|
209 | | -#define XFS_FSOP_GEOM_FLAGS_FINOBT 0x20000 /* free inode btree */ |
---|
210 | | -#define XFS_FSOP_GEOM_FLAGS_SPINODES 0x40000 /* sparse inode chunks */ |
---|
211 | | -#define XFS_FSOP_GEOM_FLAGS_RMAPBT 0x80000 /* reverse mapping btree */ |
---|
212 | | -#define XFS_FSOP_GEOM_FLAGS_REFLINK 0x100000 /* files can share blocks */ |
---|
| 231 | +#define XFS_FSOP_GEOM_FLAGS_ATTR (1 << 0) /* attributes in use */ |
---|
| 232 | +#define XFS_FSOP_GEOM_FLAGS_NLINK (1 << 1) /* 32-bit nlink values */ |
---|
| 233 | +#define XFS_FSOP_GEOM_FLAGS_QUOTA (1 << 2) /* quotas enabled */ |
---|
| 234 | +#define XFS_FSOP_GEOM_FLAGS_IALIGN (1 << 3) /* inode alignment */ |
---|
| 235 | +#define XFS_FSOP_GEOM_FLAGS_DALIGN (1 << 4) /* large data alignment */ |
---|
| 236 | +#define XFS_FSOP_GEOM_FLAGS_SHARED (1 << 5) /* read-only shared */ |
---|
| 237 | +#define XFS_FSOP_GEOM_FLAGS_EXTFLG (1 << 6) /* special extent flag */ |
---|
| 238 | +#define XFS_FSOP_GEOM_FLAGS_DIRV2 (1 << 7) /* directory version 2 */ |
---|
| 239 | +#define XFS_FSOP_GEOM_FLAGS_LOGV2 (1 << 8) /* log format version 2 */ |
---|
| 240 | +#define XFS_FSOP_GEOM_FLAGS_SECTOR (1 << 9) /* sector sizes >1BB */ |
---|
| 241 | +#define XFS_FSOP_GEOM_FLAGS_ATTR2 (1 << 10) /* inline attributes rework */ |
---|
| 242 | +#define XFS_FSOP_GEOM_FLAGS_PROJID32 (1 << 11) /* 32-bit project IDs */ |
---|
| 243 | +#define XFS_FSOP_GEOM_FLAGS_DIRV2CI (1 << 12) /* ASCII only CI names */ |
---|
| 244 | + /* -- Do not use -- (1 << 13) SGI parent pointers */ |
---|
| 245 | +#define XFS_FSOP_GEOM_FLAGS_LAZYSB (1 << 14) /* lazy superblock counters */ |
---|
| 246 | +#define XFS_FSOP_GEOM_FLAGS_V5SB (1 << 15) /* version 5 superblock */ |
---|
| 247 | +#define XFS_FSOP_GEOM_FLAGS_FTYPE (1 << 16) /* inode directory types */ |
---|
| 248 | +#define XFS_FSOP_GEOM_FLAGS_FINOBT (1 << 17) /* free inode btree */ |
---|
| 249 | +#define XFS_FSOP_GEOM_FLAGS_SPINODES (1 << 18) /* sparse inode chunks */ |
---|
| 250 | +#define XFS_FSOP_GEOM_FLAGS_RMAPBT (1 << 19) /* reverse mapping btree */ |
---|
| 251 | +#define XFS_FSOP_GEOM_FLAGS_REFLINK (1 << 20) /* files can share blocks */ |
---|
| 252 | +#define XFS_FSOP_GEOM_FLAGS_BIGTIME (1 << 21) /* 64-bit nsec timestamps */ |
---|
213 | 253 | |
---|
214 | 254 | /* |
---|
215 | 255 | * Minimum and maximum sizes need for growth checks. |
---|
.. | .. |
---|
238 | 278 | (s)->sb_agblocks + XFS_MIN_AG_BLOCKS) |
---|
239 | 279 | |
---|
240 | 280 | /* |
---|
| 281 | + * Output for XFS_IOC_AG_GEOMETRY |
---|
| 282 | + */ |
---|
| 283 | +struct xfs_ag_geometry { |
---|
| 284 | + uint32_t ag_number; /* i/o: AG number */ |
---|
| 285 | + uint32_t ag_length; /* o: length in blocks */ |
---|
| 286 | + uint32_t ag_freeblks; /* o: free space */ |
---|
| 287 | + uint32_t ag_icount; /* o: inodes allocated */ |
---|
| 288 | + uint32_t ag_ifree; /* o: inodes free */ |
---|
| 289 | + uint32_t ag_sick; /* o: sick things in ag */ |
---|
| 290 | + uint32_t ag_checked; /* o: checked metadata in ag */ |
---|
| 291 | + uint32_t ag_flags; /* i/o: flags for this ag */ |
---|
| 292 | + uint64_t ag_reserved[12];/* o: zero */ |
---|
| 293 | +}; |
---|
| 294 | +#define XFS_AG_GEOM_SICK_SB (1 << 0) /* superblock */ |
---|
| 295 | +#define XFS_AG_GEOM_SICK_AGF (1 << 1) /* AGF header */ |
---|
| 296 | +#define XFS_AG_GEOM_SICK_AGFL (1 << 2) /* AGFL header */ |
---|
| 297 | +#define XFS_AG_GEOM_SICK_AGI (1 << 3) /* AGI header */ |
---|
| 298 | +#define XFS_AG_GEOM_SICK_BNOBT (1 << 4) /* free space by block */ |
---|
| 299 | +#define XFS_AG_GEOM_SICK_CNTBT (1 << 5) /* free space by length */ |
---|
| 300 | +#define XFS_AG_GEOM_SICK_INOBT (1 << 6) /* inode index */ |
---|
| 301 | +#define XFS_AG_GEOM_SICK_FINOBT (1 << 7) /* free inode index */ |
---|
| 302 | +#define XFS_AG_GEOM_SICK_RMAPBT (1 << 8) /* reverse mappings */ |
---|
| 303 | +#define XFS_AG_GEOM_SICK_REFCNTBT (1 << 9) /* reference counts */ |
---|
| 304 | + |
---|
| 305 | +/* |
---|
241 | 306 | * Structures for XFS_IOC_FSGROWFSDATA, XFS_IOC_FSGROWFSLOG & XFS_IOC_FSGROWFSRT |
---|
242 | 307 | */ |
---|
243 | 308 | typedef struct xfs_growfs_data { |
---|
.. | .. |
---|
260 | 325 | * Structures returned from ioctl XFS_IOC_FSBULKSTAT & XFS_IOC_FSBULKSTAT_SINGLE |
---|
261 | 326 | */ |
---|
262 | 327 | typedef struct xfs_bstime { |
---|
263 | | - time_t tv_sec; /* seconds */ |
---|
| 328 | + __kernel_long_t tv_sec; /* seconds */ |
---|
264 | 329 | __s32 tv_nsec; /* and nanoseconds */ |
---|
265 | 330 | } xfs_bstime_t; |
---|
266 | 331 | |
---|
267 | | -typedef struct xfs_bstat { |
---|
| 332 | +struct xfs_bstat { |
---|
268 | 333 | __u64 bs_ino; /* inode number */ |
---|
269 | 334 | __u16 bs_mode; /* type and mode */ |
---|
270 | 335 | __u16 bs_nlink; /* number of links */ |
---|
.. | .. |
---|
285 | 350 | #define bs_projid bs_projid_lo /* (previously just bs_projid) */ |
---|
286 | 351 | __u16 bs_forkoff; /* inode fork offset in bytes */ |
---|
287 | 352 | __u16 bs_projid_hi; /* higher part of project id */ |
---|
288 | | - unsigned char bs_pad[6]; /* pad space, unused */ |
---|
| 353 | + uint16_t bs_sick; /* sick inode metadata */ |
---|
| 354 | + uint16_t bs_checked; /* checked inode metadata */ |
---|
| 355 | + unsigned char bs_pad[2]; /* pad space, unused */ |
---|
289 | 356 | __u32 bs_cowextsize; /* cow extent size */ |
---|
290 | 357 | __u32 bs_dmevmask; /* DMIG event mask */ |
---|
291 | 358 | __u16 bs_dmstate; /* DMIG state info */ |
---|
292 | 359 | __u16 bs_aextents; /* attribute number of extents */ |
---|
293 | | -} xfs_bstat_t; |
---|
| 360 | +}; |
---|
| 361 | + |
---|
| 362 | +/* New bulkstat structure that reports v5 features and fixes padding issues */ |
---|
| 363 | +struct xfs_bulkstat { |
---|
| 364 | + uint64_t bs_ino; /* inode number */ |
---|
| 365 | + uint64_t bs_size; /* file size */ |
---|
| 366 | + |
---|
| 367 | + uint64_t bs_blocks; /* number of blocks */ |
---|
| 368 | + uint64_t bs_xflags; /* extended flags */ |
---|
| 369 | + |
---|
| 370 | + int64_t bs_atime; /* access time, seconds */ |
---|
| 371 | + int64_t bs_mtime; /* modify time, seconds */ |
---|
| 372 | + |
---|
| 373 | + int64_t bs_ctime; /* inode change time, seconds */ |
---|
| 374 | + int64_t bs_btime; /* creation time, seconds */ |
---|
| 375 | + |
---|
| 376 | + uint32_t bs_gen; /* generation count */ |
---|
| 377 | + uint32_t bs_uid; /* user id */ |
---|
| 378 | + uint32_t bs_gid; /* group id */ |
---|
| 379 | + uint32_t bs_projectid; /* project id */ |
---|
| 380 | + |
---|
| 381 | + uint32_t bs_atime_nsec; /* access time, nanoseconds */ |
---|
| 382 | + uint32_t bs_mtime_nsec; /* modify time, nanoseconds */ |
---|
| 383 | + uint32_t bs_ctime_nsec; /* inode change time, nanoseconds */ |
---|
| 384 | + uint32_t bs_btime_nsec; /* creation time, nanoseconds */ |
---|
| 385 | + |
---|
| 386 | + uint32_t bs_blksize; /* block size */ |
---|
| 387 | + uint32_t bs_rdev; /* device value */ |
---|
| 388 | + uint32_t bs_cowextsize_blks; /* cow extent size hint, blocks */ |
---|
| 389 | + uint32_t bs_extsize_blks; /* extent size hint, blocks */ |
---|
| 390 | + |
---|
| 391 | + uint32_t bs_nlink; /* number of links */ |
---|
| 392 | + uint32_t bs_extents; /* number of extents */ |
---|
| 393 | + uint32_t bs_aextents; /* attribute number of extents */ |
---|
| 394 | + uint16_t bs_version; /* structure version */ |
---|
| 395 | + uint16_t bs_forkoff; /* inode fork offset in bytes */ |
---|
| 396 | + |
---|
| 397 | + uint16_t bs_sick; /* sick inode metadata */ |
---|
| 398 | + uint16_t bs_checked; /* checked inode metadata */ |
---|
| 399 | + uint16_t bs_mode; /* type and mode */ |
---|
| 400 | + uint16_t bs_pad2; /* zeroed */ |
---|
| 401 | + |
---|
| 402 | + uint64_t bs_pad[7]; /* zeroed */ |
---|
| 403 | +}; |
---|
| 404 | + |
---|
| 405 | +#define XFS_BULKSTAT_VERSION_V1 (1) |
---|
| 406 | +#define XFS_BULKSTAT_VERSION_V5 (5) |
---|
| 407 | + |
---|
| 408 | +/* bs_sick flags */ |
---|
| 409 | +#define XFS_BS_SICK_INODE (1 << 0) /* inode core */ |
---|
| 410 | +#define XFS_BS_SICK_BMBTD (1 << 1) /* data fork */ |
---|
| 411 | +#define XFS_BS_SICK_BMBTA (1 << 2) /* attr fork */ |
---|
| 412 | +#define XFS_BS_SICK_BMBTC (1 << 3) /* cow fork */ |
---|
| 413 | +#define XFS_BS_SICK_DIR (1 << 4) /* directory */ |
---|
| 414 | +#define XFS_BS_SICK_XATTR (1 << 5) /* extended attributes */ |
---|
| 415 | +#define XFS_BS_SICK_SYMLINK (1 << 6) /* symbolic link remote target */ |
---|
| 416 | +#define XFS_BS_SICK_PARENT (1 << 7) /* parent pointers */ |
---|
294 | 417 | |
---|
295 | 418 | /* |
---|
296 | 419 | * Project quota id helpers (previously projid was 16bit only |
---|
297 | | - * and using two 16bit values to hold new 32bit projid was choosen |
---|
| 420 | + * and using two 16bit values to hold new 32bit projid was chosen |
---|
298 | 421 | * to retain compatibility with "old" filesystems). |
---|
299 | 422 | */ |
---|
300 | 423 | static inline uint32_t |
---|
301 | | -bstat_get_projid(struct xfs_bstat *bs) |
---|
| 424 | +bstat_get_projid(const struct xfs_bstat *bs) |
---|
302 | 425 | { |
---|
303 | 426 | return (uint32_t)bs->bs_projid_hi << 16 | bs->bs_projid_lo; |
---|
304 | 427 | } |
---|
.. | .. |
---|
306 | 429 | /* |
---|
307 | 430 | * The user-level BulkStat Request interface structure. |
---|
308 | 431 | */ |
---|
309 | | -typedef struct xfs_fsop_bulkreq { |
---|
| 432 | +struct xfs_fsop_bulkreq { |
---|
310 | 433 | __u64 __user *lastip; /* last inode # pointer */ |
---|
311 | 434 | __s32 icount; /* count of entries in buffer */ |
---|
312 | 435 | void __user *ubuffer;/* user buffer for inode desc. */ |
---|
313 | 436 | __s32 __user *ocount; /* output count pointer */ |
---|
314 | | -} xfs_fsop_bulkreq_t; |
---|
315 | | - |
---|
| 437 | +}; |
---|
316 | 438 | |
---|
317 | 439 | /* |
---|
318 | 440 | * Structures returned from xfs_inumbers routine (XFS_IOC_FSINUMBERS). |
---|
319 | 441 | */ |
---|
320 | | -typedef struct xfs_inogrp { |
---|
| 442 | +struct xfs_inogrp { |
---|
321 | 443 | __u64 xi_startino; /* starting inode number */ |
---|
322 | 444 | __s32 xi_alloccount; /* # bits set in allocmask */ |
---|
323 | 445 | __u64 xi_allocmask; /* mask of allocated inodes */ |
---|
324 | | -} xfs_inogrp_t; |
---|
| 446 | +}; |
---|
325 | 447 | |
---|
| 448 | +/* New inumbers structure that reports v5 features and fixes padding issues */ |
---|
| 449 | +struct xfs_inumbers { |
---|
| 450 | + uint64_t xi_startino; /* starting inode number */ |
---|
| 451 | + uint64_t xi_allocmask; /* mask of allocated inodes */ |
---|
| 452 | + uint8_t xi_alloccount; /* # bits set in allocmask */ |
---|
| 453 | + uint8_t xi_version; /* version */ |
---|
| 454 | + uint8_t xi_padding[6]; /* zero */ |
---|
| 455 | +}; |
---|
| 456 | + |
---|
| 457 | +#define XFS_INUMBERS_VERSION_V1 (1) |
---|
| 458 | +#define XFS_INUMBERS_VERSION_V5 (5) |
---|
| 459 | + |
---|
| 460 | +/* Header for bulk inode requests. */ |
---|
| 461 | +struct xfs_bulk_ireq { |
---|
| 462 | + uint64_t ino; /* I/O: start with this inode */ |
---|
| 463 | + uint32_t flags; /* I/O: operation flags */ |
---|
| 464 | + uint32_t icount; /* I: count of entries in buffer */ |
---|
| 465 | + uint32_t ocount; /* O: count of entries filled out */ |
---|
| 466 | + uint32_t agno; /* I: see comment for IREQ_AGNO */ |
---|
| 467 | + uint64_t reserved[5]; /* must be zero */ |
---|
| 468 | +}; |
---|
| 469 | + |
---|
| 470 | +/* |
---|
| 471 | + * Only return results from the specified @agno. If @ino is zero, start |
---|
| 472 | + * with the first inode of @agno. |
---|
| 473 | + */ |
---|
| 474 | +#define XFS_BULK_IREQ_AGNO (1 << 0) |
---|
| 475 | + |
---|
| 476 | +/* |
---|
| 477 | + * Return bulkstat information for a single inode, where @ino value is a |
---|
| 478 | + * special value, not a literal inode number. See the XFS_BULK_IREQ_SPECIAL_* |
---|
| 479 | + * values below. Not compatible with XFS_BULK_IREQ_AGNO. |
---|
| 480 | + */ |
---|
| 481 | +#define XFS_BULK_IREQ_SPECIAL (1 << 1) |
---|
| 482 | + |
---|
| 483 | +#define XFS_BULK_IREQ_FLAGS_ALL (XFS_BULK_IREQ_AGNO | \ |
---|
| 484 | + XFS_BULK_IREQ_SPECIAL) |
---|
| 485 | + |
---|
| 486 | +/* Operate on the root directory inode. */ |
---|
| 487 | +#define XFS_BULK_IREQ_SPECIAL_ROOT (1) |
---|
| 488 | + |
---|
| 489 | +/* |
---|
| 490 | + * ioctl structures for v5 bulkstat and inumbers requests |
---|
| 491 | + */ |
---|
| 492 | +struct xfs_bulkstat_req { |
---|
| 493 | + struct xfs_bulk_ireq hdr; |
---|
| 494 | + struct xfs_bulkstat bulkstat[]; |
---|
| 495 | +}; |
---|
| 496 | +#define XFS_BULKSTAT_REQ_SIZE(nr) (sizeof(struct xfs_bulkstat_req) + \ |
---|
| 497 | + (nr) * sizeof(struct xfs_bulkstat)) |
---|
| 498 | + |
---|
| 499 | +struct xfs_inumbers_req { |
---|
| 500 | + struct xfs_bulk_ireq hdr; |
---|
| 501 | + struct xfs_inumbers inumbers[]; |
---|
| 502 | +}; |
---|
| 503 | +#define XFS_INUMBERS_REQ_SIZE(nr) (sizeof(struct xfs_inumbers_req) + \ |
---|
| 504 | + (nr) * sizeof(struct xfs_inumbers)) |
---|
326 | 505 | |
---|
327 | 506 | /* |
---|
328 | 507 | * Error injection. |
---|
.. | .. |
---|
390 | 569 | struct fsdmidata __user *data; /* DMAPI data */ |
---|
391 | 570 | } xfs_fsop_setdm_handlereq_t; |
---|
392 | 571 | |
---|
| 572 | +/* |
---|
| 573 | + * Flags passed in xfs_attr_multiop.am_flags for the attr ioctl interface. |
---|
| 574 | + * |
---|
| 575 | + * NOTE: Must match the values declared in libattr without the XFS_IOC_ prefix. |
---|
| 576 | + */ |
---|
| 577 | +#define XFS_IOC_ATTR_ROOT 0x0002 /* use attrs in root namespace */ |
---|
| 578 | +#define XFS_IOC_ATTR_SECURE 0x0008 /* use attrs in security namespace */ |
---|
| 579 | +#define XFS_IOC_ATTR_CREATE 0x0010 /* fail if attr already exists */ |
---|
| 580 | +#define XFS_IOC_ATTR_REPLACE 0x0020 /* fail if attr does not exist */ |
---|
| 581 | + |
---|
393 | 582 | typedef struct xfs_attrlist_cursor { |
---|
394 | 583 | __u32 opaque[4]; |
---|
395 | 584 | } xfs_attrlist_cursor_t; |
---|
| 585 | + |
---|
| 586 | +/* |
---|
| 587 | + * Define how lists of attribute names are returned to userspace from the |
---|
| 588 | + * XFS_IOC_ATTRLIST_BY_HANDLE ioctl. struct xfs_attrlist is the header at the |
---|
| 589 | + * beginning of the returned buffer, and a each entry in al_offset contains the |
---|
| 590 | + * relative offset of an xfs_attrlist_ent containing the actual entry. |
---|
| 591 | + * |
---|
| 592 | + * NOTE: struct xfs_attrlist must match struct attrlist defined in libattr, and |
---|
| 593 | + * struct xfs_attrlist_ent must match struct attrlist_ent defined in libattr. |
---|
| 594 | + */ |
---|
| 595 | +struct xfs_attrlist { |
---|
| 596 | + __s32 al_count; /* number of entries in attrlist */ |
---|
| 597 | + __s32 al_more; /* T/F: more attrs (do call again) */ |
---|
| 598 | + __s32 al_offset[1]; /* byte offsets of attrs [var-sized] */ |
---|
| 599 | +}; |
---|
| 600 | + |
---|
| 601 | +struct xfs_attrlist_ent { /* data from attr_list() */ |
---|
| 602 | + __u32 a_valuelen; /* number bytes in value of attr */ |
---|
| 603 | + char a_name[1]; /* attr name (NULL terminated) */ |
---|
| 604 | +}; |
---|
396 | 605 | |
---|
397 | 606 | typedef struct xfs_fsop_attrlist_handlereq { |
---|
398 | 607 | struct xfs_fsop_handlereq hreq; /* handle interface structure */ |
---|
.. | .. |
---|
411 | 620 | void __user *am_attrname; |
---|
412 | 621 | void __user *am_attrvalue; |
---|
413 | 622 | __u32 am_length; |
---|
414 | | - __u32 am_flags; |
---|
| 623 | + __u32 am_flags; /* XFS_IOC_ATTR_* */ |
---|
415 | 624 | } xfs_attr_multiop_t; |
---|
416 | 625 | |
---|
417 | 626 | typedef struct xfs_fsop_attrmulti_handlereq { |
---|
.. | .. |
---|
453 | 662 | xfs_off_t sx_offset; /* offset into file */ |
---|
454 | 663 | xfs_off_t sx_length; /* leng from offset */ |
---|
455 | 664 | char sx_pad[16]; /* pad space, unused */ |
---|
456 | | - xfs_bstat_t sx_stat; /* stat of target b4 copy */ |
---|
| 665 | + struct xfs_bstat sx_stat; /* stat of target b4 copy */ |
---|
457 | 666 | } xfs_swapext_t; |
---|
458 | 667 | |
---|
459 | 668 | /* |
---|
.. | .. |
---|
502 | 711 | #define XFS_SCRUB_TYPE_UQUOTA 21 /* user quotas */ |
---|
503 | 712 | #define XFS_SCRUB_TYPE_GQUOTA 22 /* group quotas */ |
---|
504 | 713 | #define XFS_SCRUB_TYPE_PQUOTA 23 /* project quotas */ |
---|
| 714 | +#define XFS_SCRUB_TYPE_FSCOUNTERS 24 /* fs summary counters */ |
---|
505 | 715 | |
---|
506 | 716 | /* Number of scrub subcommands. */ |
---|
507 | | -#define XFS_SCRUB_TYPE_NR 24 |
---|
| 717 | +#define XFS_SCRUB_TYPE_NR 25 |
---|
508 | 718 | |
---|
509 | 719 | /* i: Repair this metadata. */ |
---|
510 | 720 | #define XFS_SCRUB_IFLAG_REPAIR (1 << 0) |
---|
.. | .. |
---|
590 | 800 | #define XFS_IOC_FREE_EOFBLOCKS _IOR ('X', 58, struct xfs_fs_eofblocks) |
---|
591 | 801 | /* XFS_IOC_GETFSMAP ------ hoisted 59 */ |
---|
592 | 802 | #define XFS_IOC_SCRUB_METADATA _IOWR('X', 60, struct xfs_scrub_metadata) |
---|
| 803 | +#define XFS_IOC_AG_GEOMETRY _IOWR('X', 61, struct xfs_ag_geometry) |
---|
593 | 804 | |
---|
594 | 805 | /* |
---|
595 | 806 | * ioctl commands that replace IRIX syssgi()'s |
---|
.. | .. |
---|
620 | 831 | #define XFS_IOC_FSSETDM_BY_HANDLE _IOW ('X', 121, struct xfs_fsop_setdm_handlereq) |
---|
621 | 832 | #define XFS_IOC_ATTRLIST_BY_HANDLE _IOW ('X', 122, struct xfs_fsop_attrlist_handlereq) |
---|
622 | 833 | #define XFS_IOC_ATTRMULTI_BY_HANDLE _IOW ('X', 123, struct xfs_fsop_attrmulti_handlereq) |
---|
623 | | -#define XFS_IOC_FSGEOMETRY _IOR ('X', 124, struct xfs_fsop_geom) |
---|
| 834 | +#define XFS_IOC_FSGEOMETRY_V4 _IOR ('X', 124, struct xfs_fsop_geom_v4) |
---|
624 | 835 | #define XFS_IOC_GOINGDOWN _IOR ('X', 125, uint32_t) |
---|
| 836 | +#define XFS_IOC_FSGEOMETRY _IOR ('X', 126, struct xfs_fsop_geom) |
---|
| 837 | +#define XFS_IOC_BULKSTAT _IOR ('X', 127, struct xfs_bulkstat_req) |
---|
| 838 | +#define XFS_IOC_INUMBERS _IOR ('X', 128, struct xfs_inumbers_req) |
---|
625 | 839 | /* XFS_IOC_GETFSUUID ---------- deprecated 140 */ |
---|
626 | 840 | |
---|
627 | 841 | |
---|