0001
0002
0003
0004
0005
0006 #ifndef __XFS_FS_H__
0007 #define __XFS_FS_H__
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef HAVE_DIOATTR
0019 struct dioattr {
0020 __u32 d_mem;
0021 __u32 d_miniosz;
0022 __u32 d_maxiosz;
0023 };
0024 #endif
0025
0026
0027
0028
0029
0030
0031
0032
0033 #ifndef HAVE_GETBMAP
0034 struct getbmap {
0035 __s64 bmv_offset;
0036 __s64 bmv_block;
0037 __s64 bmv_length;
0038 __s32 bmv_count;
0039 __s32 bmv_entries;
0040 };
0041 #endif
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052 #ifndef HAVE_GETBMAPX
0053 struct getbmapx {
0054 __s64 bmv_offset;
0055 __s64 bmv_block;
0056 __s64 bmv_length;
0057 __s32 bmv_count;
0058 __s32 bmv_entries;
0059 __s32 bmv_iflags;
0060 __s32 bmv_oflags;
0061 __s32 bmv_unused1;
0062 __s32 bmv_unused2;
0063 };
0064 #endif
0065
0066
0067 #define BMV_IF_ATTRFORK 0x1
0068 #define BMV_IF_NO_DMAPI_READ 0x2
0069 #define BMV_IF_PREALLOC 0x4
0070 #define BMV_IF_DELALLOC 0x8
0071 #define BMV_IF_NO_HOLES 0x10
0072 #define BMV_IF_COWFORK 0x20
0073 #define BMV_IF_VALID \
0074 (BMV_IF_ATTRFORK|BMV_IF_NO_DMAPI_READ|BMV_IF_PREALLOC| \
0075 BMV_IF_DELALLOC|BMV_IF_NO_HOLES|BMV_IF_COWFORK)
0076
0077
0078 #define BMV_OF_PREALLOC 0x1
0079 #define BMV_OF_DELALLOC 0x2
0080 #define BMV_OF_LAST 0x4
0081 #define BMV_OF_SHARED 0x8
0082
0083
0084 #define XFS_FMR_OWN_FREE FMR_OWN_FREE
0085 #define XFS_FMR_OWN_UNKNOWN FMR_OWN_UNKNOWN
0086 #define XFS_FMR_OWN_FS FMR_OWNER('X', 1)
0087 #define XFS_FMR_OWN_LOG FMR_OWNER('X', 2)
0088 #define XFS_FMR_OWN_AG FMR_OWNER('X', 3)
0089 #define XFS_FMR_OWN_INOBT FMR_OWNER('X', 4)
0090 #define XFS_FMR_OWN_INODES FMR_OWNER('X', 5)
0091 #define XFS_FMR_OWN_REFC FMR_OWNER('X', 6)
0092 #define XFS_FMR_OWN_COW FMR_OWNER('X', 7)
0093 #define XFS_FMR_OWN_DEFECTIVE FMR_OWNER('X', 8)
0094
0095
0096
0097
0098
0099 typedef struct xfs_flock64 {
0100 __s16 l_type;
0101 __s16 l_whence;
0102 __s64 l_start;
0103 __s64 l_len;
0104 __s32 l_sysid;
0105 __u32 l_pid;
0106 __s32 l_pad[4];
0107 } xfs_flock64_t;
0108
0109
0110
0111
0112 struct xfs_fsop_geom_v1 {
0113 __u32 blocksize;
0114 __u32 rtextsize;
0115 __u32 agblocks;
0116 __u32 agcount;
0117 __u32 logblocks;
0118 __u32 sectsize;
0119 __u32 inodesize;
0120 __u32 imaxpct;
0121 __u64 datablocks;
0122 __u64 rtblocks;
0123 __u64 rtextents;
0124 __u64 logstart;
0125 unsigned char uuid[16];
0126 __u32 sunit;
0127 __u32 swidth;
0128 __s32 version;
0129 __u32 flags;
0130 __u32 logsectsize;
0131 __u32 rtsectsize;
0132 __u32 dirblocksize;
0133 };
0134
0135
0136
0137
0138 struct xfs_fsop_geom_v4 {
0139 __u32 blocksize;
0140 __u32 rtextsize;
0141 __u32 agblocks;
0142 __u32 agcount;
0143 __u32 logblocks;
0144 __u32 sectsize;
0145 __u32 inodesize;
0146 __u32 imaxpct;
0147 __u64 datablocks;
0148 __u64 rtblocks;
0149 __u64 rtextents;
0150 __u64 logstart;
0151 unsigned char uuid[16];
0152 __u32 sunit;
0153 __u32 swidth;
0154 __s32 version;
0155 __u32 flags;
0156 __u32 logsectsize;
0157 __u32 rtsectsize;
0158 __u32 dirblocksize;
0159 __u32 logsunit;
0160 };
0161
0162
0163
0164
0165 struct xfs_fsop_geom {
0166 __u32 blocksize;
0167 __u32 rtextsize;
0168 __u32 agblocks;
0169 __u32 agcount;
0170 __u32 logblocks;
0171 __u32 sectsize;
0172 __u32 inodesize;
0173 __u32 imaxpct;
0174 __u64 datablocks;
0175 __u64 rtblocks;
0176 __u64 rtextents;
0177 __u64 logstart;
0178 unsigned char uuid[16];
0179 __u32 sunit;
0180 __u32 swidth;
0181 __s32 version;
0182 __u32 flags;
0183 __u32 logsectsize;
0184 __u32 rtsectsize;
0185 __u32 dirblocksize;
0186 __u32 logsunit;
0187 uint32_t sick;
0188 uint32_t checked;
0189 __u64 reserved[17];
0190 };
0191
0192 #define XFS_FSOP_GEOM_SICK_COUNTERS (1 << 0)
0193 #define XFS_FSOP_GEOM_SICK_UQUOTA (1 << 1)
0194 #define XFS_FSOP_GEOM_SICK_GQUOTA (1 << 2)
0195 #define XFS_FSOP_GEOM_SICK_PQUOTA (1 << 3)
0196 #define XFS_FSOP_GEOM_SICK_RT_BITMAP (1 << 4)
0197 #define XFS_FSOP_GEOM_SICK_RT_SUMMARY (1 << 5)
0198
0199
0200 typedef struct xfs_fsop_counts {
0201 __u64 freedata;
0202 __u64 freertx;
0203 __u64 freeino;
0204 __u64 allocino;
0205 } xfs_fsop_counts_t;
0206
0207
0208 typedef struct xfs_fsop_resblks {
0209 __u64 resblks;
0210 __u64 resblks_avail;
0211 } xfs_fsop_resblks_t;
0212
0213 #define XFS_FSOP_GEOM_VERSION 0
0214 #define XFS_FSOP_GEOM_VERSION_V5 5
0215
0216 #define XFS_FSOP_GEOM_FLAGS_ATTR (1 << 0)
0217 #define XFS_FSOP_GEOM_FLAGS_NLINK (1 << 1)
0218 #define XFS_FSOP_GEOM_FLAGS_QUOTA (1 << 2)
0219 #define XFS_FSOP_GEOM_FLAGS_IALIGN (1 << 3)
0220 #define XFS_FSOP_GEOM_FLAGS_DALIGN (1 << 4)
0221 #define XFS_FSOP_GEOM_FLAGS_SHARED (1 << 5)
0222 #define XFS_FSOP_GEOM_FLAGS_EXTFLG (1 << 6)
0223 #define XFS_FSOP_GEOM_FLAGS_DIRV2 (1 << 7)
0224 #define XFS_FSOP_GEOM_FLAGS_LOGV2 (1 << 8)
0225 #define XFS_FSOP_GEOM_FLAGS_SECTOR (1 << 9)
0226 #define XFS_FSOP_GEOM_FLAGS_ATTR2 (1 << 10)
0227 #define XFS_FSOP_GEOM_FLAGS_PROJID32 (1 << 11)
0228 #define XFS_FSOP_GEOM_FLAGS_DIRV2CI (1 << 12)
0229
0230 #define XFS_FSOP_GEOM_FLAGS_LAZYSB (1 << 14)
0231 #define XFS_FSOP_GEOM_FLAGS_V5SB (1 << 15)
0232 #define XFS_FSOP_GEOM_FLAGS_FTYPE (1 << 16)
0233 #define XFS_FSOP_GEOM_FLAGS_FINOBT (1 << 17)
0234 #define XFS_FSOP_GEOM_FLAGS_SPINODES (1 << 18)
0235 #define XFS_FSOP_GEOM_FLAGS_RMAPBT (1 << 19)
0236 #define XFS_FSOP_GEOM_FLAGS_REFLINK (1 << 20)
0237 #define XFS_FSOP_GEOM_FLAGS_BIGTIME (1 << 21)
0238 #define XFS_FSOP_GEOM_FLAGS_INOBTCNT (1 << 22)
0239 #define XFS_FSOP_GEOM_FLAGS_NREXT64 (1 << 23)
0240
0241
0242
0243
0244
0245
0246 #define XFS_MIN_AG_BLOCKS 64
0247 #define XFS_MIN_LOG_BLOCKS 512ULL
0248 #define XFS_MAX_LOG_BLOCKS (1024 * 1024ULL)
0249 #define XFS_MIN_LOG_BYTES (10 * 1024 * 1024ULL)
0250
0251
0252
0253
0254
0255 #define XFS_MIN_AG_BYTES (1ULL << 24)
0256 #define XFS_MAX_AG_BYTES (1ULL << 40)
0257 #define XFS_MAX_AG_BLOCKS (XFS_MAX_AG_BYTES / XFS_MIN_BLOCKSIZE)
0258 #define XFS_MAX_CRC_AG_BLOCKS (XFS_MAX_AG_BYTES / XFS_MIN_CRC_BLOCKSIZE)
0259
0260
0261 #define XFS_MAX_LOG_BYTES \
0262 ((2 * 1024 * 1024 * 1024ULL) - XFS_MIN_LOG_BYTES)
0263
0264
0265 #define XFS_MAX_DBLOCKS(s) ((xfs_rfsblock_t)(s)->sb_agcount * (s)->sb_agblocks)
0266 #define XFS_MIN_DBLOCKS(s) ((xfs_rfsblock_t)((s)->sb_agcount - 1) * \
0267 (s)->sb_agblocks + XFS_MIN_AG_BLOCKS)
0268
0269
0270
0271
0272 struct xfs_ag_geometry {
0273 uint32_t ag_number;
0274 uint32_t ag_length;
0275 uint32_t ag_freeblks;
0276 uint32_t ag_icount;
0277 uint32_t ag_ifree;
0278 uint32_t ag_sick;
0279 uint32_t ag_checked;
0280 uint32_t ag_flags;
0281 uint64_t ag_reserved[12];
0282 };
0283 #define XFS_AG_GEOM_SICK_SB (1 << 0)
0284 #define XFS_AG_GEOM_SICK_AGF (1 << 1)
0285 #define XFS_AG_GEOM_SICK_AGFL (1 << 2)
0286 #define XFS_AG_GEOM_SICK_AGI (1 << 3)
0287 #define XFS_AG_GEOM_SICK_BNOBT (1 << 4)
0288 #define XFS_AG_GEOM_SICK_CNTBT (1 << 5)
0289 #define XFS_AG_GEOM_SICK_INOBT (1 << 6)
0290 #define XFS_AG_GEOM_SICK_FINOBT (1 << 7)
0291 #define XFS_AG_GEOM_SICK_RMAPBT (1 << 8)
0292 #define XFS_AG_GEOM_SICK_REFCNTBT (1 << 9)
0293
0294
0295
0296
0297 typedef struct xfs_growfs_data {
0298 __u64 newblocks;
0299 __u32 imaxpct;
0300 } xfs_growfs_data_t;
0301
0302 typedef struct xfs_growfs_log {
0303 __u32 newblocks;
0304 __u32 isint;
0305 } xfs_growfs_log_t;
0306
0307 typedef struct xfs_growfs_rt {
0308 __u64 newblocks;
0309 __u32 extsize;
0310 } xfs_growfs_rt_t;
0311
0312
0313
0314
0315
0316 typedef struct xfs_bstime {
0317 __kernel_long_t tv_sec;
0318 __s32 tv_nsec;
0319 } xfs_bstime_t;
0320
0321 struct xfs_bstat {
0322 __u64 bs_ino;
0323 __u16 bs_mode;
0324 __u16 bs_nlink;
0325 __u32 bs_uid;
0326 __u32 bs_gid;
0327 __u32 bs_rdev;
0328 __s32 bs_blksize;
0329 __s64 bs_size;
0330 xfs_bstime_t bs_atime;
0331 xfs_bstime_t bs_mtime;
0332 xfs_bstime_t bs_ctime;
0333 int64_t bs_blocks;
0334 __u32 bs_xflags;
0335 __s32 bs_extsize;
0336 __s32 bs_extents;
0337 __u32 bs_gen;
0338 __u16 bs_projid_lo;
0339 #define bs_projid bs_projid_lo
0340 __u16 bs_forkoff;
0341 __u16 bs_projid_hi;
0342 uint16_t bs_sick;
0343 uint16_t bs_checked;
0344 unsigned char bs_pad[2];
0345 __u32 bs_cowextsize;
0346 __u32 bs_dmevmask;
0347 __u16 bs_dmstate;
0348 __u16 bs_aextents;
0349 };
0350
0351
0352 struct xfs_bulkstat {
0353 uint64_t bs_ino;
0354 uint64_t bs_size;
0355
0356 uint64_t bs_blocks;
0357 uint64_t bs_xflags;
0358
0359 int64_t bs_atime;
0360 int64_t bs_mtime;
0361
0362 int64_t bs_ctime;
0363 int64_t bs_btime;
0364
0365 uint32_t bs_gen;
0366 uint32_t bs_uid;
0367 uint32_t bs_gid;
0368 uint32_t bs_projectid;
0369
0370 uint32_t bs_atime_nsec;
0371 uint32_t bs_mtime_nsec;
0372 uint32_t bs_ctime_nsec;
0373 uint32_t bs_btime_nsec;
0374
0375 uint32_t bs_blksize;
0376 uint32_t bs_rdev;
0377 uint32_t bs_cowextsize_blks;
0378 uint32_t bs_extsize_blks;
0379
0380 uint32_t bs_nlink;
0381 uint32_t bs_extents;
0382 uint32_t bs_aextents;
0383 uint16_t bs_version;
0384 uint16_t bs_forkoff;
0385
0386 uint16_t bs_sick;
0387 uint16_t bs_checked;
0388 uint16_t bs_mode;
0389 uint16_t bs_pad2;
0390 uint64_t bs_extents64;
0391
0392 uint64_t bs_pad[6];
0393 };
0394
0395 #define XFS_BULKSTAT_VERSION_V1 (1)
0396 #define XFS_BULKSTAT_VERSION_V5 (5)
0397
0398
0399 #define XFS_BS_SICK_INODE (1 << 0)
0400 #define XFS_BS_SICK_BMBTD (1 << 1)
0401 #define XFS_BS_SICK_BMBTA (1 << 2)
0402 #define XFS_BS_SICK_BMBTC (1 << 3)
0403 #define XFS_BS_SICK_DIR (1 << 4)
0404 #define XFS_BS_SICK_XATTR (1 << 5)
0405 #define XFS_BS_SICK_SYMLINK (1 << 6)
0406 #define XFS_BS_SICK_PARENT (1 << 7)
0407
0408
0409
0410
0411
0412
0413 static inline uint32_t
0414 bstat_get_projid(const struct xfs_bstat *bs)
0415 {
0416 return (uint32_t)bs->bs_projid_hi << 16 | bs->bs_projid_lo;
0417 }
0418
0419
0420
0421
0422 struct xfs_fsop_bulkreq {
0423 __u64 __user *lastip;
0424 __s32 icount;
0425 void __user *ubuffer;
0426 __s32 __user *ocount;
0427 };
0428
0429
0430
0431
0432 struct xfs_inogrp {
0433 __u64 xi_startino;
0434 __s32 xi_alloccount;
0435 __u64 xi_allocmask;
0436 };
0437
0438
0439 struct xfs_inumbers {
0440 uint64_t xi_startino;
0441 uint64_t xi_allocmask;
0442 uint8_t xi_alloccount;
0443 uint8_t xi_version;
0444 uint8_t xi_padding[6];
0445 };
0446
0447 #define XFS_INUMBERS_VERSION_V1 (1)
0448 #define XFS_INUMBERS_VERSION_V5 (5)
0449
0450
0451 struct xfs_bulk_ireq {
0452 uint64_t ino;
0453 uint32_t flags;
0454 uint32_t icount;
0455 uint32_t ocount;
0456 uint32_t agno;
0457 uint64_t reserved[5];
0458 };
0459
0460
0461
0462
0463
0464 #define XFS_BULK_IREQ_AGNO (1U << 0)
0465
0466
0467
0468
0469
0470
0471 #define XFS_BULK_IREQ_SPECIAL (1U << 1)
0472
0473
0474
0475
0476
0477
0478
0479
0480
0481 #define XFS_BULK_IREQ_NREXT64 (1U << 2)
0482
0483 #define XFS_BULK_IREQ_FLAGS_ALL (XFS_BULK_IREQ_AGNO | \
0484 XFS_BULK_IREQ_SPECIAL | \
0485 XFS_BULK_IREQ_NREXT64)
0486
0487
0488 #define XFS_BULK_IREQ_SPECIAL_ROOT (1)
0489
0490
0491
0492
0493 struct xfs_bulkstat_req {
0494 struct xfs_bulk_ireq hdr;
0495 struct xfs_bulkstat bulkstat[];
0496 };
0497 #define XFS_BULKSTAT_REQ_SIZE(nr) (sizeof(struct xfs_bulkstat_req) + \
0498 (nr) * sizeof(struct xfs_bulkstat))
0499
0500 struct xfs_inumbers_req {
0501 struct xfs_bulk_ireq hdr;
0502 struct xfs_inumbers inumbers[];
0503 };
0504 #define XFS_INUMBERS_REQ_SIZE(nr) (sizeof(struct xfs_inumbers_req) + \
0505 (nr) * sizeof(struct xfs_inumbers))
0506
0507
0508
0509
0510 typedef struct xfs_error_injection {
0511 __s32 fd;
0512 __s32 errtag;
0513 } xfs_error_injection_t;
0514
0515
0516
0517
0518
0519 #define XFS_EOFBLOCKS_VERSION 1
0520 struct xfs_fs_eofblocks {
0521 __u32 eof_version;
0522 __u32 eof_flags;
0523 uid_t eof_uid;
0524 gid_t eof_gid;
0525 prid_t eof_prid;
0526 __u32 pad32;
0527 __u64 eof_min_file_size;
0528 __u64 pad64[12];
0529 };
0530
0531
0532 #define XFS_EOF_FLAGS_SYNC (1 << 0)
0533 #define XFS_EOF_FLAGS_UID (1 << 1)
0534 #define XFS_EOF_FLAGS_GID (1 << 2)
0535 #define XFS_EOF_FLAGS_PRID (1 << 3)
0536 #define XFS_EOF_FLAGS_MINFILESIZE (1 << 4)
0537 #define XFS_EOF_FLAGS_UNION (1 << 5)
0538
0539
0540 #define XFS_EOF_FLAGS_VALID \
0541 (XFS_EOF_FLAGS_SYNC | \
0542 XFS_EOF_FLAGS_UID | \
0543 XFS_EOF_FLAGS_GID | \
0544 XFS_EOF_FLAGS_PRID | \
0545 XFS_EOF_FLAGS_MINFILESIZE)
0546
0547
0548
0549
0550
0551 typedef struct xfs_fsop_handlereq {
0552 __u32 fd;
0553 void __user *path;
0554 __u32 oflags;
0555 void __user *ihandle;
0556 __u32 ihandlen;
0557 void __user *ohandle;
0558 __u32 __user *ohandlen;
0559 } xfs_fsop_handlereq_t;
0560
0561
0562
0563
0564
0565
0566
0567
0568
0569
0570
0571
0572 #define XFS_IOC_ATTR_ROOT 0x0002
0573 #define XFS_IOC_ATTR_SECURE 0x0008
0574 #define XFS_IOC_ATTR_CREATE 0x0010
0575 #define XFS_IOC_ATTR_REPLACE 0x0020
0576
0577 typedef struct xfs_attrlist_cursor {
0578 __u32 opaque[4];
0579 } xfs_attrlist_cursor_t;
0580
0581
0582
0583
0584
0585
0586
0587
0588
0589
0590 struct xfs_attrlist {
0591 __s32 al_count;
0592 __s32 al_more;
0593 __s32 al_offset[1];
0594 };
0595
0596 struct xfs_attrlist_ent {
0597 __u32 a_valuelen;
0598 char a_name[1];
0599 };
0600
0601 typedef struct xfs_fsop_attrlist_handlereq {
0602 struct xfs_fsop_handlereq hreq;
0603 struct xfs_attrlist_cursor pos;
0604 __u32 flags;
0605 __u32 buflen;
0606 void __user *buffer;
0607 } xfs_fsop_attrlist_handlereq_t;
0608
0609 typedef struct xfs_attr_multiop {
0610 __u32 am_opcode;
0611 #define ATTR_OP_GET 1
0612 #define ATTR_OP_SET 2
0613 #define ATTR_OP_REMOVE 3
0614 __s32 am_error;
0615 void __user *am_attrname;
0616 void __user *am_attrvalue;
0617 __u32 am_length;
0618 __u32 am_flags;
0619 } xfs_attr_multiop_t;
0620
0621 typedef struct xfs_fsop_attrmulti_handlereq {
0622 struct xfs_fsop_handlereq hreq;
0623 __u32 opcount;
0624 struct xfs_attr_multiop __user *ops;
0625 } xfs_fsop_attrmulti_handlereq_t;
0626
0627
0628
0629
0630 typedef struct { __u32 val[2]; } xfs_fsid_t;
0631
0632 typedef struct xfs_fid {
0633 __u16 fid_len;
0634 __u16 fid_pad;
0635 __u32 fid_gen;
0636 __u64 fid_ino;
0637 } xfs_fid_t;
0638
0639 typedef struct xfs_handle {
0640 union {
0641 __s64 align;
0642 xfs_fsid_t _ha_fsid;
0643 } ha_u;
0644 xfs_fid_t ha_fid;
0645 } xfs_handle_t;
0646 #define ha_fsid ha_u._ha_fsid
0647
0648
0649
0650
0651 typedef struct xfs_swapext
0652 {
0653 int64_t sx_version;
0654 #define XFS_SX_VERSION 0
0655 int64_t sx_fdtarget;
0656 int64_t sx_fdtmp;
0657 xfs_off_t sx_offset;
0658 xfs_off_t sx_length;
0659 char sx_pad[16];
0660 struct xfs_bstat sx_stat;
0661 } xfs_swapext_t;
0662
0663
0664
0665
0666 #define XFS_FSOP_GOING_FLAGS_DEFAULT 0x0
0667 #define XFS_FSOP_GOING_FLAGS_LOGFLUSH 0x1
0668 #define XFS_FSOP_GOING_FLAGS_NOLOGFLUSH 0x2
0669
0670
0671 struct xfs_scrub_metadata {
0672 __u32 sm_type;
0673 __u32 sm_flags;
0674 __u64 sm_ino;
0675 __u32 sm_gen;
0676 __u32 sm_agno;
0677 __u64 sm_reserved[5];
0678 };
0679
0680
0681
0682
0683
0684
0685 #define XFS_SCRUB_TYPE_PROBE 0
0686 #define XFS_SCRUB_TYPE_SB 1
0687 #define XFS_SCRUB_TYPE_AGF 2
0688 #define XFS_SCRUB_TYPE_AGFL 3
0689 #define XFS_SCRUB_TYPE_AGI 4
0690 #define XFS_SCRUB_TYPE_BNOBT 5
0691 #define XFS_SCRUB_TYPE_CNTBT 6
0692 #define XFS_SCRUB_TYPE_INOBT 7
0693 #define XFS_SCRUB_TYPE_FINOBT 8
0694 #define XFS_SCRUB_TYPE_RMAPBT 9
0695 #define XFS_SCRUB_TYPE_REFCNTBT 10
0696 #define XFS_SCRUB_TYPE_INODE 11
0697 #define XFS_SCRUB_TYPE_BMBTD 12
0698 #define XFS_SCRUB_TYPE_BMBTA 13
0699 #define XFS_SCRUB_TYPE_BMBTC 14
0700 #define XFS_SCRUB_TYPE_DIR 15
0701 #define XFS_SCRUB_TYPE_XATTR 16
0702 #define XFS_SCRUB_TYPE_SYMLINK 17
0703 #define XFS_SCRUB_TYPE_PARENT 18
0704 #define XFS_SCRUB_TYPE_RTBITMAP 19
0705 #define XFS_SCRUB_TYPE_RTSUM 20
0706 #define XFS_SCRUB_TYPE_UQUOTA 21
0707 #define XFS_SCRUB_TYPE_GQUOTA 22
0708 #define XFS_SCRUB_TYPE_PQUOTA 23
0709 #define XFS_SCRUB_TYPE_FSCOUNTERS 24
0710
0711
0712 #define XFS_SCRUB_TYPE_NR 25
0713
0714
0715 #define XFS_SCRUB_IFLAG_REPAIR (1u << 0)
0716
0717
0718 #define XFS_SCRUB_OFLAG_CORRUPT (1u << 1)
0719
0720
0721
0722
0723
0724 #define XFS_SCRUB_OFLAG_PREEN (1u << 2)
0725
0726
0727 #define XFS_SCRUB_OFLAG_XFAIL (1u << 3)
0728
0729
0730 #define XFS_SCRUB_OFLAG_XCORRUPT (1u << 4)
0731
0732
0733 #define XFS_SCRUB_OFLAG_INCOMPLETE (1u << 5)
0734
0735
0736 #define XFS_SCRUB_OFLAG_WARNING (1u << 6)
0737
0738
0739
0740
0741
0742 #define XFS_SCRUB_OFLAG_NO_REPAIR_NEEDED (1u << 7)
0743
0744 #define XFS_SCRUB_FLAGS_IN (XFS_SCRUB_IFLAG_REPAIR)
0745 #define XFS_SCRUB_FLAGS_OUT (XFS_SCRUB_OFLAG_CORRUPT | \
0746 XFS_SCRUB_OFLAG_PREEN | \
0747 XFS_SCRUB_OFLAG_XFAIL | \
0748 XFS_SCRUB_OFLAG_XCORRUPT | \
0749 XFS_SCRUB_OFLAG_INCOMPLETE | \
0750 XFS_SCRUB_OFLAG_WARNING | \
0751 XFS_SCRUB_OFLAG_NO_REPAIR_NEEDED)
0752 #define XFS_SCRUB_FLAGS_ALL (XFS_SCRUB_FLAGS_IN | XFS_SCRUB_FLAGS_OUT)
0753
0754
0755
0756
0757 #ifdef XATTR_LIST_MAX
0758 # define XFS_XATTR_LIST_MAX XATTR_LIST_MAX
0759 #else
0760 # define XFS_XATTR_LIST_MAX 65536
0761 #endif
0762
0763
0764
0765
0766
0767 #define XFS_IOC_GETXFLAGS FS_IOC_GETFLAGS
0768 #define XFS_IOC_SETXFLAGS FS_IOC_SETFLAGS
0769 #define XFS_IOC_GETVERSION FS_IOC_GETVERSION
0770
0771
0772
0773
0774
0775
0776
0777
0778 #define XFS_IOC_DIOINFO _IOR ('X', 30, struct dioattr)
0779 #define XFS_IOC_FSGETXATTR FS_IOC_FSGETXATTR
0780 #define XFS_IOC_FSSETXATTR FS_IOC_FSSETXATTR
0781
0782
0783 #define XFS_IOC_GETBMAP _IOWR('X', 38, struct getbmap)
0784
0785 #define XFS_IOC_RESVSP _IOW ('X', 40, struct xfs_flock64)
0786 #define XFS_IOC_UNRESVSP _IOW ('X', 41, struct xfs_flock64)
0787 #define XFS_IOC_RESVSP64 _IOW ('X', 42, struct xfs_flock64)
0788 #define XFS_IOC_UNRESVSP64 _IOW ('X', 43, struct xfs_flock64)
0789 #define XFS_IOC_GETBMAPA _IOWR('X', 44, struct getbmap)
0790 #define XFS_IOC_FSGETXATTRA _IOR ('X', 45, struct fsxattr)
0791
0792
0793 #define XFS_IOC_GETBMAPX _IOWR('X', 56, struct getbmap)
0794 #define XFS_IOC_ZERO_RANGE _IOW ('X', 57, struct xfs_flock64)
0795 #define XFS_IOC_FREE_EOFBLOCKS _IOR ('X', 58, struct xfs_fs_eofblocks)
0796
0797 #define XFS_IOC_SCRUB_METADATA _IOWR('X', 60, struct xfs_scrub_metadata)
0798 #define XFS_IOC_AG_GEOMETRY _IOWR('X', 61, struct xfs_ag_geometry)
0799
0800
0801
0802
0803 #define XFS_IOC_FSGEOMETRY_V1 _IOR ('X', 100, struct xfs_fsop_geom_v1)
0804 #define XFS_IOC_FSBULKSTAT _IOWR('X', 101, struct xfs_fsop_bulkreq)
0805 #define XFS_IOC_FSBULKSTAT_SINGLE _IOWR('X', 102, struct xfs_fsop_bulkreq)
0806 #define XFS_IOC_FSINUMBERS _IOWR('X', 103, struct xfs_fsop_bulkreq)
0807 #define XFS_IOC_PATH_TO_FSHANDLE _IOWR('X', 104, struct xfs_fsop_handlereq)
0808 #define XFS_IOC_PATH_TO_HANDLE _IOWR('X', 105, struct xfs_fsop_handlereq)
0809 #define XFS_IOC_FD_TO_HANDLE _IOWR('X', 106, struct xfs_fsop_handlereq)
0810 #define XFS_IOC_OPEN_BY_HANDLE _IOWR('X', 107, struct xfs_fsop_handlereq)
0811 #define XFS_IOC_READLINK_BY_HANDLE _IOWR('X', 108, struct xfs_fsop_handlereq)
0812 #define XFS_IOC_SWAPEXT _IOWR('X', 109, struct xfs_swapext)
0813 #define XFS_IOC_FSGROWFSDATA _IOW ('X', 110, struct xfs_growfs_data)
0814 #define XFS_IOC_FSGROWFSLOG _IOW ('X', 111, struct xfs_growfs_log)
0815 #define XFS_IOC_FSGROWFSRT _IOW ('X', 112, struct xfs_growfs_rt)
0816 #define XFS_IOC_FSCOUNTS _IOR ('X', 113, struct xfs_fsop_counts)
0817 #define XFS_IOC_SET_RESBLKS _IOWR('X', 114, struct xfs_fsop_resblks)
0818 #define XFS_IOC_GET_RESBLKS _IOR ('X', 115, struct xfs_fsop_resblks)
0819 #define XFS_IOC_ERROR_INJECTION _IOW ('X', 116, struct xfs_error_injection)
0820 #define XFS_IOC_ERROR_CLEARALL _IOW ('X', 117, struct xfs_error_injection)
0821
0822
0823 #define XFS_IOC_FREEZE _IOWR('X', 119, int)
0824 #define XFS_IOC_THAW _IOWR('X', 120, int)
0825
0826
0827 #define XFS_IOC_ATTRLIST_BY_HANDLE _IOW ('X', 122, struct xfs_fsop_attrlist_handlereq)
0828 #define XFS_IOC_ATTRMULTI_BY_HANDLE _IOW ('X', 123, struct xfs_fsop_attrmulti_handlereq)
0829 #define XFS_IOC_FSGEOMETRY_V4 _IOR ('X', 124, struct xfs_fsop_geom_v4)
0830 #define XFS_IOC_GOINGDOWN _IOR ('X', 125, uint32_t)
0831 #define XFS_IOC_FSGEOMETRY _IOR ('X', 126, struct xfs_fsop_geom)
0832 #define XFS_IOC_BULKSTAT _IOR ('X', 127, struct xfs_bulkstat_req)
0833 #define XFS_IOC_INUMBERS _IOR ('X', 128, struct xfs_inumbers_req)
0834
0835
0836
0837 #ifndef HAVE_BBMACROS
0838
0839
0840
0841
0842
0843 #define BBSHIFT 9
0844 #define BBSIZE (1<<BBSHIFT)
0845 #define BBMASK (BBSIZE-1)
0846 #define BTOBB(bytes) (((__u64)(bytes) + BBSIZE - 1) >> BBSHIFT)
0847 #define BTOBBT(bytes) ((__u64)(bytes) >> BBSHIFT)
0848 #define BBTOB(bbs) ((bbs) << BBSHIFT)
0849 #endif
0850
0851 #endif