1
2
3
4
5
6#ifndef __XFS_LOG_FORMAT_H__
7#define __XFS_LOG_FORMAT_H__
8
9struct xfs_mount;
10struct xfs_trans_res;
11
12
13
14
15
16
17
18
19
20
21
22typedef uint32_t xlog_tid_t;
23
24#define XLOG_MIN_ICLOGS 2
25#define XLOG_MAX_ICLOGS 8
26#define XLOG_HEADER_MAGIC_NUM 0xFEEDbabe
27#define XLOG_VERSION_1 1
28#define XLOG_VERSION_2 2
29#define XLOG_VERSION_OKBITS (XLOG_VERSION_1 | XLOG_VERSION_2)
30#define XLOG_MIN_RECORD_BSIZE (16*1024)
31#define XLOG_BIG_RECORD_BSIZE (32*1024)
32#define XLOG_MAX_RECORD_BSIZE (256*1024)
33#define XLOG_HEADER_CYCLE_SIZE (32*1024)
34#define XLOG_MIN_RECORD_BSHIFT 14
35#define XLOG_BIG_RECORD_BSHIFT 15
36#define XLOG_MAX_RECORD_BSHIFT 18
37
38#define XLOG_HEADER_SIZE 512
39
40
41#define XFS_MIN_LOG_FACTOR 3
42
43#define XLOG_REC_SHIFT(log) \
44 BTOBB(1 << (xfs_has_logv2(log->l_mp) ? \
45 XLOG_MAX_RECORD_BSHIFT : XLOG_BIG_RECORD_BSHIFT))
46#define XLOG_TOTAL_REC_SHIFT(log) \
47 BTOBB(XLOG_MAX_ICLOGS << (xfs_has_logv2(log->l_mp) ? \
48 XLOG_MAX_RECORD_BSHIFT : XLOG_BIG_RECORD_BSHIFT))
49
50
51#define CYCLE_LSN(lsn) ((uint)((lsn)>>32))
52#define BLOCK_LSN(lsn) ((uint)(lsn))
53
54
55#define CYCLE_LSN_DISK(lsn) (((__be32 *)&(lsn))[0])
56
57static inline xfs_lsn_t xlog_assign_lsn(uint cycle, uint block)
58{
59 return ((xfs_lsn_t)cycle << 32) | block;
60}
61
62static inline uint xlog_get_cycle(char *ptr)
63{
64 if (be32_to_cpu(*(__be32 *)ptr) == XLOG_HEADER_MAGIC_NUM)
65 return be32_to_cpu(*((__be32 *)ptr + 1));
66 else
67 return be32_to_cpu(*(__be32 *)ptr);
68}
69
70
71#define XFS_TRANSACTION 0x69
72#define XFS_VOLUME 0x2
73#define XFS_LOG 0xaa
74
75#define XLOG_UNMOUNT_TYPE 0x556e
76
77
78
79
80
81
82
83
84struct xfs_unmount_log_format {
85 uint16_t magic;
86 uint16_t pad1;
87 uint32_t pad2;
88};
89
90
91#define XLOG_REG_TYPE_BFORMAT 1
92#define XLOG_REG_TYPE_BCHUNK 2
93#define XLOG_REG_TYPE_EFI_FORMAT 3
94#define XLOG_REG_TYPE_EFD_FORMAT 4
95#define XLOG_REG_TYPE_IFORMAT 5
96#define XLOG_REG_TYPE_ICORE 6
97#define XLOG_REG_TYPE_IEXT 7
98#define XLOG_REG_TYPE_IBROOT 8
99#define XLOG_REG_TYPE_ILOCAL 9
100#define XLOG_REG_TYPE_IATTR_EXT 10
101#define XLOG_REG_TYPE_IATTR_BROOT 11
102#define XLOG_REG_TYPE_IATTR_LOCAL 12
103#define XLOG_REG_TYPE_QFORMAT 13
104#define XLOG_REG_TYPE_DQUOT 14
105#define XLOG_REG_TYPE_QUOTAOFF 15
106#define XLOG_REG_TYPE_LRHEADER 16
107#define XLOG_REG_TYPE_UNMOUNT 17
108#define XLOG_REG_TYPE_COMMIT 18
109#define XLOG_REG_TYPE_TRANSHDR 19
110#define XLOG_REG_TYPE_ICREATE 20
111#define XLOG_REG_TYPE_RUI_FORMAT 21
112#define XLOG_REG_TYPE_RUD_FORMAT 22
113#define XLOG_REG_TYPE_CUI_FORMAT 23
114#define XLOG_REG_TYPE_CUD_FORMAT 24
115#define XLOG_REG_TYPE_BUI_FORMAT 25
116#define XLOG_REG_TYPE_BUD_FORMAT 26
117#define XLOG_REG_TYPE_MAX 26
118
119
120
121
122
123
124
125
126
127
128
129
130#define XLOG_START_TRANS 0x01
131#define XLOG_COMMIT_TRANS 0x02
132#define XLOG_CONTINUE_TRANS 0x04
133#define XLOG_WAS_CONT_TRANS 0x08
134#define XLOG_END_TRANS 0x10
135#define XLOG_UNMOUNT_TRANS 0x20
136
137
138typedef struct xlog_op_header {
139 __be32 oh_tid;
140 __be32 oh_len;
141 __u8 oh_clientid;
142 __u8 oh_flags;
143 __u16 oh_res2;
144} xlog_op_header_t;
145
146
147#define XLOG_FMT_UNKNOWN 0
148#define XLOG_FMT_LINUX_LE 1
149#define XLOG_FMT_LINUX_BE 2
150#define XLOG_FMT_IRIX_BE 3
151
152
153#ifdef XFS_NATIVE_HOST
154#define XLOG_FMT XLOG_FMT_LINUX_BE
155#else
156#define XLOG_FMT XLOG_FMT_LINUX_LE
157#endif
158
159typedef struct xlog_rec_header {
160 __be32 h_magicno;
161 __be32 h_cycle;
162 __be32 h_version;
163 __be32 h_len;
164 __be64 h_lsn;
165 __be64 h_tail_lsn;
166 __le32 h_crc;
167 __be32 h_prev_block;
168 __be32 h_num_logops;
169 __be32 h_cycle_data[XLOG_HEADER_CYCLE_SIZE / BBSIZE];
170
171 __be32 h_fmt;
172 uuid_t h_fs_uuid;
173 __be32 h_size;
174} xlog_rec_header_t;
175
176typedef struct xlog_rec_ext_header {
177 __be32 xh_cycle;
178 __be32 xh_cycle_data[XLOG_HEADER_CYCLE_SIZE / BBSIZE];
179} xlog_rec_ext_header_t;
180
181
182
183
184typedef union xlog_in_core2 {
185 xlog_rec_header_t hic_header;
186 xlog_rec_ext_header_t hic_xheader;
187 char hic_sector[XLOG_HEADER_SIZE];
188} xlog_in_core_2_t;
189
190
191typedef struct xfs_log_iovec {
192 void *i_addr;
193 int i_len;
194 uint i_type;
195} xfs_log_iovec_t;
196
197
198
199
200
201
202
203
204
205
206
207
208
209typedef struct xfs_trans_header {
210 uint th_magic;
211 uint th_type;
212 int32_t th_tid;
213 uint th_num_items;
214} xfs_trans_header_t;
215
216#define XFS_TRANS_HEADER_MAGIC 0x5452414e
217
218
219
220
221#define XFS_TRANS_CHECKPOINT 40
222
223
224
225
226#define XFS_LI_EFI 0x1236
227#define XFS_LI_EFD 0x1237
228#define XFS_LI_IUNLINK 0x1238
229#define XFS_LI_INODE 0x123b
230#define XFS_LI_BUF 0x123c
231#define XFS_LI_DQUOT 0x123d
232#define XFS_LI_QUOTAOFF 0x123e
233#define XFS_LI_ICREATE 0x123f
234#define XFS_LI_RUI 0x1240
235#define XFS_LI_RUD 0x1241
236#define XFS_LI_CUI 0x1242
237#define XFS_LI_CUD 0x1243
238#define XFS_LI_BUI 0x1244
239#define XFS_LI_BUD 0x1245
240
241#define XFS_LI_TYPE_DESC \
242 { XFS_LI_EFI, "XFS_LI_EFI" }, \
243 { XFS_LI_EFD, "XFS_LI_EFD" }, \
244 { XFS_LI_IUNLINK, "XFS_LI_IUNLINK" }, \
245 { XFS_LI_INODE, "XFS_LI_INODE" }, \
246 { XFS_LI_BUF, "XFS_LI_BUF" }, \
247 { XFS_LI_DQUOT, "XFS_LI_DQUOT" }, \
248 { XFS_LI_QUOTAOFF, "XFS_LI_QUOTAOFF" }, \
249 { XFS_LI_ICREATE, "XFS_LI_ICREATE" }, \
250 { XFS_LI_RUI, "XFS_LI_RUI" }, \
251 { XFS_LI_RUD, "XFS_LI_RUD" }, \
252 { XFS_LI_CUI, "XFS_LI_CUI" }, \
253 { XFS_LI_CUD, "XFS_LI_CUD" }, \
254 { XFS_LI_BUI, "XFS_LI_BUI" }, \
255 { XFS_LI_BUD, "XFS_LI_BUD" }
256
257
258
259
260
261
262
263
264
265struct xfs_inode_log_format {
266 uint16_t ilf_type;
267 uint16_t ilf_size;
268 uint32_t ilf_fields;
269 uint16_t ilf_asize;
270 uint16_t ilf_dsize;
271 uint32_t ilf_pad;
272 uint64_t ilf_ino;
273 union {
274 uint32_t ilfu_rdev;
275 uint8_t __pad[16];
276 } ilf_u;
277 int64_t ilf_blkno;
278 int32_t ilf_len;
279 int32_t ilf_boffset;
280};
281
282
283
284
285
286
287struct xfs_inode_log_format_32 {
288 uint16_t ilf_type;
289 uint16_t ilf_size;
290 uint32_t ilf_fields;
291 uint16_t ilf_asize;
292 uint16_t ilf_dsize;
293 uint64_t ilf_ino;
294 union {
295 uint32_t ilfu_rdev;
296 uint8_t __pad[16];
297 } ilf_u;
298 int64_t ilf_blkno;
299 int32_t ilf_len;
300 int32_t ilf_boffset;
301} __attribute__((packed));
302
303
304
305
306
307#define XFS_ILOG_CORE 0x001
308#define XFS_ILOG_DDATA 0x002
309#define XFS_ILOG_DEXT 0x004
310#define XFS_ILOG_DBROOT 0x008
311#define XFS_ILOG_DEV 0x010
312#define XFS_ILOG_UUID 0x020
313#define XFS_ILOG_ADATA 0x040
314#define XFS_ILOG_AEXT 0x080
315#define XFS_ILOG_ABROOT 0x100
316#define XFS_ILOG_DOWNER 0x200
317#define XFS_ILOG_AOWNER 0x400
318
319
320
321
322
323
324
325
326#define XFS_ILOG_TIMESTAMP 0x4000
327
328#define XFS_ILOG_NONCORE (XFS_ILOG_DDATA | XFS_ILOG_DEXT | \
329 XFS_ILOG_DBROOT | XFS_ILOG_DEV | \
330 XFS_ILOG_ADATA | XFS_ILOG_AEXT | \
331 XFS_ILOG_ABROOT | XFS_ILOG_DOWNER | \
332 XFS_ILOG_AOWNER)
333
334#define XFS_ILOG_DFORK (XFS_ILOG_DDATA | XFS_ILOG_DEXT | \
335 XFS_ILOG_DBROOT)
336
337#define XFS_ILOG_AFORK (XFS_ILOG_ADATA | XFS_ILOG_AEXT | \
338 XFS_ILOG_ABROOT)
339
340#define XFS_ILOG_ALL (XFS_ILOG_CORE | XFS_ILOG_DDATA | \
341 XFS_ILOG_DEXT | XFS_ILOG_DBROOT | \
342 XFS_ILOG_DEV | XFS_ILOG_ADATA | \
343 XFS_ILOG_AEXT | XFS_ILOG_ABROOT | \
344 XFS_ILOG_TIMESTAMP | XFS_ILOG_DOWNER | \
345 XFS_ILOG_AOWNER)
346
347static inline int xfs_ilog_fbroot(int w)
348{
349 return (w == XFS_DATA_FORK ? XFS_ILOG_DBROOT : XFS_ILOG_ABROOT);
350}
351
352static inline int xfs_ilog_fext(int w)
353{
354 return (w == XFS_DATA_FORK ? XFS_ILOG_DEXT : XFS_ILOG_AEXT);
355}
356
357static inline int xfs_ilog_fdata(int w)
358{
359 return (w == XFS_DATA_FORK ? XFS_ILOG_DDATA : XFS_ILOG_ADATA);
360}
361
362
363
364
365
366
367
368typedef uint64_t xfs_log_timestamp_t;
369
370
371struct xfs_log_legacy_timestamp {
372 int32_t t_sec;
373 int32_t t_nsec;
374};
375
376
377
378
379
380struct xfs_log_dinode {
381 uint16_t di_magic;
382 uint16_t di_mode;
383 int8_t di_version;
384 int8_t di_format;
385 uint8_t di_pad3[2];
386 uint32_t di_uid;
387 uint32_t di_gid;
388 uint32_t di_nlink;
389 uint16_t di_projid_lo;
390 uint16_t di_projid_hi;
391 uint8_t di_pad[6];
392 uint16_t di_flushiter;
393 xfs_log_timestamp_t di_atime;
394 xfs_log_timestamp_t di_mtime;
395 xfs_log_timestamp_t di_ctime;
396 xfs_fsize_t di_size;
397 xfs_rfsblock_t di_nblocks;
398 xfs_extlen_t di_extsize;
399 xfs_extnum_t di_nextents;
400 xfs_aextnum_t di_anextents;
401 uint8_t di_forkoff;
402 int8_t di_aformat;
403 uint32_t di_dmevmask;
404 uint16_t di_dmstate;
405 uint16_t di_flags;
406 uint32_t di_gen;
407
408
409 xfs_agino_t di_next_unlinked;
410
411
412 uint32_t di_crc;
413 uint64_t di_changecount;
414
415
416
417
418
419
420
421
422 xfs_lsn_t di_lsn;
423
424 uint64_t di_flags2;
425 uint32_t di_cowextsize;
426 uint8_t di_pad2[12];
427
428
429 xfs_log_timestamp_t di_crtime;
430 xfs_ino_t di_ino;
431 uuid_t di_uuid;
432
433
434};
435
436#define xfs_log_dinode_size(mp) \
437 (xfs_has_v3inodes((mp)) ? \
438 sizeof(struct xfs_log_dinode) : \
439 offsetof(struct xfs_log_dinode, di_next_unlinked))
440
441
442
443
444
445
446#define XFS_BLF_CHUNK 128
447#define XFS_BLF_SHIFT 7
448#define BIT_TO_WORD_SHIFT 5
449#define NBWORD (NBBY * sizeof(unsigned int))
450
451
452
453
454
455#define XFS_BLF_INODE_BUF (1<<0)
456
457
458
459
460
461#define XFS_BLF_CANCEL (1<<1)
462
463
464
465
466
467#define XFS_BLF_UDQUOT_BUF (1<<2)
468#define XFS_BLF_PDQUOT_BUF (1<<3)
469#define XFS_BLF_GDQUOT_BUF (1<<4)
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484#define __XFS_BLF_DATAMAP_SIZE ((XFS_MAX_BLOCKSIZE / XFS_BLF_CHUNK) / NBWORD)
485#define XFS_BLF_DATAMAP_SIZE (__XFS_BLF_DATAMAP_SIZE + 1)
486
487typedef struct xfs_buf_log_format {
488 unsigned short blf_type;
489 unsigned short blf_size;
490 unsigned short blf_flags;
491 unsigned short blf_len;
492 int64_t blf_blkno;
493 unsigned int blf_map_size;
494 unsigned int blf_data_map[XFS_BLF_DATAMAP_SIZE];
495} xfs_buf_log_format_t;
496
497
498
499
500
501
502
503
504
505#define XFS_BLFT_BITS 5
506#define XFS_BLFT_SHIFT 11
507#define XFS_BLFT_MASK (((1 << XFS_BLFT_BITS) - 1) << XFS_BLFT_SHIFT)
508
509enum xfs_blft {
510 XFS_BLFT_UNKNOWN_BUF = 0,
511 XFS_BLFT_UDQUOT_BUF,
512 XFS_BLFT_PDQUOT_BUF,
513 XFS_BLFT_GDQUOT_BUF,
514 XFS_BLFT_BTREE_BUF,
515 XFS_BLFT_AGF_BUF,
516 XFS_BLFT_AGFL_BUF,
517 XFS_BLFT_AGI_BUF,
518 XFS_BLFT_DINO_BUF,
519 XFS_BLFT_SYMLINK_BUF,
520 XFS_BLFT_DIR_BLOCK_BUF,
521 XFS_BLFT_DIR_DATA_BUF,
522 XFS_BLFT_DIR_FREE_BUF,
523 XFS_BLFT_DIR_LEAF1_BUF,
524 XFS_BLFT_DIR_LEAFN_BUF,
525 XFS_BLFT_DA_NODE_BUF,
526 XFS_BLFT_ATTR_LEAF_BUF,
527 XFS_BLFT_ATTR_RMT_BUF,
528 XFS_BLFT_SB_BUF,
529 XFS_BLFT_RTBITMAP_BUF,
530 XFS_BLFT_RTSUMMARY_BUF,
531 XFS_BLFT_MAX_BUF = (1 << XFS_BLFT_BITS),
532};
533
534static inline void
535xfs_blft_to_flags(struct xfs_buf_log_format *blf, enum xfs_blft type)
536{
537 ASSERT(type > XFS_BLFT_UNKNOWN_BUF && type < XFS_BLFT_MAX_BUF);
538 blf->blf_flags &= ~XFS_BLFT_MASK;
539 blf->blf_flags |= ((type << XFS_BLFT_SHIFT) & XFS_BLFT_MASK);
540}
541
542static inline uint16_t
543xfs_blft_from_flags(struct xfs_buf_log_format *blf)
544{
545 return (blf->blf_flags & XFS_BLFT_MASK) >> XFS_BLFT_SHIFT;
546}
547
548
549
550
551typedef struct xfs_extent {
552 xfs_fsblock_t ext_start;
553 xfs_extlen_t ext_len;
554} xfs_extent_t;
555
556
557
558
559
560
561
562typedef struct xfs_extent_32 {
563 uint64_t ext_start;
564 uint32_t ext_len;
565} __attribute__((packed)) xfs_extent_32_t;
566
567typedef struct xfs_extent_64 {
568 uint64_t ext_start;
569 uint32_t ext_len;
570 uint32_t ext_pad;
571} xfs_extent_64_t;
572
573
574
575
576
577
578typedef struct xfs_efi_log_format {
579 uint16_t efi_type;
580 uint16_t efi_size;
581 uint32_t efi_nextents;
582 uint64_t efi_id;
583 xfs_extent_t efi_extents[1];
584} xfs_efi_log_format_t;
585
586typedef struct xfs_efi_log_format_32 {
587 uint16_t efi_type;
588 uint16_t efi_size;
589 uint32_t efi_nextents;
590 uint64_t efi_id;
591 xfs_extent_32_t efi_extents[1];
592} __attribute__((packed)) xfs_efi_log_format_32_t;
593
594typedef struct xfs_efi_log_format_64 {
595 uint16_t efi_type;
596 uint16_t efi_size;
597 uint32_t efi_nextents;
598 uint64_t efi_id;
599 xfs_extent_64_t efi_extents[1];
600} xfs_efi_log_format_64_t;
601
602
603
604
605
606
607typedef struct xfs_efd_log_format {
608 uint16_t efd_type;
609 uint16_t efd_size;
610 uint32_t efd_nextents;
611 uint64_t efd_efi_id;
612 xfs_extent_t efd_extents[1];
613} xfs_efd_log_format_t;
614
615typedef struct xfs_efd_log_format_32 {
616 uint16_t efd_type;
617 uint16_t efd_size;
618 uint32_t efd_nextents;
619 uint64_t efd_efi_id;
620 xfs_extent_32_t efd_extents[1];
621} __attribute__((packed)) xfs_efd_log_format_32_t;
622
623typedef struct xfs_efd_log_format_64 {
624 uint16_t efd_type;
625 uint16_t efd_size;
626 uint32_t efd_nextents;
627 uint64_t efd_efi_id;
628 xfs_extent_64_t efd_extents[1];
629} xfs_efd_log_format_64_t;
630
631
632
633
634struct xfs_map_extent {
635 uint64_t me_owner;
636 uint64_t me_startblock;
637 uint64_t me_startoff;
638 uint32_t me_len;
639 uint32_t me_flags;
640};
641
642
643#define XFS_RMAP_EXTENT_MAP 1
644#define XFS_RMAP_EXTENT_MAP_SHARED 2
645#define XFS_RMAP_EXTENT_UNMAP 3
646#define XFS_RMAP_EXTENT_UNMAP_SHARED 4
647#define XFS_RMAP_EXTENT_CONVERT 5
648#define XFS_RMAP_EXTENT_CONVERT_SHARED 6
649#define XFS_RMAP_EXTENT_ALLOC 7
650#define XFS_RMAP_EXTENT_FREE 8
651#define XFS_RMAP_EXTENT_TYPE_MASK 0xFF
652
653#define XFS_RMAP_EXTENT_ATTR_FORK (1U << 31)
654#define XFS_RMAP_EXTENT_BMBT_BLOCK (1U << 30)
655#define XFS_RMAP_EXTENT_UNWRITTEN (1U << 29)
656
657#define XFS_RMAP_EXTENT_FLAGS (XFS_RMAP_EXTENT_TYPE_MASK | \
658 XFS_RMAP_EXTENT_ATTR_FORK | \
659 XFS_RMAP_EXTENT_BMBT_BLOCK | \
660 XFS_RMAP_EXTENT_UNWRITTEN)
661
662
663
664
665
666
667struct xfs_rui_log_format {
668 uint16_t rui_type;
669 uint16_t rui_size;
670 uint32_t rui_nextents;
671 uint64_t rui_id;
672 struct xfs_map_extent rui_extents[];
673};
674
675static inline size_t
676xfs_rui_log_format_sizeof(
677 unsigned int nr)
678{
679 return sizeof(struct xfs_rui_log_format) +
680 nr * sizeof(struct xfs_map_extent);
681}
682
683
684
685
686
687
688struct xfs_rud_log_format {
689 uint16_t rud_type;
690 uint16_t rud_size;
691 uint32_t __pad;
692 uint64_t rud_rui_id;
693};
694
695
696
697
698struct xfs_phys_extent {
699 uint64_t pe_startblock;
700 uint32_t pe_len;
701 uint32_t pe_flags;
702};
703
704
705
706#define XFS_REFCOUNT_EXTENT_TYPE_MASK 0xFF
707
708#define XFS_REFCOUNT_EXTENT_FLAGS (XFS_REFCOUNT_EXTENT_TYPE_MASK)
709
710
711
712
713
714
715struct xfs_cui_log_format {
716 uint16_t cui_type;
717 uint16_t cui_size;
718 uint32_t cui_nextents;
719 uint64_t cui_id;
720 struct xfs_phys_extent cui_extents[];
721};
722
723static inline size_t
724xfs_cui_log_format_sizeof(
725 unsigned int nr)
726{
727 return sizeof(struct xfs_cui_log_format) +
728 nr * sizeof(struct xfs_phys_extent);
729}
730
731
732
733
734
735
736struct xfs_cud_log_format {
737 uint16_t cud_type;
738 uint16_t cud_size;
739 uint32_t __pad;
740 uint64_t cud_cui_id;
741};
742
743
744
745
746
747
748
749#define XFS_BMAP_EXTENT_TYPE_MASK 0xFF
750
751#define XFS_BMAP_EXTENT_ATTR_FORK (1U << 31)
752#define XFS_BMAP_EXTENT_UNWRITTEN (1U << 30)
753
754#define XFS_BMAP_EXTENT_FLAGS (XFS_BMAP_EXTENT_TYPE_MASK | \
755 XFS_BMAP_EXTENT_ATTR_FORK | \
756 XFS_BMAP_EXTENT_UNWRITTEN)
757
758
759
760
761
762
763struct xfs_bui_log_format {
764 uint16_t bui_type;
765 uint16_t bui_size;
766 uint32_t bui_nextents;
767 uint64_t bui_id;
768 struct xfs_map_extent bui_extents[];
769};
770
771static inline size_t
772xfs_bui_log_format_sizeof(
773 unsigned int nr)
774{
775 return sizeof(struct xfs_bui_log_format) +
776 nr * sizeof(struct xfs_map_extent);
777}
778
779
780
781
782
783
784struct xfs_bud_log_format {
785 uint16_t bud_type;
786 uint16_t bud_size;
787 uint32_t __pad;
788 uint64_t bud_bui_id;
789};
790
791
792
793
794
795
796
797typedef struct xfs_dq_logformat {
798 uint16_t qlf_type;
799 uint16_t qlf_size;
800 xfs_dqid_t qlf_id;
801 int64_t qlf_blkno;
802 int32_t qlf_len;
803 uint32_t qlf_boffset;
804} xfs_dq_logformat_t;
805
806
807
808
809
810
811
812
813
814typedef struct xfs_qoff_logformat {
815 unsigned short qf_type;
816 unsigned short qf_size;
817 unsigned int qf_flags;
818 char qf_pad[12];
819} xfs_qoff_logformat_t;
820
821
822
823
824#define XFS_UQUOTA_ACCT 0x0001
825#define XFS_UQUOTA_ENFD 0x0002
826#define XFS_UQUOTA_CHKD 0x0004
827#define XFS_PQUOTA_ACCT 0x0008
828#define XFS_OQUOTA_ENFD 0x0010
829#define XFS_OQUOTA_CHKD 0x0020
830#define XFS_GQUOTA_ACCT 0x0040
831
832
833
834
835
836#define XFS_GQUOTA_ENFD 0x0080
837#define XFS_GQUOTA_CHKD 0x0100
838#define XFS_PQUOTA_ENFD 0x0200
839#define XFS_PQUOTA_CHKD 0x0400
840
841#define XFS_ALL_QUOTA_ACCT \
842 (XFS_UQUOTA_ACCT | XFS_GQUOTA_ACCT | XFS_PQUOTA_ACCT)
843#define XFS_ALL_QUOTA_ENFD \
844 (XFS_UQUOTA_ENFD | XFS_GQUOTA_ENFD | XFS_PQUOTA_ENFD)
845#define XFS_ALL_QUOTA_CHKD \
846 (XFS_UQUOTA_CHKD | XFS_GQUOTA_CHKD | XFS_PQUOTA_CHKD)
847
848#define XFS_MOUNT_QUOTA_ALL (XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD|\
849 XFS_UQUOTA_CHKD|XFS_GQUOTA_ACCT|\
850 XFS_GQUOTA_ENFD|XFS_GQUOTA_CHKD|\
851 XFS_PQUOTA_ACCT|XFS_PQUOTA_ENFD|\
852 XFS_PQUOTA_CHKD)
853
854
855
856
857
858
859
860
861struct xfs_icreate_log {
862 uint16_t icl_type;
863 uint16_t icl_size;
864 __be32 icl_ag;
865 __be32 icl_agbno;
866 __be32 icl_count;
867 __be32 icl_isize;
868 __be32 icl_length;
869 __be32 icl_gen;
870};
871
872#endif
873