6b13f685e
김민수
BSP 최초 추가
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
|
#ifndef __XFS_FS_H__
#define __XFS_FS_H__
#ifndef HAVE_DIOATTR
struct dioattr {
__u32 d_mem;
__u32 d_miniosz;
__u32 d_maxiosz;
};
#endif
#ifndef HAVE_FSXATTR
struct fsxattr {
__u32 fsx_xflags;
__u32 fsx_extsize;
__u32 fsx_nextents;
__u32 fsx_projid;
unsigned char fsx_pad[12];
};
#endif
#define XFS_XFLAG_REALTIME 0x00000001 /* data in realtime volume */
#define XFS_XFLAG_PREALLOC 0x00000002 /* preallocated file extents */
#define XFS_XFLAG_IMMUTABLE 0x00000008 /* file cannot be modified */
#define XFS_XFLAG_APPEND 0x00000010 /* all writes append */
#define XFS_XFLAG_SYNC 0x00000020 /* all writes synchronous */
#define XFS_XFLAG_NOATIME 0x00000040 /* do not update access time */
#define XFS_XFLAG_NODUMP 0x00000080 /* do not include in backups */
#define XFS_XFLAG_RTINHERIT 0x00000100 /* create with rt bit set */
#define XFS_XFLAG_PROJINHERIT 0x00000200 /* create with parents projid */
#define XFS_XFLAG_NOSYMLINKS 0x00000400 /* disallow symlink creation */
#define XFS_XFLAG_EXTSIZE 0x00000800 /* extent size allocator hint */
#define XFS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */
#define XFS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */
#define XFS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */
#define XFS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */
#ifndef HAVE_GETBMAP
struct getbmap {
__s64 bmv_offset;
__s64 bmv_block;
__s64 bmv_length;
__s32 bmv_count;
__s32 bmv_entries;
};
#endif
#ifndef HAVE_GETBMAPX
struct getbmapx {
__s64 bmv_offset;
__s64 bmv_block;
__s64 bmv_length;
__s32 bmv_count;
__s32 bmv_entries;
__s32 bmv_iflags;
__s32 bmv_oflags;
__s32 bmv_unused1;
__s32 bmv_unused2;
};
#endif
#define BMV_IF_ATTRFORK 0x1 /* return attr fork rather than data */
#define BMV_IF_NO_DMAPI_READ 0x2 /* Do not generate DMAPI read event */
#define BMV_IF_PREALLOC 0x4 /* rtn status BMV_OF_PREALLOC if req */
#define BMV_IF_DELALLOC 0x8 /* rtn status BMV_OF_DELALLOC if req */
#define BMV_IF_NO_HOLES 0x10 /* Do not return holes */
#define BMV_IF_VALID \
(BMV_IF_ATTRFORK|BMV_IF_NO_DMAPI_READ|BMV_IF_PREALLOC| \
BMV_IF_DELALLOC|BMV_IF_NO_HOLES)
#define BMV_OF_PREALLOC 0x1 /* segment = unwritten pre-allocation */
#define BMV_OF_DELALLOC 0x2 /* segment = delayed allocation */
#define BMV_OF_LAST 0x4 /* segment is the last in the file */
#ifndef HAVE_FSDMIDATA
struct fsdmidata {
__u32 fsd_dmevmask;
__u16 fsd_padding;
__u16 fsd_dmstate;
};
#endif
typedef struct xfs_flock64 {
__s16 l_type;
__s16 l_whence;
__s64 l_start;
__s64 l_len;
__s32 l_sysid;
__u32 l_pid;
__s32 l_pad[4];
} xfs_flock64_t;
typedef struct xfs_fsop_geom_v1 {
__u32 blocksize;
__u32 rtextsize;
__u32 agblocks;
__u32 agcount;
__u32 logblocks;
__u32 sectsize;
__u32 inodesize;
__u32 imaxpct;
__u64 datablocks;
__u64 rtblocks;
__u64 rtextents;
__u64 logstart;
unsigned char uuid[16];
__u32 sunit;
__u32 swidth;
__s32 version;
__u32 flags;
__u32 logsectsize;
__u32 rtsectsize;
__u32 dirblocksize;
} xfs_fsop_geom_v1_t;
typedef struct xfs_fsop_geom {
__u32 blocksize;
__u32 rtextsize;
__u32 agblocks;
__u32 agcount;
__u32 logblocks;
__u32 sectsize;
__u32 inodesize;
__u32 imaxpct;
__u64 datablocks;
__u64 rtblocks;
__u64 rtextents;
__u64 logstart;
unsigned char uuid[16];
__u32 sunit;
__u32 swidth;
__s32 version;
__u32 flags;
__u32 logsectsize;
__u32 rtsectsize;
__u32 dirblocksize;
__u32 logsunit;
} xfs_fsop_geom_t;
typedef struct xfs_fsop_counts {
__u64 freedata;
__u64 freertx;
__u64 freeino;
__u64 allocino;
} xfs_fsop_counts_t;
typedef struct xfs_fsop_resblks {
__u64 resblks;
__u64 resblks_avail;
} xfs_fsop_resblks_t;
#define XFS_FSOP_GEOM_VERSION 0
#define XFS_FSOP_GEOM_FLAGS_ATTR 0x0001 /* attributes in use */
#define XFS_FSOP_GEOM_FLAGS_NLINK 0x0002 /* 32-bit nlink values */
#define XFS_FSOP_GEOM_FLAGS_QUOTA 0x0004 /* quotas enabled */
#define XFS_FSOP_GEOM_FLAGS_IALIGN 0x0008 /* inode alignment */
#define XFS_FSOP_GEOM_FLAGS_DALIGN 0x0010 /* large data alignment */
#define XFS_FSOP_GEOM_FLAGS_SHARED 0x0020 /* read-only shared */
#define XFS_FSOP_GEOM_FLAGS_EXTFLG 0x0040 /* special extent flag */
#define XFS_FSOP_GEOM_FLAGS_DIRV2 0x0080 /* directory version 2 */
#define XFS_FSOP_GEOM_FLAGS_LOGV2 0x0100 /* log format version 2 */
#define XFS_FSOP_GEOM_FLAGS_SECTOR 0x0200 /* sector sizes >1BB */
#define XFS_FSOP_GEOM_FLAGS_ATTR2 0x0400 /* inline attributes rework */
#define XFS_FSOP_GEOM_FLAGS_PROJID32 0x0800 /* 32-bit project IDs */
#define XFS_FSOP_GEOM_FLAGS_DIRV2CI 0x1000 /* ASCII only CI names */
#define XFS_FSOP_GEOM_FLAGS_LAZYSB 0x4000 /* lazy superblock counters */
#define XFS_FSOP_GEOM_FLAGS_V5SB 0x8000 /* version 5 superblock */
#define XFS_FSOP_GEOM_FLAGS_FTYPE 0x10000 /* inode directory types */
#define XFS_MIN_AG_BLOCKS 64
#define XFS_MIN_LOG_BLOCKS 512ULL
#define XFS_MAX_LOG_BLOCKS (1024 * 1024ULL)
#define XFS_MIN_LOG_BYTES (10 * 1024 * 1024ULL)
#define XFS_MAX_LOG_BYTES \
((2 * 1024 * 1024 * 1024ULL) - XFS_MIN_LOG_BYTES)
#define XFS_MAX_DBLOCKS(s) ((xfs_drfsbno_t)(s)->sb_agcount * (s)->sb_agblocks)
#define XFS_MIN_DBLOCKS(s) ((xfs_drfsbno_t)((s)->sb_agcount - 1) * \
(s)->sb_agblocks + XFS_MIN_AG_BLOCKS)
typedef struct xfs_growfs_data {
__u64 newblocks;
__u32 imaxpct;
} xfs_growfs_data_t;
typedef struct xfs_growfs_log {
__u32 newblocks;
__u32 isint;
} xfs_growfs_log_t;
typedef struct xfs_growfs_rt {
__u64 newblocks;
__u32 extsize;
} xfs_growfs_rt_t;
typedef struct xfs_bstime {
time_t tv_sec;
__s32 tv_nsec;
} xfs_bstime_t;
typedef struct xfs_bstat {
__u64 bs_ino;
__u16 bs_mode;
__u16 bs_nlink;
__u32 bs_uid;
__u32 bs_gid;
__u32 bs_rdev;
__s32 bs_blksize;
__s64 bs_size;
xfs_bstime_t bs_atime;
xfs_bstime_t bs_mtime;
xfs_bstime_t bs_ctime;
int64_t bs_blocks;
__u32 bs_xflags;
__s32 bs_extsize;
__s32 bs_extents;
__u32 bs_gen;
__u16 bs_projid_lo;
#define bs_projid bs_projid_lo /* (previously just bs_projid) */
__u16 bs_forkoff;
__u16 bs_projid_hi;
unsigned char bs_pad[10];
__u32 bs_dmevmask;
__u16 bs_dmstate;
__u16 bs_aextents;
} xfs_bstat_t;
static inline __uint32_t
bstat_get_projid(struct xfs_bstat *bs)
{
return (__uint32_t)bs->bs_projid_hi << 16 | bs->bs_projid_lo;
}
typedef struct xfs_fsop_bulkreq {
__u64 __user *lastip;
__s32 icount;
void __user *ubuffer;
__s32 __user *ocount;
} xfs_fsop_bulkreq_t;
typedef struct xfs_inogrp {
__u64 xi_startino;
__s32 xi_alloccount;
__u64 xi_allocmask;
} xfs_inogrp_t;
typedef struct xfs_error_injection {
__s32 fd;
__s32 errtag;
} xfs_error_injection_t;
#define XFS_EOFBLOCKS_VERSION 1
struct xfs_fs_eofblocks {
__u32 eof_version;
__u32 eof_flags;
uid_t eof_uid;
gid_t eof_gid;
prid_t eof_prid;
__u32 pad32;
__u64 eof_min_file_size;
__u64 pad64[12];
};
#define XFS_EOF_FLAGS_SYNC (1 << 0) /* sync/wait mode scan */
#define XFS_EOF_FLAGS_UID (1 << 1) /* filter by uid */
#define XFS_EOF_FLAGS_GID (1 << 2) /* filter by gid */
#define XFS_EOF_FLAGS_PRID (1 << 3) /* filter by project id */
#define XFS_EOF_FLAGS_MINFILESIZE (1 << 4) /* filter by min file size */
#define XFS_EOF_FLAGS_VALID \
(XFS_EOF_FLAGS_SYNC | \
XFS_EOF_FLAGS_UID | \
XFS_EOF_FLAGS_GID | \
XFS_EOF_FLAGS_PRID | \
XFS_EOF_FLAGS_MINFILESIZE)
typedef struct xfs_fsop_handlereq {
__u32 fd;
void __user *path;
__u32 oflags;
void __user *ihandle;
__u32 ihandlen;
void __user *ohandle;
__u32 __user *ohandlen;
} xfs_fsop_handlereq_t;
typedef struct xfs_fsop_setdm_handlereq {
struct xfs_fsop_handlereq hreq;
struct fsdmidata __user *data;
} xfs_fsop_setdm_handlereq_t;
typedef struct xfs_attrlist_cursor {
__u32 opaque[4];
} xfs_attrlist_cursor_t;
typedef struct xfs_fsop_attrlist_handlereq {
struct xfs_fsop_handlereq hreq;
struct xfs_attrlist_cursor pos;
__u32 flags;
__u32 buflen;
void __user *buffer;
} xfs_fsop_attrlist_handlereq_t;
typedef struct xfs_attr_multiop {
__u32 am_opcode;
#define ATTR_OP_GET 1 /* return the indicated attr's value */
#define ATTR_OP_SET 2 /* set/create the indicated attr/value pair */
#define ATTR_OP_REMOVE 3 /* remove the indicated attr */
__s32 am_error;
void __user *am_attrname;
void __user *am_attrvalue;
__u32 am_length;
__u32 am_flags;
} xfs_attr_multiop_t;
typedef struct xfs_fsop_attrmulti_handlereq {
struct xfs_fsop_handlereq hreq;
__u32 opcount;
struct xfs_attr_multiop __user *ops;
} xfs_fsop_attrmulti_handlereq_t;
typedef struct { __u32 val[2]; } xfs_fsid_t;
typedef struct xfs_fid {
__u16 fid_len;
__u16 fid_pad;
__u32 fid_gen;
__u64 fid_ino;
} xfs_fid_t;
typedef struct xfs_handle {
union {
__s64 align;
xfs_fsid_t _ha_fsid;
} ha_u;
xfs_fid_t ha_fid;
} xfs_handle_t;
#define ha_fsid ha_u._ha_fsid
#define XFS_HSIZE(handle) (((char *) &(handle).ha_fid.fid_pad \
- (char *) &(handle)) \
+ (handle).ha_fid.fid_len)
typedef struct xfs_swapext
{
__int64_t sx_version;
#define XFS_SX_VERSION 0
__int64_t sx_fdtarget;
__int64_t sx_fdtmp;
xfs_off_t sx_offset;
xfs_off_t sx_length;
char sx_pad[16];
xfs_bstat_t sx_stat;
} xfs_swapext_t;
#define XFS_FSOP_GOING_FLAGS_DEFAULT 0x0 /* going down */
#define XFS_FSOP_GOING_FLAGS_LOGFLUSH 0x1 /* flush log but not data */
#define XFS_FSOP_GOING_FLAGS_NOLOGFLUSH 0x2 /* don't flush log nor data */
#define XFS_IOC_GETXFLAGS FS_IOC_GETFLAGS
#define XFS_IOC_SETXFLAGS FS_IOC_SETFLAGS
#define XFS_IOC_GETVERSION FS_IOC_GETVERSION
#define XFS_IOC_ALLOCSP _IOW ('X', 10, struct xfs_flock64)
#define XFS_IOC_FREESP _IOW ('X', 11, struct xfs_flock64)
#define XFS_IOC_DIOINFO _IOR ('X', 30, struct dioattr)
#define XFS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr)
#define XFS_IOC_FSSETXATTR _IOW ('X', 32, struct fsxattr)
#define XFS_IOC_ALLOCSP64 _IOW ('X', 36, struct xfs_flock64)
#define XFS_IOC_FREESP64 _IOW ('X', 37, struct xfs_flock64)
#define XFS_IOC_GETBMAP _IOWR('X', 38, struct getbmap)
#define XFS_IOC_FSSETDM _IOW ('X', 39, struct fsdmidata)
#define XFS_IOC_RESVSP _IOW ('X', 40, struct xfs_flock64)
#define XFS_IOC_UNRESVSP _IOW ('X', 41, struct xfs_flock64)
#define XFS_IOC_RESVSP64 _IOW ('X', 42, struct xfs_flock64)
#define XFS_IOC_UNRESVSP64 _IOW ('X', 43, struct xfs_flock64)
#define XFS_IOC_GETBMAPA _IOWR('X', 44, struct getbmap)
#define XFS_IOC_FSGETXATTRA _IOR ('X', 45, struct fsxattr)
#define XFS_IOC_GETBMAPX _IOWR('X', 56, struct getbmap)
#define XFS_IOC_ZERO_RANGE _IOW ('X', 57, struct xfs_flock64)
#define XFS_IOC_FREE_EOFBLOCKS _IOR ('X', 58, struct xfs_fs_eofblocks)
#define XFS_IOC_FSGEOMETRY_V1 _IOR ('X', 100, struct xfs_fsop_geom_v1)
#define XFS_IOC_FSBULKSTAT _IOWR('X', 101, struct xfs_fsop_bulkreq)
#define XFS_IOC_FSBULKSTAT_SINGLE _IOWR('X', 102, struct xfs_fsop_bulkreq)
#define XFS_IOC_FSINUMBERS _IOWR('X', 103, struct xfs_fsop_bulkreq)
#define XFS_IOC_PATH_TO_FSHANDLE _IOWR('X', 104, struct xfs_fsop_handlereq)
#define XFS_IOC_PATH_TO_HANDLE _IOWR('X', 105, struct xfs_fsop_handlereq)
#define XFS_IOC_FD_TO_HANDLE _IOWR('X', 106, struct xfs_fsop_handlereq)
#define XFS_IOC_OPEN_BY_HANDLE _IOWR('X', 107, struct xfs_fsop_handlereq)
#define XFS_IOC_READLINK_BY_HANDLE _IOWR('X', 108, struct xfs_fsop_handlereq)
#define XFS_IOC_SWAPEXT _IOWR('X', 109, struct xfs_swapext)
#define XFS_IOC_FSGROWFSDATA _IOW ('X', 110, struct xfs_growfs_data)
#define XFS_IOC_FSGROWFSLOG _IOW ('X', 111, struct xfs_growfs_log)
#define XFS_IOC_FSGROWFSRT _IOW ('X', 112, struct xfs_growfs_rt)
#define XFS_IOC_FSCOUNTS _IOR ('X', 113, struct xfs_fsop_counts)
#define XFS_IOC_SET_RESBLKS _IOWR('X', 114, struct xfs_fsop_resblks)
#define XFS_IOC_GET_RESBLKS _IOR ('X', 115, struct xfs_fsop_resblks)
#define XFS_IOC_ERROR_INJECTION _IOW ('X', 116, struct xfs_error_injection)
#define XFS_IOC_ERROR_CLEARALL _IOW ('X', 117, struct xfs_error_injection)
#ifndef FIFREEZE
#define XFS_IOC_FREEZE _IOWR('X', 119, int)
#define XFS_IOC_THAW _IOWR('X', 120, int)
#endif
#define XFS_IOC_FSSETDM_BY_HANDLE _IOW ('X', 121, struct xfs_fsop_setdm_handlereq)
#define XFS_IOC_ATTRLIST_BY_HANDLE _IOW ('X', 122, struct xfs_fsop_attrlist_handlereq)
#define XFS_IOC_ATTRMULTI_BY_HANDLE _IOW ('X', 123, struct xfs_fsop_attrmulti_handlereq)
#define XFS_IOC_FSGEOMETRY _IOR ('X', 124, struct xfs_fsop_geom)
#define XFS_IOC_GOINGDOWN _IOR ('X', 125, __uint32_t)
#ifndef HAVE_BBMACROS
#define BBSHIFT 9
#define BBSIZE (1<<BBSHIFT)
#define BBMASK (BBSIZE-1)
#define BTOBB(bytes) (((__u64)(bytes) + BBSIZE - 1) >> BBSHIFT)
#define BTOBBT(bytes) ((__u64)(bytes) >> BBSHIFT)
#define BBTOB(bbs) ((bbs) << BBSHIFT)
#endif
#endif /* __XFS_FS_H__ */
|