~ubuntu-branches/ubuntu/edgy/xfsprogs/edgy

« back to all changes in this revision

Viewing changes to include/xfs_fs.h

  • Committer: Bazaar Package Importer
  • Author(s): Nathan Scott
  • Date: 2004-07-28 21:11:38 UTC
  • Revision ID: james.westby@ubuntu.com-20040728211138-0v4pdnunnp7na5lm
Tags: 2.6.20-1
* New upstream release.
* Fix xfs_io segfault on non-XFS files.  (closes: #260470)
* Fix packaging botch, deleted files included.  (closes: #260491)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (c) 1995-2001 Silicon Graphics, Inc.  All Rights Reserved.
 
2
 * Copyright (c) 1995-2004 Silicon Graphics, Inc.  All Rights Reserved.
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify it
5
5
 * under the terms of version 2.1 of the GNU Lesser General Public License
11
11
 *
12
12
 * Further, this software is distributed without any warranty that it is
13
13
 * free of the rightful claim of any third person regarding infringement
14
 
 * or the like.  Any license provided herein, whether implied or
 
14
 * or the like.  Any license provided herein, whether implied or
15
15
 * otherwise, applies only to this software file.  Patent licenses, if
16
16
 * any, provided herein do not apply to combinations of this program with
17
17
 * other software, or any other product whatsoever.
30
30
 *
31
31
 * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
32
32
 */
33
 
#ifndef _LINUX_XFS_FS_H
34
 
#define _LINUX_XFS_FS_H
35
 
 
36
 
#include <linux/types.h>
37
 
#include <asm/ioctl.h>
38
 
 
 
33
#ifndef __XFS_FS_H__
 
34
#define __XFS_FS_H__
39
35
 
40
36
/*
41
37
 * SGI's XFS filesystem's major stuff (constants, structures)
42
38
 */
43
39
 
44
 
#define XFS_SUPER_MAGIC 0x58465342
45
40
#define XFS_NAME        "xfs"
46
41
 
47
 
/* 
 
42
/*
48
43
 * Direct I/O attribute record used with XFS_IOC_DIOINFO
49
44
 * d_miniosz is the min xfer size, xfer size multiple and file seek offset
50
45
 * alignment.
51
46
 */
 
47
#ifndef HAVE_DIOATTR
52
48
struct dioattr {
53
 
        __u32           d_mem;          /* data buffer memory alignment */
 
49
        __u32           d_mem;          /* data buffer memory alignment */
54
50
        __u32           d_miniosz;      /* min xfer size                */
55
51
        __u32           d_maxiosz;      /* max xfer size                */
56
52
};
 
53
#endif
57
54
 
58
55
/*
59
56
 * Structure for XFS_IOC_FSGETXATTR[A] and XFS_IOC_FSSETXATTR.
60
57
 */
 
58
#ifndef HAVE_FSXATTR
61
59
struct fsxattr {
62
 
        __u32           fsx_xflags;     /* xflags field value (get/set) */
63
 
        __u32           fsx_extsize;    /* extsize field value (get/set)*/
64
 
        __u32           fsx_nextents;   /* nextents field value (get)   */
 
60
        __u32           fsx_xflags;     /* xflags field value (get/set) */
 
61
        __u32           fsx_extsize;    /* extsize field value (get/set)*/
 
62
        __u32           fsx_nextents;   /* nextents field value (get)   */
65
63
        unsigned char   fsx_pad[16];
66
64
};
 
65
#endif
67
66
 
68
67
/*
69
68
 * Flags for the bs_xflags/fsx_xflags field
70
69
 * There should be a one-to-one correspondence between these flags and the
71
70
 * XFS_DIFLAG_s.
72
71
 */
73
 
#define XFS_XFLAG_REALTIME      0x00000001
74
 
#define XFS_XFLAG_PREALLOC      0x00000002
75
 
#define XFS_XFLAG_HASATTR       0x80000000      /* no DIFLAG for this   */
76
 
#define XFS_XFLAG_ALL           \
77
 
        ( XFS_XFLAG_REALTIME|XFS_XFLAG_PREALLOC|XFS_XFLAG_HASATTR )
78
 
 
 
72
#define XFS_XFLAG_REALTIME      0x00000001      /* data in realtime volume */
 
73
#define XFS_XFLAG_PREALLOC      0x00000002      /* preallocated file extents */
 
74
#define XFS_XFLAG_IMMUTABLE     0x00000008      /* file cannot be modified */
 
75
#define XFS_XFLAG_APPEND        0x00000010      /* all writes append */
 
76
#define XFS_XFLAG_SYNC          0x00000020      /* all writes synchronous */
 
77
#define XFS_XFLAG_NOATIME       0x00000040      /* do not update access time */
 
78
#define XFS_XFLAG_NODUMP        0x00000080      /* do not include in backups */
 
79
#define XFS_XFLAG_HASATTR       0x80000000      /* no DIFLAG for this   */
79
80
 
80
81
/*
81
82
 * Structure for XFS_IOC_GETBMAP.
84
85
 * number of array elements given.  The first structure is updated on
85
86
 * return to give the offset and length for the next call.
86
87
 */
 
88
#ifndef HAVE_GETBMAP
87
89
struct getbmap {
88
90
        __s64           bmv_offset;     /* file offset of segment in blocks */
89
91
        __s64           bmv_block;      /* starting block (64-bit daddr_t)  */
91
93
        __s32           bmv_count;      /* # of entries in array incl. 1st  */
92
94
        __s32           bmv_entries;    /* # of entries filled in (output)  */
93
95
};
 
96
#endif
94
97
 
95
98
/*
96
 
 *      Structure for XFS_IOC_GETBMAPX.  Fields bmv_offset through bmv_entries
 
99
 *      Structure for XFS_IOC_GETBMAPX.  Fields bmv_offset through bmv_entries
97
100
 *      are used exactly as in the getbmap structure.  The getbmapx structure
98
101
 *      has additional bmv_iflags and bmv_oflags fields. The bmv_iflags field
99
 
 *      is only used for the first structure.  It contains input flags 
 
102
 *      is only used for the first structure.  It contains input flags
100
103
 *      specifying XFS_IOC_GETBMAPX actions.  The bmv_oflags field is filled
101
104
 *      in by the XFS_IOC_GETBMAPX command for each returned structure after
102
105
 *      the first.
103
106
 */
 
107
#ifndef HAVE_GETBMAPX
104
108
struct getbmapx {
105
109
        __s64           bmv_offset;     /* file offset of segment in blocks */
106
110
        __s64           bmv_block;      /* starting block (64-bit daddr_t)  */
112
116
        __s32           bmv_unused1;    /* future use                       */
113
117
        __s32           bmv_unused2;    /* future use                       */
114
118
};
 
119
#endif
115
120
 
116
121
/*      bmv_iflags values - set by XFS_IOC_GETBMAPX caller.     */
117
 
#define BMV_IF_ATTRFORK         0x1     /* return attr fork rather than data */
 
122
#define BMV_IF_ATTRFORK         0x1     /* return attr fork rather than data */
118
123
#define BMV_IF_NO_DMAPI_READ    0x2     /* Do not generate DMAPI read event  */
119
124
#define BMV_IF_PREALLOC         0x4     /* rtn status BMV_OF_PREALLOC if req */
120
125
#define BMV_IF_VALID    (BMV_IF_ATTRFORK|BMV_IF_NO_DMAPI_READ|BMV_IF_PREALLOC)
121
126
#ifdef __KERNEL__
122
 
#define BMV_IF_EXTENDED 0x40000000      /* getpmapx if set */
 
127
#define BMV_IF_EXTENDED 0x40000000      /* getpmapx if set */
123
128
#endif
124
129
 
125
130
/*      bmv_oflags values - returned for for each non-header segment */
126
131
#define BMV_OF_PREALLOC         0x1     /* segment = unwritten pre-allocation */
127
132
 
128
133
/*      Convert getbmap <-> getbmapx - move fields from p1 to p2. */
129
 
#define GETBMAP_CONVERT(p1,p2) {        \
 
134
#define GETBMAP_CONVERT(p1,p2) {        \
130
135
        p2.bmv_offset = p1.bmv_offset;  \
131
136
        p2.bmv_block = p1.bmv_block;    \
132
137
        p2.bmv_length = p1.bmv_length;  \
141
146
 * only values previously obtained via xfs_bulkstat!  (Specifically the
142
147
 * xfs_bstat_t fields bs_dmevmask and bs_dmstate.)
143
148
 */
 
149
#ifndef HAVE_FSDMIDATA
144
150
struct fsdmidata {
145
151
        __u32           fsd_dmevmask;   /* corresponds to di_dmevmask */
146
152
        __u16           fsd_padding;
147
153
        __u16           fsd_dmstate;    /* corresponds to di_dmstate  */
148
154
};
 
155
#endif
149
156
 
150
157
/*
151
158
 * File segment locking set data type for 64 bit access.
156
163
        __s16           l_whence;
157
164
        __s64           l_start;
158
165
        __s64           l_len;          /* len == 0 means until end of file */
159
 
        __s32           l_sysid;
160
 
        pid_t           l_pid;
 
166
        __s32           l_sysid;
 
167
        pid_t           l_pid;
161
168
        __s32           l_pad[4];       /* reserve area                     */
162
169
} xfs_flock64_t;
163
170
 
164
171
/*
 
172
 * Output for XFS_IOC_FSGEOMETRY_V1
 
173
 */
 
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;
 
196
 
 
197
/*
165
198
 * Output for XFS_IOC_FSGEOMETRY
166
199
 */
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          */
185
218
        __u32           logsectsize;    /* log sector size, bytes       */
186
219
        __u32           rtsectsize;     /* realtime sector size, bytes  */
187
220
        __u32           dirblocksize;   /* directory block size, bytes  */
 
221
        __u32           logsunit;       /* log stripe unit, bytes */
188
222
} xfs_fsop_geom_t;
189
223
 
190
224
/* Output for XFS_FS_COUNTS */
201
235
        __u64  resblks_avail;
202
236
} xfs_fsop_resblks_t;
203
237
 
204
 
#define XFS_FSOP_GEOM_VERSION   0
 
238
#define XFS_FSOP_GEOM_VERSION   0
205
239
 
206
 
#define XFS_FSOP_GEOM_FLAGS_ATTR        0x01    /* attributes in use    */
207
 
#define XFS_FSOP_GEOM_FLAGS_NLINK       0x02    /* 32-bit nlink values  */
208
 
#define XFS_FSOP_GEOM_FLAGS_QUOTA       0x04    /* quotas enabled       */
209
 
#define XFS_FSOP_GEOM_FLAGS_IALIGN      0x08    /* inode alignment      */
210
 
#define XFS_FSOP_GEOM_FLAGS_DALIGN      0x10    /* large data alignment */
211
 
#define XFS_FSOP_GEOM_FLAGS_SHARED      0x20    /* read-only shared     */
212
 
#define XFS_FSOP_GEOM_FLAGS_EXTFLG      0x40    /* special extent flag  */
213
 
#define XFS_FSOP_GEOM_FLAGS_DIRV2       0x80    /* directory version 2  */
 
240
#define XFS_FSOP_GEOM_FLAGS_ATTR        0x0001  /* attributes in use    */
 
241
#define XFS_FSOP_GEOM_FLAGS_NLINK       0x0002  /* 32-bit nlink values  */
 
242
#define XFS_FSOP_GEOM_FLAGS_QUOTA       0x0004  /* quotas enabled       */
 
243
#define XFS_FSOP_GEOM_FLAGS_IALIGN      0x0008  /* inode alignment      */
 
244
#define XFS_FSOP_GEOM_FLAGS_DALIGN      0x0010  /* large data alignment */
 
245
#define XFS_FSOP_GEOM_FLAGS_SHARED      0x0020  /* read-only shared     */
 
246
#define XFS_FSOP_GEOM_FLAGS_EXTFLG      0x0040  /* special extent flag  */
 
247
#define XFS_FSOP_GEOM_FLAGS_DIRV2       0x0080  /* directory version 2  */
 
248
#define XFS_FSOP_GEOM_FLAGS_LOGV2       0x0100  /* log format version 2 */
 
249
#define XFS_FSOP_GEOM_FLAGS_SECTOR      0x0200  /* sector sizes >1BB    */
214
250
 
215
251
 
216
252
/*
217
253
 * Minimum and maximum sizes need for growth checks
218
254
 */
219
 
#define XFS_MIN_AG_BLOCKS       64
220
 
#define XFS_MIN_LOG_BLOCKS      512
221
 
#define XFS_MAX_LOG_BLOCKS      (64 * 1024)
222
 
#define XFS_MIN_LOG_BYTES       (256 * 1024)
223
 
#define XFS_MAX_LOG_BYTES       (128 * 1024 * 1024)
 
255
#define XFS_MIN_AG_BLOCKS       64
 
256
#define XFS_MIN_LOG_BLOCKS      512
 
257
#define XFS_MAX_LOG_BLOCKS      (64 * 1024)
 
258
#define XFS_MIN_LOG_BYTES       (256 * 1024)
 
259
#define XFS_MAX_LOG_BYTES       (128 * 1024 * 1024)
224
260
 
225
261
/*
226
262
 * Structures for XFS_IOC_FSGROWFSDATA, XFS_IOC_FSGROWFSLOG & XFS_IOC_FSGROWFSRT
298
334
 * Error injection.
299
335
 */
300
336
typedef struct xfs_error_injection {
301
 
        __s32           fd;
302
 
        __s32           errtag;
 
337
        __s32           fd;
 
338
        __s32           errtag;
303
339
} xfs_error_injection_t;
304
340
 
305
341
 
320
356
 * Compound structures for passing args through Handle Request interfaces
321
357
 * xfs_fssetdm_by_handle, xfs_attrlist_by_handle, xfs_attrmulti_by_handle
322
358
 * - ioctls: XFS_IOC_FSSETDM_BY_HANDLE, XFS_IOC_ATTRLIST_BY_HANDLE, and
323
 
 *           XFS_IOC_ATTRMULTI_BY_HANDLE
 
359
 *           XFS_IOC_ATTRMULTI_BY_HANDLE
324
360
 */
325
361
 
326
362
typedef struct xfs_fsop_setdm_handlereq {
327
363
        struct xfs_fsop_handlereq hreq; /* handle interface structure */
328
 
        struct fsdmidata *data;         /* DMAPI data to set          */
 
364
        struct fsdmidata *data;         /* DMAPI data to set          */
329
365
} xfs_fsop_setdm_handlereq_t;
330
366
 
331
367
typedef struct xfs_attrlist_cursor {
335
371
typedef struct xfs_fsop_attrlist_handlereq {
336
372
        struct xfs_fsop_handlereq hreq; /* handle interface structure */
337
373
        struct xfs_attrlist_cursor pos; /* opaque cookie, list offset */
338
 
        __u32 flags;                    /* flags, use ROOT/USER names */
339
 
        __u32 buflen;                   /* length of buffer supplied  */
340
 
        void *buffer;                   /* attrlist data to return    */
 
374
        __u32 flags;                    /* flags, use ROOT/USER names */
 
375
        __u32 buflen;                   /* length of buffer supplied  */
 
376
        void *buffer;                   /* attrlist data to return    */
341
377
} xfs_fsop_attrlist_handlereq_t;
342
378
 
343
379
typedef struct xfs_attr_multiop {
351
387
 
352
388
typedef struct xfs_fsop_attrmulti_handlereq {
353
389
        struct xfs_fsop_handlereq hreq; /* handle interface structure */
354
 
        __u32 opcount;                  /* count of following multiop */
355
 
        struct xfs_attr_multiop *ops;   /* attr_multi data to get/set */
 
390
        __u32 opcount;                  /* count of following multiop */
 
391
        struct xfs_attr_multiop *ops;   /* attr_multi data to get/set */
356
392
} xfs_fsop_attrmulti_handlereq_t;
357
393
 
358
394
/*
359
 
 * File system identifier. Should be unique (at least per machine).
360
 
 */
361
 
typedef struct {
362
 
        __u32 val[2];                   /* file system id type */
363
 
} xfs_fsid_t;
364
 
 
365
 
/*
366
 
 * File identifier.  Should be unique per filesystem on a single machine.
367
 
 * This is typically called by a stateless file server in order to generate
368
 
 * "file handles".
369
 
 */
370
 
#define MAXFIDSZ        46
 
395
 * per machine unique filesystem identifier types.
 
396
 */
 
397
typedef struct { __u32 val[2]; } xfs_fsid_t; /* file system id type */
 
398
 
 
399
 
 
400
#ifndef HAVE_FID
 
401
#define MAXFIDSZ        46
 
402
 
371
403
typedef struct fid {
372
404
        __u16           fid_len;                /* length of data in bytes */
373
 
        unsigned char   fid_data[MAXFIDSZ];     /* data (variable length)  */
 
405
        unsigned char   fid_data[MAXFIDSZ];     /* data (fid_len worth)  */
374
406
} fid_t;
 
407
#endif
375
408
 
376
409
typedef struct xfs_fid {
377
410
        __u16   xfs_fid_len;            /* length of remainder  */
378
411
        __u16   xfs_fid_pad;
379
412
        __u32   xfs_fid_gen;            /* generation number    */
380
 
        __u64   xfs_fid_ino;            /* 64 bits inode number */
 
413
        __u64   xfs_fid_ino;            /* 64 bits inode number */
381
414
} xfs_fid_t;
382
415
 
383
416
typedef struct xfs_fid2 {
392
425
                __s64       align;      /* force alignment of ha_fid     */
393
426
                xfs_fsid_t  _ha_fsid;   /* unique file system identifier */
394
427
        } ha_u;
395
 
        xfs_fid_t       ha_fid;         /* file system specific file ID  */
 
428
        xfs_fid_t       ha_fid;         /* file system specific file ID  */
396
429
} xfs_handle_t;
397
430
#define ha_fsid ha_u._ha_fsid
398
431
 
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)
402
435
 
403
 
#define XFS_HANDLE_CMP(h1, h2)  bcmp(h1, h2, sizeof (xfs_handle_t))
404
 
 
405
 
#define FSHSIZE         sizeof (fsid_t)
406
 
 
407
 
 
 
436
#define XFS_HANDLE_CMP(h1, h2)  memcmp(h1, h2, sizeof(xfs_handle_t))
 
437
 
 
438
#define FSHSIZE         sizeof(fsid_t)
 
439
 
 
440
/* 
 
441
 * Flags for going down operation
 
442
 */
 
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 */
 
446
 
 
447
#ifndef HAVE_IOCMACROS
408
448
/*
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.
412
452
 */
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)
431
471
 
432
472
/*
433
473
 * ioctl commands that replace IRIX syssgi()'s
434
474
 */
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      */
460
 
 
461
 
 
 
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      */
 
502
#endif
 
503
 
 
504
#ifndef HAVE_BBMACROS
462
505
/*
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.
466
509
 */
467
 
#define BBSHIFT         9
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)     
476
 
     
477
 
#define SEEKLIMIT32     0x7fffffff
478
 
#define BBSEEKLIMIT32   BTOBBT(SEEKLIMIT32)
479
 
#define SEEKLIMIT       0x7fffffffffffffffLL
480
 
#define BBSEEKLIMIT     OFFTOBBT(SEEKLIMIT)     
 
510
#define BBSHIFT         9
 
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)
 
516
#endif
481
517
 
482
 
#endif  /* _LINUX_XFS_FS_H */
 
518
#endif  /* __XFS_FS_H__ */