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