158
165
__s64 l_len; /* len == 0 means until end of file */
161
168
__s32 l_pad[4]; /* reserve area */
172
* Output for XFS_IOC_FSGEOMETRY_V1
174
typedef struct xfs_fsop_geom_v1 {
175
__u32 blocksize; /* filesystem (data) block size */
176
__u32 rtextsize; /* realtime extent size */
177
__u32 agblocks; /* fsblocks in an AG */
178
__u32 agcount; /* number of allocation groups */
179
__u32 logblocks; /* fsblocks in the log */
180
__u32 sectsize; /* (data) sector size, bytes */
181
__u32 inodesize; /* inode size in bytes */
182
__u32 imaxpct; /* max allowed inode space(%) */
183
__u64 datablocks; /* fsblocks in data subvolume */
184
__u64 rtblocks; /* fsblocks in realtime subvol */
185
__u64 rtextents; /* rt extents in realtime subvol*/
186
__u64 logstart; /* starting fsblock of the log */
187
unsigned char uuid[16]; /* unique id of the filesystem */
188
__u32 sunit; /* stripe unit, fsblocks */
189
__u32 swidth; /* stripe width, fsblocks */
190
__s32 version; /* structure version */
191
__u32 flags; /* superblock version flags */
192
__u32 logsectsize; /* log sector size, bytes */
193
__u32 rtsectsize; /* realtime sector size, bytes */
194
__u32 dirblocksize; /* directory block size, bytes */
195
} xfs_fsop_geom_v1_t;
165
198
* Output for XFS_IOC_FSGEOMETRY
167
200
typedef struct xfs_fsop_geom {
168
__u32 blocksize; /* filesystem (data) block size */
201
__u32 blocksize; /* filesystem (data) block size */
169
202
__u32 rtextsize; /* realtime extent size */
170
203
__u32 agblocks; /* fsblocks in an AG */
171
__u32 agcount; /* number of allocation groups */
204
__u32 agcount; /* number of allocation groups */
172
205
__u32 logblocks; /* fsblocks in the log */
173
206
__u32 sectsize; /* (data) sector size, bytes */
174
207
__u32 inodesize; /* inode size in bytes */
392
425
__s64 align; /* force alignment of ha_fid */
393
426
xfs_fsid_t _ha_fsid; /* unique file system identifier */
395
xfs_fid_t ha_fid; /* file system specific file ID */
428
xfs_fid_t ha_fid; /* file system specific file ID */
397
430
#define ha_fsid ha_u._ha_fsid
399
#define XFS_HSIZE(handle) (((char *) &(handle).ha_fid.xfs_fid_pad \
432
#define XFS_HSIZE(handle) (((char *) &(handle).ha_fid.xfs_fid_pad \
400
433
- (char *) &(handle)) \
401
434
+ (handle).ha_fid.xfs_fid_len)
403
#define XFS_HANDLE_CMP(h1, h2) bcmp(h1, h2, sizeof (xfs_handle_t))
405
#define FSHSIZE sizeof (fsid_t)
436
#define XFS_HANDLE_CMP(h1, h2) memcmp(h1, h2, sizeof(xfs_handle_t))
438
#define FSHSIZE sizeof(fsid_t)
441
* Flags for going down operation
443
#define XFS_FSOP_GOING_FLAGS_DEFAULT 0x0 /* going down */
444
#define XFS_FSOP_GOING_FLAGS_LOGFLUSH 0x1 /* flush log but not data */
445
#define XFS_FSOP_GOING_FLAGS_NOLOGFLUSH 0x2 /* don't flush log nor data */
447
#ifndef HAVE_IOCMACROS
409
449
* ioctl commands that replace IRIX fcntl()'s
410
450
* For 'documentation' purposed more than anything else,
411
451
* the "cmd #" field reflects the IRIX fcntl number.
413
#define XFS_IOC_ALLOCSP _IOW ('X', 10, struct xfs_flock64)
414
#define XFS_IOC_FREESP _IOW ('X', 11, struct xfs_flock64)
415
#define XFS_IOC_DIOINFO _IOR ('X', 30, struct dioattr)
416
#define XFS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr)
417
#define XFS_IOC_FSSETXATTR _IOW ('X', 32, struct fsxattr)
418
#define XFS_IOC_ALLOCSP64 _IOW ('X', 36, struct xfs_flock64)
419
#define XFS_IOC_FREESP64 _IOW ('X', 37, struct xfs_flock64)
420
#define XFS_IOC_GETBMAP _IOWR('X', 38, struct getbmap)
421
#define XFS_IOC_FSSETDM _IOW ('X', 39, struct fsdmidata)
422
#define XFS_IOC_RESVSP _IOW ('X', 40, struct xfs_flock64)
423
#define XFS_IOC_UNRESVSP _IOW ('X', 41, struct xfs_flock64)
424
#define XFS_IOC_RESVSP64 _IOW ('X', 42, struct xfs_flock64)
425
#define XFS_IOC_UNRESVSP64 _IOW ('X', 43, struct xfs_flock64)
426
#define XFS_IOC_GETBMAPA _IOWR('X', 44, struct getbmap)
427
#define XFS_IOC_FSGETXATTRA _IOR ('X', 45, struct fsxattr)
428
/* XFS_IOC_SETBIOSIZE ---- deprecated 46 */
429
/* XFS_IOC_GETBIOSIZE ---- deprecated 47 */
430
#define XFS_IOC_GETBMAPX _IOWR('X', 56, struct getbmap)
453
#define XFS_IOC_ALLOCSP _IOW ('X', 10, struct xfs_flock64)
454
#define XFS_IOC_FREESP _IOW ('X', 11, struct xfs_flock64)
455
#define XFS_IOC_DIOINFO _IOR ('X', 30, struct dioattr)
456
#define XFS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr)
457
#define XFS_IOC_FSSETXATTR _IOW ('X', 32, struct fsxattr)
458
#define XFS_IOC_ALLOCSP64 _IOW ('X', 36, struct xfs_flock64)
459
#define XFS_IOC_FREESP64 _IOW ('X', 37, struct xfs_flock64)
460
#define XFS_IOC_GETBMAP _IOWR('X', 38, struct getbmap)
461
#define XFS_IOC_FSSETDM _IOW ('X', 39, struct fsdmidata)
462
#define XFS_IOC_RESVSP _IOW ('X', 40, struct xfs_flock64)
463
#define XFS_IOC_UNRESVSP _IOW ('X', 41, struct xfs_flock64)
464
#define XFS_IOC_RESVSP64 _IOW ('X', 42, struct xfs_flock64)
465
#define XFS_IOC_UNRESVSP64 _IOW ('X', 43, struct xfs_flock64)
466
#define XFS_IOC_GETBMAPA _IOWR('X', 44, struct getbmap)
467
#define XFS_IOC_FSGETXATTRA _IOR ('X', 45, struct fsxattr)
468
/* XFS_IOC_SETBIOSIZE ---- deprecated 46 */
469
/* XFS_IOC_GETBIOSIZE ---- deprecated 47 */
470
#define XFS_IOC_GETBMAPX _IOWR('X', 56, struct getbmap)
433
473
* ioctl commands that replace IRIX syssgi()'s
435
#define XFS_IOC_FSGEOMETRY _IOR ('X', 100, struct xfs_fsop_geom)
436
#define XFS_IOC_FSBULKSTAT _IOWR('X', 101, struct xfs_fsop_bulkreq)
437
#define XFS_IOC_FSBULKSTAT_SINGLE _IOWR('X', 102, struct xfs_fsop_bulkreq)
438
#define XFS_IOC_FSINUMBERS _IOWR('X', 103, struct xfs_fsop_bulkreq)
439
#define XFS_IOC_PATH_TO_FSHANDLE _IOWR('X', 104, struct xfs_fsop_handlereq)
440
#define XFS_IOC_PATH_TO_HANDLE _IOWR('X', 105, struct xfs_fsop_handlereq)
441
#define XFS_IOC_FD_TO_HANDLE _IOWR('X', 106, struct xfs_fsop_handlereq)
442
#define XFS_IOC_OPEN_BY_HANDLE _IOWR('X', 107, struct xfs_fsop_handlereq)
443
#define XFS_IOC_READLINK_BY_HANDLE _IOWR('X', 108, struct xfs_fsop_handlereq)
475
#define XFS_IOC_FSGEOMETRY_V1 _IOR ('X', 100, struct xfs_fsop_geom_v1)
476
#define XFS_IOC_FSBULKSTAT _IOWR('X', 101, struct xfs_fsop_bulkreq)
477
#define XFS_IOC_FSBULKSTAT_SINGLE _IOWR('X', 102, struct xfs_fsop_bulkreq)
478
#define XFS_IOC_FSINUMBERS _IOWR('X', 103, struct xfs_fsop_bulkreq)
479
#define XFS_IOC_PATH_TO_FSHANDLE _IOWR('X', 104, struct xfs_fsop_handlereq)
480
#define XFS_IOC_PATH_TO_HANDLE _IOWR('X', 105, struct xfs_fsop_handlereq)
481
#define XFS_IOC_FD_TO_HANDLE _IOWR('X', 106, struct xfs_fsop_handlereq)
482
#define XFS_IOC_OPEN_BY_HANDLE _IOWR('X', 107, struct xfs_fsop_handlereq)
483
#define XFS_IOC_READLINK_BY_HANDLE _IOWR('X', 108, struct xfs_fsop_handlereq)
444
484
#define XFS_IOC_SWAPEXT _IOWR('X', 109, struct xfs_swapext)
445
#define XFS_IOC_FSGROWFSDATA _IOW ('X', 110, struct xfs_growfs_data)
446
#define XFS_IOC_FSGROWFSLOG _IOW ('X', 111, struct xfs_growfs_log)
447
#define XFS_IOC_FSGROWFSRT _IOW ('X', 112, struct xfs_growfs_rt)
448
#define XFS_IOC_FSCOUNTS _IOR ('X', 113, struct xfs_fsop_counts)
449
#define XFS_IOC_SET_RESBLKS _IOR ('X', 114, struct xfs_fsop_resblks)
450
#define XFS_IOC_GET_RESBLKS _IOR ('X', 115, struct xfs_fsop_resblks)
451
#define XFS_IOC_ERROR_INJECTION _IOW ('X', 116, struct xfs_error_injection)
452
#define XFS_IOC_ERROR_CLEARALL _IOW ('X', 117, struct xfs_error_injection)
453
/* XFS_IOC_ATTRCTL_BY_HANDLE -- deprecated 118 */
485
#define XFS_IOC_FSGROWFSDATA _IOW ('X', 110, struct xfs_growfs_data)
486
#define XFS_IOC_FSGROWFSLOG _IOW ('X', 111, struct xfs_growfs_log)
487
#define XFS_IOC_FSGROWFSRT _IOW ('X', 112, struct xfs_growfs_rt)
488
#define XFS_IOC_FSCOUNTS _IOR ('X', 113, struct xfs_fsop_counts)
489
#define XFS_IOC_SET_RESBLKS _IOWR('X', 114, struct xfs_fsop_resblks)
490
#define XFS_IOC_GET_RESBLKS _IOR ('X', 115, struct xfs_fsop_resblks)
491
#define XFS_IOC_ERROR_INJECTION _IOW ('X', 116, struct xfs_error_injection)
492
#define XFS_IOC_ERROR_CLEARALL _IOW ('X', 117, struct xfs_error_injection)
493
/* XFS_IOC_ATTRCTL_BY_HANDLE -- deprecated 118 */
454
494
#define XFS_IOC_FREEZE _IOWR('X', 119, int)
455
495
#define XFS_IOC_THAW _IOWR('X', 120, int)
456
#define XFS_IOC_FSSETDM_BY_HANDLE _IOW ('X', 121, struct xfs_fsop_setdm_handlereq)
457
#define XFS_IOC_ATTRLIST_BY_HANDLE _IOW ('X', 122, struct xfs_fsop_attrlist_handlereq)
458
#define XFS_IOC_ATTRMULTI_BY_HANDLE _IOW ('X', 123, struct xfs_fsop_attrmulti_handlereq)
459
/* XFS_IOC_GETFSUUID ---------- deprecated 140 */
496
#define XFS_IOC_FSSETDM_BY_HANDLE _IOW ('X', 121, struct xfs_fsop_setdm_handlereq)
497
#define XFS_IOC_ATTRLIST_BY_HANDLE _IOW ('X', 122, struct xfs_fsop_attrlist_handlereq)
498
#define XFS_IOC_ATTRMULTI_BY_HANDLE _IOW ('X', 123, struct xfs_fsop_attrmulti_handlereq)
499
#define XFS_IOC_FSGEOMETRY _IOR ('X', 124, struct xfs_fsop_geom)
500
#define XFS_IOC_GOINGDOWN _IOR ('X', 125, __uint32_t)
501
/* XFS_IOC_GETFSUUID ---------- deprecated 140 */
504
#ifndef HAVE_BBMACROS
463
* Block I/O parameterization. A basic block (BB) is the lowest size of
506
* Block I/O parameterization. A basic block (BB) is the lowest size of
464
507
* filesystem allocation, and must equal 512. Length units given to bio
465
508
* routines are in BB's.
468
#define BBSIZE (1<<BBSHIFT)
469
#define BBMASK (BBSIZE-1)
470
#define BTOBB(bytes) (((__u64)(bytes) + BBSIZE - 1) >> BBSHIFT)
471
#define BTOBBT(bytes) ((__u64)(bytes) >> BBSHIFT)
472
#define BBTOB(bbs) ((bbs) << BBSHIFT)
473
#define OFFTOBB(bytes) (((__u64)(bytes) + BBSIZE - 1) >> BBSHIFT)
474
#define OFFTOBBT(bytes) ((__u64)(bytes) >> BBSHIFT)
475
#define BBTOOFF(bbs) ((__u64)(bbs) << BBSHIFT)
477
#define SEEKLIMIT32 0x7fffffff
478
#define BBSEEKLIMIT32 BTOBBT(SEEKLIMIT32)
479
#define SEEKLIMIT 0x7fffffffffffffffLL
480
#define BBSEEKLIMIT OFFTOBBT(SEEKLIMIT)
511
#define BBSIZE (1<<BBSHIFT)
512
#define BBMASK (BBSIZE-1)
513
#define BTOBB(bytes) (((__u64)(bytes) + BBSIZE - 1) >> BBSHIFT)
514
#define BTOBBT(bytes) ((__u64)(bytes) >> BBSHIFT)
515
#define BBTOB(bbs) ((bbs) << BBSHIFT)
482
#endif /* _LINUX_XFS_FS_H */
518
#endif /* __XFS_FS_H__ */