This source file includes following definitions.
- ocfs2_xattr_set_local
- ocfs2_xattr_is_local
- ocfs2_xattr_set_type
- ocfs2_xattr_get_type
- ocfs2_block_dqtrailer
- ocfs2_fast_symlink_chars
- ocfs2_max_inline_data_with_xattr
- ocfs2_extent_recs_per_inode
- ocfs2_extent_recs_per_inode_with_xattr
- ocfs2_extent_recs_per_dx_root
- ocfs2_chain_recs_per_inode
- ocfs2_extent_recs_per_eb
- ocfs2_extent_recs_per_gd
- ocfs2_dx_entries_per_leaf
- ocfs2_dx_entries_per_root
- ocfs2_local_alloc_size
- ocfs2_group_bitmap_size
- ocfs2_truncate_recs_per_inode
- ocfs2_backup_super_blkno
- ocfs2_xattr_recs_per_xb
- ocfs2_extent_recs_per_rb
- ocfs2_refcount_recs_per_rb
- ocfs2_get_ref_rec_low_cpos
- ocfs2_fast_symlink_chars
- ocfs2_max_inline_data_with_xattr
- ocfs2_extent_recs_per_inode
- ocfs2_chain_recs_per_inode
- ocfs2_extent_recs_per_eb
- ocfs2_extent_recs_per_gd
- ocfs2_local_alloc_size
- ocfs2_group_bitmap_size
- ocfs2_truncate_recs_per_inode
- ocfs2_backup_super_blkno
- ocfs2_xattr_recs_per_xb
- ocfs2_system_inode_is_global
- ocfs2_sprintf_system_inode_name
- ocfs2_set_de_type
- ocfs2_gd_is_discontig
1
2
3
4
5
6
7
8
9
10
11
12 #ifndef _OCFS2_FS_H
13 #define _OCFS2_FS_H
14
15 #include <linux/magic.h>
16
17
18 #define OCFS2_MAJOR_REV_LEVEL 0
19 #define OCFS2_MINOR_REV_LEVEL 90
20
21
22
23
24
25
26
27
28
29
30
31
32 #define OCFS2_SUPER_BLOCK_BLKNO 2
33
34
35
36
37
38 #define OCFS2_MIN_CLUSTERSIZE 4096
39 #define OCFS2_MAX_CLUSTERSIZE 1048576
40
41
42
43
44
45 #define OCFS2_MIN_BLOCKSIZE 512
46 #define OCFS2_MAX_BLOCKSIZE OCFS2_MIN_CLUSTERSIZE
47
48
49 #define OCFS2_SUPER_BLOCK_SIGNATURE "OCFSV2"
50 #define OCFS2_INODE_SIGNATURE "INODE01"
51 #define OCFS2_EXTENT_BLOCK_SIGNATURE "EXBLK01"
52 #define OCFS2_GROUP_DESC_SIGNATURE "GROUP01"
53 #define OCFS2_XATTR_BLOCK_SIGNATURE "XATTR01"
54 #define OCFS2_DIR_TRAILER_SIGNATURE "DIRTRL1"
55 #define OCFS2_DX_ROOT_SIGNATURE "DXDIR01"
56 #define OCFS2_DX_LEAF_SIGNATURE "DXLEAF1"
57 #define OCFS2_REFCOUNT_BLOCK_SIGNATURE "REFCNT1"
58
59
60 #define OCFS2_HAS_COMPAT_FEATURE(sb,mask) \
61 ( OCFS2_SB(sb)->s_feature_compat & (mask) )
62 #define OCFS2_HAS_RO_COMPAT_FEATURE(sb,mask) \
63 ( OCFS2_SB(sb)->s_feature_ro_compat & (mask) )
64 #define OCFS2_HAS_INCOMPAT_FEATURE(sb,mask) \
65 ( OCFS2_SB(sb)->s_feature_incompat & (mask) )
66 #define OCFS2_SET_COMPAT_FEATURE(sb,mask) \
67 OCFS2_SB(sb)->s_feature_compat |= (mask)
68 #define OCFS2_SET_RO_COMPAT_FEATURE(sb,mask) \
69 OCFS2_SB(sb)->s_feature_ro_compat |= (mask)
70 #define OCFS2_SET_INCOMPAT_FEATURE(sb,mask) \
71 OCFS2_SB(sb)->s_feature_incompat |= (mask)
72 #define OCFS2_CLEAR_COMPAT_FEATURE(sb,mask) \
73 OCFS2_SB(sb)->s_feature_compat &= ~(mask)
74 #define OCFS2_CLEAR_RO_COMPAT_FEATURE(sb,mask) \
75 OCFS2_SB(sb)->s_feature_ro_compat &= ~(mask)
76 #define OCFS2_CLEAR_INCOMPAT_FEATURE(sb,mask) \
77 OCFS2_SB(sb)->s_feature_incompat &= ~(mask)
78
79 #define OCFS2_FEATURE_COMPAT_SUPP (OCFS2_FEATURE_COMPAT_BACKUP_SB \
80 | OCFS2_FEATURE_COMPAT_JBD2_SB)
81 #define OCFS2_FEATURE_INCOMPAT_SUPP (OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT \
82 | OCFS2_FEATURE_INCOMPAT_SPARSE_ALLOC \
83 | OCFS2_FEATURE_INCOMPAT_INLINE_DATA \
84 | OCFS2_FEATURE_INCOMPAT_EXTENDED_SLOT_MAP \
85 | OCFS2_FEATURE_INCOMPAT_USERSPACE_STACK \
86 | OCFS2_FEATURE_INCOMPAT_XATTR \
87 | OCFS2_FEATURE_INCOMPAT_META_ECC \
88 | OCFS2_FEATURE_INCOMPAT_INDEXED_DIRS \
89 | OCFS2_FEATURE_INCOMPAT_REFCOUNT_TREE \
90 | OCFS2_FEATURE_INCOMPAT_DISCONTIG_BG \
91 | OCFS2_FEATURE_INCOMPAT_CLUSTERINFO \
92 | OCFS2_FEATURE_INCOMPAT_APPEND_DIO)
93 #define OCFS2_FEATURE_RO_COMPAT_SUPP (OCFS2_FEATURE_RO_COMPAT_UNWRITTEN \
94 | OCFS2_FEATURE_RO_COMPAT_USRQUOTA \
95 | OCFS2_FEATURE_RO_COMPAT_GRPQUOTA)
96
97
98
99
100
101
102 #define OCFS2_FEATURE_INCOMPAT_HEARTBEAT_DEV 0x0002
103
104
105
106
107
108
109 #define OCFS2_FEATURE_INCOMPAT_RESIZE_INPROG 0x0004
110
111
112 #define OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT 0x0008
113
114
115 #define OCFS2_FEATURE_INCOMPAT_SPARSE_ALLOC 0x0010
116
117
118
119
120
121
122
123
124
125
126 #define OCFS2_FEATURE_INCOMPAT_TUNEFS_INPROG 0x0020
127
128
129 #define OCFS2_FEATURE_INCOMPAT_INLINE_DATA 0x0040
130
131
132
133
134
135
136
137
138
139
140 #define OCFS2_FEATURE_INCOMPAT_USERSPACE_STACK 0x0080
141
142
143 #define OCFS2_FEATURE_INCOMPAT_EXTENDED_SLOT_MAP 0x100
144
145
146 #define OCFS2_FEATURE_INCOMPAT_XATTR 0x0200
147
148
149 #define OCFS2_FEATURE_INCOMPAT_INDEXED_DIRS 0x0400
150
151
152 #define OCFS2_FEATURE_INCOMPAT_META_ECC 0x0800
153
154
155 #define OCFS2_FEATURE_INCOMPAT_REFCOUNT_TREE 0x1000
156
157
158 #define OCFS2_FEATURE_INCOMPAT_DISCONTIG_BG 0x2000
159
160
161
162
163
164
165 #define OCFS2_FEATURE_INCOMPAT_CLUSTERINFO 0x4000
166
167
168
169
170 #define OCFS2_FEATURE_INCOMPAT_APPEND_DIO 0x8000
171
172
173
174
175
176 #define OCFS2_FEATURE_COMPAT_BACKUP_SB 0x0001
177
178
179
180
181 #define OCFS2_FEATURE_COMPAT_JBD2_SB 0x0002
182
183
184
185
186 #define OCFS2_FEATURE_RO_COMPAT_UNWRITTEN 0x0001
187
188
189
190
191 #define OCFS2_FEATURE_RO_COMPAT_USRQUOTA 0x0002
192 #define OCFS2_FEATURE_RO_COMPAT_GRPQUOTA 0x0004
193
194
195
196
197
198 #define OCFS2_BACKUP_SB_START 1 << 30
199
200
201 #define OCFS2_MAX_BACKUP_SUPERBLOCKS 6
202
203
204
205
206 #define OCFS2_TUNEFS_INPROG_REMOVE_SLOT 0x0001
207
208
209
210
211 #define OCFS2_VALID_FL (0x00000001)
212 #define OCFS2_UNUSED2_FL (0x00000002)
213 #define OCFS2_ORPHANED_FL (0x00000004)
214 #define OCFS2_UNUSED3_FL (0x00000008)
215
216 #define OCFS2_SYSTEM_FL (0x00000010)
217 #define OCFS2_SUPER_BLOCK_FL (0x00000020)
218 #define OCFS2_LOCAL_ALLOC_FL (0x00000040)
219 #define OCFS2_BITMAP_FL (0x00000080)
220 #define OCFS2_JOURNAL_FL (0x00000100)
221 #define OCFS2_HEARTBEAT_FL (0x00000200)
222 #define OCFS2_CHAIN_FL (0x00000400)
223 #define OCFS2_DEALLOC_FL (0x00000800)
224 #define OCFS2_QUOTA_FL (0x00001000)
225 #define OCFS2_DIO_ORPHANED_FL (0X00002000)
226
227
228
229
230
231
232
233
234 #define OCFS2_INLINE_DATA_FL (0x0001)
235 #define OCFS2_HAS_XATTR_FL (0x0002)
236 #define OCFS2_INLINE_XATTR_FL (0x0004)
237 #define OCFS2_INDEXED_DIR_FL (0x0008)
238 #define OCFS2_HAS_REFCOUNT_FL (0x0010)
239
240
241 #define OCFS2_SECRM_FL FS_SECRM_FL
242 #define OCFS2_UNRM_FL FS_UNRM_FL
243 #define OCFS2_COMPR_FL FS_COMPR_FL
244 #define OCFS2_SYNC_FL FS_SYNC_FL
245 #define OCFS2_IMMUTABLE_FL FS_IMMUTABLE_FL
246 #define OCFS2_APPEND_FL FS_APPEND_FL
247 #define OCFS2_NODUMP_FL FS_NODUMP_FL
248 #define OCFS2_NOATIME_FL FS_NOATIME_FL
249
250 #define OCFS2_DIRTY_FL FS_DIRTY_FL
251 #define OCFS2_COMPRBLK_FL FS_COMPRBLK_FL
252 #define OCFS2_NOCOMP_FL FS_NOCOMP_FL
253 #define OCFS2_ECOMPR_FL FS_ECOMPR_FL
254
255 #define OCFS2_BTREE_FL FS_BTREE_FL
256 #define OCFS2_INDEX_FL FS_INDEX_FL
257 #define OCFS2_IMAGIC_FL FS_IMAGIC_FL
258 #define OCFS2_JOURNAL_DATA_FL FS_JOURNAL_DATA_FL
259 #define OCFS2_NOTAIL_FL FS_NOTAIL_FL
260 #define OCFS2_DIRSYNC_FL FS_DIRSYNC_FL
261 #define OCFS2_TOPDIR_FL FS_TOPDIR_FL
262 #define OCFS2_RESERVED_FL FS_RESERVED_FL
263
264 #define OCFS2_FL_VISIBLE FS_FL_USER_VISIBLE
265 #define OCFS2_FL_MODIFIABLE FS_FL_USER_MODIFIABLE
266
267
268
269
270 #define OCFS2_EXT_UNWRITTEN (0x01)
271
272 #define OCFS2_EXT_REFCOUNTED (0x02)
273
274
275
276
277
278
279 #define OCFS2_JOURNAL_DIRTY_FL (0x00000001)
280
281
282
283
284 #define OCFS2_ERROR_FS (0x00000001)
285
286
287 #define OCFS2_MAX_FILENAME_LEN 255
288
289
290 #define OCFS2_MAX_SLOTS 255
291
292
293 #define OCFS2_INVALID_SLOT -1
294
295 #define OCFS2_VOL_UUID_LEN 16
296 #define OCFS2_MAX_VOL_LABEL_LEN 64
297
298
299 #define OCFS2_STACK_LABEL_LEN 4
300 #define OCFS2_CLUSTER_NAME_LEN 16
301
302
303 #define OCFS2_CLASSIC_CLUSTER_STACK "o2cb"
304
305
306 #define OCFS2_MIN_JOURNAL_SIZE (4 * 1024 * 1024)
307
308
309
310
311
312 #define OCFS2_MIN_XATTR_INLINE_SIZE 256
313
314
315
316
317 #define OCFS2_CLUSTER_O2CB_GLOBAL_HEARTBEAT (0x01)
318
319 struct ocfs2_system_inode_info {
320 char *si_name;
321 int si_iflags;
322 int si_mode;
323 };
324
325
326 enum {
327 BAD_BLOCK_SYSTEM_INODE = 0,
328 GLOBAL_INODE_ALLOC_SYSTEM_INODE,
329 SLOT_MAP_SYSTEM_INODE,
330 #define OCFS2_FIRST_ONLINE_SYSTEM_INODE SLOT_MAP_SYSTEM_INODE
331 HEARTBEAT_SYSTEM_INODE,
332 GLOBAL_BITMAP_SYSTEM_INODE,
333 USER_QUOTA_SYSTEM_INODE,
334 GROUP_QUOTA_SYSTEM_INODE,
335 #define OCFS2_LAST_GLOBAL_SYSTEM_INODE GROUP_QUOTA_SYSTEM_INODE
336 #define OCFS2_FIRST_LOCAL_SYSTEM_INODE ORPHAN_DIR_SYSTEM_INODE
337 ORPHAN_DIR_SYSTEM_INODE,
338 EXTENT_ALLOC_SYSTEM_INODE,
339 INODE_ALLOC_SYSTEM_INODE,
340 JOURNAL_SYSTEM_INODE,
341 LOCAL_ALLOC_SYSTEM_INODE,
342 TRUNCATE_LOG_SYSTEM_INODE,
343 LOCAL_USER_QUOTA_SYSTEM_INODE,
344 LOCAL_GROUP_QUOTA_SYSTEM_INODE,
345 #define OCFS2_LAST_LOCAL_SYSTEM_INODE LOCAL_GROUP_QUOTA_SYSTEM_INODE
346 NUM_SYSTEM_INODES
347 };
348 #define NUM_GLOBAL_SYSTEM_INODES OCFS2_FIRST_LOCAL_SYSTEM_INODE
349 #define NUM_LOCAL_SYSTEM_INODES \
350 (NUM_SYSTEM_INODES - OCFS2_FIRST_LOCAL_SYSTEM_INODE)
351
352 static struct ocfs2_system_inode_info ocfs2_system_inodes[NUM_SYSTEM_INODES] = {
353
354
355 [BAD_BLOCK_SYSTEM_INODE] = { "bad_blocks", 0, S_IFREG | 0644 },
356 [GLOBAL_INODE_ALLOC_SYSTEM_INODE] = { "global_inode_alloc", OCFS2_BITMAP_FL | OCFS2_CHAIN_FL, S_IFREG | 0644 },
357
358
359 [SLOT_MAP_SYSTEM_INODE] = { "slot_map", 0, S_IFREG | 0644 },
360 [HEARTBEAT_SYSTEM_INODE] = { "heartbeat", OCFS2_HEARTBEAT_FL, S_IFREG | 0644 },
361 [GLOBAL_BITMAP_SYSTEM_INODE] = { "global_bitmap", 0, S_IFREG | 0644 },
362 [USER_QUOTA_SYSTEM_INODE] = { "aquota.user", OCFS2_QUOTA_FL, S_IFREG | 0644 },
363 [GROUP_QUOTA_SYSTEM_INODE] = { "aquota.group", OCFS2_QUOTA_FL, S_IFREG | 0644 },
364
365
366 [ORPHAN_DIR_SYSTEM_INODE] = { "orphan_dir:%04d", 0, S_IFDIR | 0755 },
367 [EXTENT_ALLOC_SYSTEM_INODE] = { "extent_alloc:%04d", OCFS2_BITMAP_FL | OCFS2_CHAIN_FL, S_IFREG | 0644 },
368 [INODE_ALLOC_SYSTEM_INODE] = { "inode_alloc:%04d", OCFS2_BITMAP_FL | OCFS2_CHAIN_FL, S_IFREG | 0644 },
369 [JOURNAL_SYSTEM_INODE] = { "journal:%04d", OCFS2_JOURNAL_FL, S_IFREG | 0644 },
370 [LOCAL_ALLOC_SYSTEM_INODE] = { "local_alloc:%04d", OCFS2_BITMAP_FL | OCFS2_LOCAL_ALLOC_FL, S_IFREG | 0644 },
371 [TRUNCATE_LOG_SYSTEM_INODE] = { "truncate_log:%04d", OCFS2_DEALLOC_FL, S_IFREG | 0644 },
372 [LOCAL_USER_QUOTA_SYSTEM_INODE] = { "aquota.user:%04d", OCFS2_QUOTA_FL, S_IFREG | 0644 },
373 [LOCAL_GROUP_QUOTA_SYSTEM_INODE] = { "aquota.group:%04d", OCFS2_QUOTA_FL, S_IFREG | 0644 },
374 };
375
376
377 #define OCFS2_HB_NONE "heartbeat=none"
378 #define OCFS2_HB_LOCAL "heartbeat=local"
379 #define OCFS2_HB_GLOBAL "heartbeat=global"
380
381
382
383
384
385
386 #define OCFS2_DIR_PAD 4
387 #define OCFS2_DIR_ROUND (OCFS2_DIR_PAD - 1)
388 #define OCFS2_DIR_MEMBER_LEN offsetof(struct ocfs2_dir_entry, name)
389 #define OCFS2_DIR_REC_LEN(name_len) (((name_len) + OCFS2_DIR_MEMBER_LEN + \
390 OCFS2_DIR_ROUND) & \
391 ~OCFS2_DIR_ROUND)
392 #define OCFS2_DIR_MIN_REC_LEN OCFS2_DIR_REC_LEN(1)
393
394 #define OCFS2_LINK_MAX 32000
395 #define OCFS2_DX_LINK_MAX ((1U << 31) - 1U)
396 #define OCFS2_LINKS_HI_SHIFT 16
397 #define OCFS2_DX_ENTRIES_MAX (0xffffffffU)
398
399
400
401
402
403 #define OCFS2_RAW_SB(dinode) (&((dinode)->id2.i_super))
404
405
406
407
408
409
410 struct ocfs2_block_check {
411 __le32 bc_crc32e;
412 __le16 bc_ecc;
413
414
415
416
417 __le16 bc_reserved1;
418
419 };
420
421
422
423
424
425
426
427
428 struct ocfs2_extent_rec {
429 __le32 e_cpos;
430 union {
431 __le32 e_int_clusters;
432 struct {
433 __le16 e_leaf_clusters;
434
435 __u8 e_reserved1;
436 __u8 e_flags;
437 };
438 };
439 __le64 e_blkno;
440
441 };
442
443 struct ocfs2_chain_rec {
444 __le32 c_free;
445 __le32 c_total;
446 __le64 c_blkno;
447 };
448
449 struct ocfs2_truncate_rec {
450 __le32 t_start;
451 __le32 t_clusters;
452 };
453
454
455
456
457
458
459
460 struct ocfs2_extent_list {
461 __le16 l_tree_depth;
462
463
464
465
466
467
468 __le16 l_count;
469 __le16 l_next_free_rec;
470 __le16 l_reserved1;
471 __le64 l_reserved2;
472
473 struct ocfs2_extent_rec l_recs[0];
474 };
475
476
477
478
479
480
481 struct ocfs2_chain_list {
482 __le16 cl_cpg;
483 __le16 cl_bpc;
484 __le16 cl_count;
485 __le16 cl_next_free_rec;
486 __le64 cl_reserved1;
487 struct ocfs2_chain_rec cl_recs[0];
488 };
489
490
491
492
493
494
495 struct ocfs2_truncate_log {
496 __le16 tl_count;
497 __le16 tl_used;
498 __le32 tl_reserved1;
499 struct ocfs2_truncate_rec tl_recs[0];
500 };
501
502
503
504
505 struct ocfs2_extent_block
506 {
507 __u8 h_signature[8];
508 struct ocfs2_block_check h_check;
509 __le16 h_suballoc_slot;
510
511 __le16 h_suballoc_bit;
512
513 __le32 h_fs_generation;
514 __le64 h_blkno;
515 __le64 h_suballoc_loc;
516
517
518
519 __le64 h_next_leaf_blk;
520
521
522 struct ocfs2_extent_list h_list;
523
524 };
525
526
527
528
529
530
531 struct ocfs2_slot_map {
532 __le16 sm_slots[0];
533
534
535
536
537 };
538
539 struct ocfs2_extended_slot {
540 __u8 es_valid;
541 __u8 es_reserved1[3];
542 __le32 es_node_num;
543
544 };
545
546
547
548
549
550
551
552 struct ocfs2_slot_map_extended {
553 struct ocfs2_extended_slot se_slots[0];
554
555
556
557
558 };
559
560
561
562
563
564 struct ocfs2_cluster_info {
565 __u8 ci_stack[OCFS2_STACK_LABEL_LEN];
566 union {
567 __le32 ci_reserved;
568 struct {
569 __u8 ci_stackflags;
570 __u8 ci_reserved1;
571 __u8 ci_reserved2;
572 __u8 ci_reserved3;
573 };
574 };
575 __u8 ci_cluster[OCFS2_CLUSTER_NAME_LEN];
576
577 };
578
579
580
581
582
583
584 struct ocfs2_super_block {
585 __le16 s_major_rev_level;
586 __le16 s_minor_rev_level;
587 __le16 s_mnt_count;
588 __le16 s_max_mnt_count;
589 __le16 s_state;
590 __le16 s_errors;
591 __le32 s_checkinterval;
592 __le64 s_lastcheck;
593 __le32 s_creator_os;
594 __le32 s_feature_compat;
595 __le32 s_feature_incompat;
596 __le32 s_feature_ro_compat;
597 __le64 s_root_blkno;
598
599 __le64 s_system_dir_blkno;
600
601 __le32 s_blocksize_bits;
602 __le32 s_clustersize_bits;
603 __le16 s_max_slots;
604
605 __le16 s_tunefs_flag;
606 __le32 s_uuid_hash;
607 __le64 s_first_cluster_group;
608
609 __u8 s_label[OCFS2_MAX_VOL_LABEL_LEN];
610 __u8 s_uuid[OCFS2_VOL_UUID_LEN];
611 struct ocfs2_cluster_info s_cluster_info;
612
613
614 __le16 s_xattr_inline_size;
615
616 __le16 s_reserved0;
617 __le32 s_dx_seed[3];
618
619 __le64 s_reserved2[15];
620
621
622
623
624
625
626
627
628
629
630 };
631
632
633
634
635
636
637 struct ocfs2_local_alloc
638 {
639 __le32 la_bm_off;
640 __le16 la_size;
641 __le16 la_reserved1;
642 __le64 la_reserved2;
643 __u8 la_bitmap[0];
644 };
645
646
647
648
649
650 struct ocfs2_inline_data
651 {
652 __le16 id_count;
653
654 __le16 id_reserved0;
655 __le32 id_reserved1;
656 __u8 id_data[0];
657 };
658
659
660
661
662 struct ocfs2_dinode {
663 __u8 i_signature[8];
664 __le32 i_generation;
665 __le16 i_suballoc_slot;
666
667 __le16 i_suballoc_bit;
668
669 __le16 i_links_count_hi;
670 __le16 i_xattr_inline_size;
671 __le32 i_clusters;
672 __le32 i_uid;
673 __le32 i_gid;
674 __le64 i_size;
675 __le16 i_mode;
676 __le16 i_links_count;
677 __le32 i_flags;
678 __le64 i_atime;
679 __le64 i_ctime;
680 __le64 i_mtime;
681 __le64 i_dtime;
682 __le64 i_blkno;
683 __le64 i_last_eb_blk;
684
685 __le32 i_fs_generation;
686 __le32 i_atime_nsec;
687 __le32 i_ctime_nsec;
688 __le32 i_mtime_nsec;
689 __le32 i_attr;
690 __le16 i_orphaned_slot;
691
692 __le16 i_dyn_features;
693 __le64 i_xattr_loc;
694 struct ocfs2_block_check i_check;
695 __le64 i_dx_root;
696 __le64 i_refcount_loc;
697 __le64 i_suballoc_loc;
698
699
700
701 __le16 i_dio_orphaned_slot;
702 __le16 i_reserved1[3];
703 __le64 i_reserved2[2];
704 union {
705 __le64 i_pad1;
706
707 struct {
708 __le64 i_rdev;
709 } dev1;
710 struct {
711
712 __le32 i_used;
713 __le32 i_total;
714
715 } bitmap1;
716 struct {
717
718 __le32 ij_flags;
719 __le32 ij_recovery_generation;
720
721
722
723 } journal1;
724 } id1;
725 union {
726 struct ocfs2_super_block i_super;
727 struct ocfs2_local_alloc i_lab;
728 struct ocfs2_chain_list i_chain;
729 struct ocfs2_extent_list i_list;
730 struct ocfs2_truncate_log i_dealloc;
731 struct ocfs2_inline_data i_data;
732 __u8 i_symlink[0];
733 } id2;
734
735 };
736
737
738
739
740
741
742 struct ocfs2_dir_entry {
743 __le64 inode;
744 __le16 rec_len;
745 __u8 name_len;
746 __u8 file_type;
747 char name[OCFS2_MAX_FILENAME_LEN];
748
749 } __attribute__ ((packed));
750
751
752
753
754
755
756
757
758
759 struct ocfs2_dir_block_trailer {
760 __le64 db_compat_inode;
761
762 __le16 db_compat_rec_len;
763
764 __u8 db_compat_name_len;
765 __u8 db_reserved0;
766 __le16 db_reserved1;
767 __le16 db_free_rec_len;
768
769 __u8 db_signature[8];
770 __le64 db_reserved2;
771 __le64 db_free_next;
772 __le64 db_blkno;
773 __le64 db_parent_dinode;
774
775 struct ocfs2_block_check db_check;
776
777 };
778
779
780
781
782
783
784
785
786 struct ocfs2_dx_entry {
787 __le32 dx_major_hash;
788
789 __le32 dx_minor_hash;
790
791 __le64 dx_dirent_blk;
792
793 };
794
795 struct ocfs2_dx_entry_list {
796 __le32 de_reserved;
797 __le16 de_count;
798
799 __le16 de_num_used;
800
801 struct ocfs2_dx_entry de_entries[0];
802
803
804 };
805
806 #define OCFS2_DX_FLAG_INLINE 0x01
807
808
809
810
811
812
813
814
815 struct ocfs2_dx_root_block {
816 __u8 dr_signature[8];
817 struct ocfs2_block_check dr_check;
818 __le16 dr_suballoc_slot;
819
820 __le16 dr_suballoc_bit;
821
822 __le32 dr_fs_generation;
823 __le64 dr_blkno;
824 __le64 dr_last_eb_blk;
825
826 __le32 dr_clusters;
827
828 __u8 dr_flags;
829 __u8 dr_reserved0;
830 __le16 dr_reserved1;
831 __le64 dr_dir_blkno;
832 __le32 dr_num_entries;
833
834
835 __le32 dr_reserved2;
836 __le64 dr_free_blk;
837
838 __le64 dr_suballoc_loc;
839
840
841
842
843 __le64 dr_reserved3[14];
844 union {
845 struct ocfs2_extent_list dr_list;
846
847
848 struct ocfs2_dx_entry_list dr_entries;
849
850
851
852 };
853 };
854
855
856
857
858 struct ocfs2_dx_leaf {
859 __u8 dl_signature[8];
860 struct ocfs2_block_check dl_check;
861 __le64 dl_blkno;
862 __le32 dl_fs_generation;
863 __le32 dl_reserved0;
864 __le64 dl_reserved1;
865 struct ocfs2_dx_entry_list dl_list;
866 };
867
868
869
870
871
872
873 #define OCFS2_MAX_BG_BITMAP_SIZE 256
874
875
876
877
878 struct ocfs2_group_desc
879 {
880 __u8 bg_signature[8];
881 __le16 bg_size;
882
883 __le16 bg_bits;
884
885 __le16 bg_free_bits_count;
886 __le16 bg_chain;
887 __le32 bg_generation;
888 __le32 bg_reserved1;
889 __le64 bg_next_group;
890
891 __le64 bg_parent_dinode;
892
893 __le64 bg_blkno;
894 struct ocfs2_block_check bg_check;
895 __le64 bg_reserved2;
896 union {
897 __u8 bg_bitmap[0];
898 struct {
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914 __u8 bg_bitmap_filler[OCFS2_MAX_BG_BITMAP_SIZE];
915 struct ocfs2_extent_list bg_list;
916 };
917 };
918
919 };
920
921 struct ocfs2_refcount_rec {
922 __le64 r_cpos;
923 __le32 r_clusters;
924 __le32 r_refcount;
925
926 };
927 #define OCFS2_32BIT_POS_MASK (0xffffffffULL)
928
929 #define OCFS2_REFCOUNT_LEAF_FL (0x00000001)
930 #define OCFS2_REFCOUNT_TREE_FL (0x00000002)
931
932 struct ocfs2_refcount_list {
933 __le16 rl_count;
934
935 __le16 rl_used;
936 __le32 rl_reserved2;
937 __le64 rl_reserved1;
938 struct ocfs2_refcount_rec rl_recs[0];
939 };
940
941
942 struct ocfs2_refcount_block {
943 __u8 rf_signature[8];
944 __le16 rf_suballoc_slot;
945
946 __le16 rf_suballoc_bit;
947
948 __le32 rf_fs_generation;
949 __le64 rf_blkno;
950 __le64 rf_parent;
951
952
953 struct ocfs2_block_check rf_check;
954 __le64 rf_last_eb_blk;
955 __le32 rf_count;
956
957 __le32 rf_flags;
958 __le32 rf_clusters;
959 __le32 rf_cpos;
960 __le32 rf_generation;
961
962 __le32 rf_reserved0;
963 __le64 rf_suballoc_loc;
964
965
966
967 __le64 rf_reserved1[6];
968 union {
969 struct ocfs2_refcount_list rf_records;
970
971 struct ocfs2_extent_list rf_list;
972
973
974
975 };
976
977 };
978
979
980
981
982
983
984
985
986
987
988 struct ocfs2_xattr_entry {
989 __le32 xe_name_hash;
990 __le16 xe_name_offset;
991
992
993 __u8 xe_name_len;
994 __u8 xe_type;
995
996
997 __le64 xe_value_size;
998 };
999
1000
1001
1002
1003
1004
1005
1006 struct ocfs2_xattr_header {
1007 __le16 xh_count;
1008
1009
1010 __le16 xh_free_start;
1011
1012 __le16 xh_name_value_len;
1013
1014 __le16 xh_num_buckets;
1015
1016
1017
1018 struct ocfs2_block_check xh_check;
1019
1020
1021
1022
1023
1024 struct ocfs2_xattr_entry xh_entries[0];
1025 };
1026
1027
1028
1029
1030
1031
1032
1033 struct ocfs2_xattr_value_root {
1034 __le32 xr_clusters;
1035 __le32 xr_reserved0;
1036 __le64 xr_last_eb_blk;
1037 struct ocfs2_extent_list xr_list;
1038 };
1039
1040
1041
1042
1043
1044
1045
1046 struct ocfs2_xattr_tree_root {
1047 __le32 xt_clusters;
1048 __le32 xt_reserved0;
1049 __le64 xt_last_eb_blk;
1050 struct ocfs2_extent_list xt_list;
1051 };
1052
1053 #define OCFS2_XATTR_INDEXED 0x1
1054 #define OCFS2_HASH_SHIFT 5
1055 #define OCFS2_XATTR_ROUND 3
1056 #define OCFS2_XATTR_SIZE(size) (((size) + OCFS2_XATTR_ROUND) & \
1057 ~(OCFS2_XATTR_ROUND))
1058
1059 #define OCFS2_XATTR_BUCKET_SIZE 4096
1060 #define OCFS2_XATTR_MAX_BLOCKS_PER_BUCKET (OCFS2_XATTR_BUCKET_SIZE \
1061 / OCFS2_MIN_BLOCKSIZE)
1062
1063
1064
1065
1066 struct ocfs2_xattr_block {
1067 __u8 xb_signature[8];
1068 __le16 xb_suballoc_slot;
1069
1070 __le16 xb_suballoc_bit;
1071
1072 __le32 xb_fs_generation;
1073 __le64 xb_blkno;
1074 struct ocfs2_block_check xb_check;
1075 __le16 xb_flags;
1076
1077 __le16 xb_reserved0;
1078 __le32 xb_reserved1;
1079 __le64 xb_suballoc_loc;
1080
1081
1082
1083 union {
1084 struct ocfs2_xattr_header xb_header;
1085
1086 struct ocfs2_xattr_tree_root xb_root;
1087
1088
1089 } xb_attrs;
1090 };
1091
1092 #define OCFS2_XATTR_ENTRY_LOCAL 0x80
1093 #define OCFS2_XATTR_TYPE_MASK 0x7F
1094 static inline void ocfs2_xattr_set_local(struct ocfs2_xattr_entry *xe,
1095 int local)
1096 {
1097 if (local)
1098 xe->xe_type |= OCFS2_XATTR_ENTRY_LOCAL;
1099 else
1100 xe->xe_type &= ~OCFS2_XATTR_ENTRY_LOCAL;
1101 }
1102
1103 static inline int ocfs2_xattr_is_local(struct ocfs2_xattr_entry *xe)
1104 {
1105 return xe->xe_type & OCFS2_XATTR_ENTRY_LOCAL;
1106 }
1107
1108 static inline void ocfs2_xattr_set_type(struct ocfs2_xattr_entry *xe, int type)
1109 {
1110 xe->xe_type |= type & OCFS2_XATTR_TYPE_MASK;
1111 }
1112
1113 static inline int ocfs2_xattr_get_type(struct ocfs2_xattr_entry *xe)
1114 {
1115 return xe->xe_type & OCFS2_XATTR_TYPE_MASK;
1116 }
1117
1118
1119
1120
1121
1122
1123 #define OCFS2_GLOBAL_QMAGICS {\
1124 0x0cf52470, \
1125 0x0cf52471 \
1126 }
1127
1128 #define OCFS2_GLOBAL_QVERSIONS {\
1129 0, \
1130 0, \
1131 }
1132
1133
1134
1135
1136
1137 #define OCFS2_QBLK_RESERVED_SPACE 8
1138
1139
1140 struct ocfs2_disk_dqheader {
1141 __le32 dqh_magic;
1142 __le32 dqh_version;
1143 };
1144
1145 #define OCFS2_GLOBAL_INFO_OFF (sizeof(struct ocfs2_disk_dqheader))
1146
1147
1148
1149 struct ocfs2_global_disk_dqinfo {
1150 __le32 dqi_bgrace;
1151 __le32 dqi_igrace;
1152 __le32 dqi_syncms;
1153
1154 __le32 dqi_blocks;
1155 __le32 dqi_free_blk;
1156 __le32 dqi_free_entry;
1157
1158 };
1159
1160
1161
1162 struct ocfs2_global_disk_dqblk {
1163 __le32 dqb_id;
1164 __le32 dqb_use_count;
1165 __le64 dqb_ihardlimit;
1166 __le64 dqb_isoftlimit;
1167 __le64 dqb_curinodes;
1168 __le64 dqb_bhardlimit;
1169 __le64 dqb_bsoftlimit;
1170 __le64 dqb_curspace;
1171 __le64 dqb_btime;
1172 __le64 dqb_itime;
1173 __le64 dqb_pad1;
1174 __le64 dqb_pad2;
1175 };
1176
1177
1178
1179
1180
1181
1182 #define OCFS2_LOCAL_QMAGICS {\
1183 0x0cf524c0, \
1184 0x0cf524c1 \
1185 }
1186
1187 #define OCFS2_LOCAL_QVERSIONS {\
1188 0, \
1189 0, \
1190 }
1191
1192
1193 #define OLQF_CLEAN 0x0001
1194
1195
1196 #define OCFS2_LOCAL_INFO_OFF (sizeof(struct ocfs2_disk_dqheader))
1197
1198
1199
1200 struct ocfs2_local_disk_dqinfo {
1201 __le32 dqi_flags;
1202 __le32 dqi_chunks;
1203
1204 __le32 dqi_blocks;
1205 };
1206
1207
1208 struct ocfs2_local_disk_chunk {
1209 __le32 dqc_free;
1210 __u8 dqc_bitmap[0];
1211
1212 };
1213
1214
1215 struct ocfs2_local_disk_dqblk {
1216 __le64 dqb_id;
1217 __le64 dqb_spacemod;
1218 __le64 dqb_inodemod;
1219 };
1220
1221
1222
1223
1224
1225
1226 struct ocfs2_disk_dqtrailer {
1227 struct ocfs2_block_check dq_check;
1228
1229 };
1230
1231 static inline struct ocfs2_disk_dqtrailer *ocfs2_block_dqtrailer(int blocksize,
1232 void *buf)
1233 {
1234 char *ptr = buf;
1235 ptr += blocksize - OCFS2_QBLK_RESERVED_SPACE;
1236
1237 return (struct ocfs2_disk_dqtrailer *)ptr;
1238 }
1239
1240 #ifdef __KERNEL__
1241 static inline int ocfs2_fast_symlink_chars(struct super_block *sb)
1242 {
1243 return sb->s_blocksize -
1244 offsetof(struct ocfs2_dinode, id2.i_symlink);
1245 }
1246
1247 static inline int ocfs2_max_inline_data_with_xattr(struct super_block *sb,
1248 struct ocfs2_dinode *di)
1249 {
1250 unsigned int xattrsize = le16_to_cpu(di->i_xattr_inline_size);
1251
1252 if (le16_to_cpu(di->i_dyn_features) & OCFS2_INLINE_XATTR_FL)
1253 return sb->s_blocksize -
1254 offsetof(struct ocfs2_dinode, id2.i_data.id_data) -
1255 xattrsize;
1256 else
1257 return sb->s_blocksize -
1258 offsetof(struct ocfs2_dinode, id2.i_data.id_data);
1259 }
1260
1261 static inline int ocfs2_extent_recs_per_inode(struct super_block *sb)
1262 {
1263 int size;
1264
1265 size = sb->s_blocksize -
1266 offsetof(struct ocfs2_dinode, id2.i_list.l_recs);
1267
1268 return size / sizeof(struct ocfs2_extent_rec);
1269 }
1270
1271 static inline int ocfs2_extent_recs_per_inode_with_xattr(
1272 struct super_block *sb,
1273 struct ocfs2_dinode *di)
1274 {
1275 int size;
1276 unsigned int xattrsize = le16_to_cpu(di->i_xattr_inline_size);
1277
1278 if (le16_to_cpu(di->i_dyn_features) & OCFS2_INLINE_XATTR_FL)
1279 size = sb->s_blocksize -
1280 offsetof(struct ocfs2_dinode, id2.i_list.l_recs) -
1281 xattrsize;
1282 else
1283 size = sb->s_blocksize -
1284 offsetof(struct ocfs2_dinode, id2.i_list.l_recs);
1285
1286 return size / sizeof(struct ocfs2_extent_rec);
1287 }
1288
1289 static inline int ocfs2_extent_recs_per_dx_root(struct super_block *sb)
1290 {
1291 int size;
1292
1293 size = sb->s_blocksize -
1294 offsetof(struct ocfs2_dx_root_block, dr_list.l_recs);
1295
1296 return size / sizeof(struct ocfs2_extent_rec);
1297 }
1298
1299 static inline int ocfs2_chain_recs_per_inode(struct super_block *sb)
1300 {
1301 int size;
1302
1303 size = sb->s_blocksize -
1304 offsetof(struct ocfs2_dinode, id2.i_chain.cl_recs);
1305
1306 return size / sizeof(struct ocfs2_chain_rec);
1307 }
1308
1309 static inline u16 ocfs2_extent_recs_per_eb(struct super_block *sb)
1310 {
1311 int size;
1312
1313 size = sb->s_blocksize -
1314 offsetof(struct ocfs2_extent_block, h_list.l_recs);
1315
1316 return size / sizeof(struct ocfs2_extent_rec);
1317 }
1318
1319 static inline u16 ocfs2_extent_recs_per_gd(struct super_block *sb)
1320 {
1321 int size;
1322
1323 size = sb->s_blocksize -
1324 offsetof(struct ocfs2_group_desc, bg_list.l_recs);
1325
1326 return size / sizeof(struct ocfs2_extent_rec);
1327 }
1328
1329 static inline int ocfs2_dx_entries_per_leaf(struct super_block *sb)
1330 {
1331 int size;
1332
1333 size = sb->s_blocksize -
1334 offsetof(struct ocfs2_dx_leaf, dl_list.de_entries);
1335
1336 return size / sizeof(struct ocfs2_dx_entry);
1337 }
1338
1339 static inline int ocfs2_dx_entries_per_root(struct super_block *sb)
1340 {
1341 int size;
1342
1343 size = sb->s_blocksize -
1344 offsetof(struct ocfs2_dx_root_block, dr_entries.de_entries);
1345
1346 return size / sizeof(struct ocfs2_dx_entry);
1347 }
1348
1349 static inline u16 ocfs2_local_alloc_size(struct super_block *sb)
1350 {
1351 u16 size;
1352
1353 size = sb->s_blocksize -
1354 offsetof(struct ocfs2_dinode, id2.i_lab.la_bitmap);
1355
1356 return size;
1357 }
1358
1359 static inline int ocfs2_group_bitmap_size(struct super_block *sb,
1360 int suballocator,
1361 u32 feature_incompat)
1362 {
1363 int size = sb->s_blocksize -
1364 offsetof(struct ocfs2_group_desc, bg_bitmap);
1365
1366
1367
1368
1369
1370
1371
1372 if (suballocator &&
1373 (feature_incompat & OCFS2_FEATURE_INCOMPAT_DISCONTIG_BG))
1374 size = OCFS2_MAX_BG_BITMAP_SIZE;
1375
1376 return size;
1377 }
1378
1379 static inline int ocfs2_truncate_recs_per_inode(struct super_block *sb)
1380 {
1381 int size;
1382
1383 size = sb->s_blocksize -
1384 offsetof(struct ocfs2_dinode, id2.i_dealloc.tl_recs);
1385
1386 return size / sizeof(struct ocfs2_truncate_rec);
1387 }
1388
1389 static inline u64 ocfs2_backup_super_blkno(struct super_block *sb, int index)
1390 {
1391 u64 offset = OCFS2_BACKUP_SB_START;
1392
1393 if (index >= 0 && index < OCFS2_MAX_BACKUP_SUPERBLOCKS) {
1394 offset <<= (2 * index);
1395 offset >>= sb->s_blocksize_bits;
1396 return offset;
1397 }
1398
1399 return 0;
1400
1401 }
1402
1403 static inline u16 ocfs2_xattr_recs_per_xb(struct super_block *sb)
1404 {
1405 int size;
1406
1407 size = sb->s_blocksize -
1408 offsetof(struct ocfs2_xattr_block,
1409 xb_attrs.xb_root.xt_list.l_recs);
1410
1411 return size / sizeof(struct ocfs2_extent_rec);
1412 }
1413
1414 static inline u16 ocfs2_extent_recs_per_rb(struct super_block *sb)
1415 {
1416 int size;
1417
1418 size = sb->s_blocksize -
1419 offsetof(struct ocfs2_refcount_block, rf_list.l_recs);
1420
1421 return size / sizeof(struct ocfs2_extent_rec);
1422 }
1423
1424 static inline u16 ocfs2_refcount_recs_per_rb(struct super_block *sb)
1425 {
1426 int size;
1427
1428 size = sb->s_blocksize -
1429 offsetof(struct ocfs2_refcount_block, rf_records.rl_recs);
1430
1431 return size / sizeof(struct ocfs2_refcount_rec);
1432 }
1433
1434 static inline u32
1435 ocfs2_get_ref_rec_low_cpos(const struct ocfs2_refcount_rec *rec)
1436 {
1437 return le64_to_cpu(rec->r_cpos) & OCFS2_32BIT_POS_MASK;
1438 }
1439 #else
1440 static inline int ocfs2_fast_symlink_chars(int blocksize)
1441 {
1442 return blocksize - offsetof(struct ocfs2_dinode, id2.i_symlink);
1443 }
1444
1445 static inline int ocfs2_max_inline_data_with_xattr(int blocksize,
1446 struct ocfs2_dinode *di)
1447 {
1448 if (di && (di->i_dyn_features & OCFS2_INLINE_XATTR_FL))
1449 return blocksize -
1450 offsetof(struct ocfs2_dinode, id2.i_data.id_data) -
1451 di->i_xattr_inline_size;
1452 else
1453 return blocksize -
1454 offsetof(struct ocfs2_dinode, id2.i_data.id_data);
1455 }
1456
1457 static inline int ocfs2_extent_recs_per_inode(int blocksize)
1458 {
1459 int size;
1460
1461 size = blocksize -
1462 offsetof(struct ocfs2_dinode, id2.i_list.l_recs);
1463
1464 return size / sizeof(struct ocfs2_extent_rec);
1465 }
1466
1467 static inline int ocfs2_chain_recs_per_inode(int blocksize)
1468 {
1469 int size;
1470
1471 size = blocksize -
1472 offsetof(struct ocfs2_dinode, id2.i_chain.cl_recs);
1473
1474 return size / sizeof(struct ocfs2_chain_rec);
1475 }
1476
1477 static inline int ocfs2_extent_recs_per_eb(int blocksize)
1478 {
1479 int size;
1480
1481 size = blocksize -
1482 offsetof(struct ocfs2_extent_block, h_list.l_recs);
1483
1484 return size / sizeof(struct ocfs2_extent_rec);
1485 }
1486
1487 static inline int ocfs2_extent_recs_per_gd(int blocksize)
1488 {
1489 int size;
1490
1491 size = blocksize -
1492 offsetof(struct ocfs2_group_desc, bg_list.l_recs);
1493
1494 return size / sizeof(struct ocfs2_extent_rec);
1495 }
1496
1497 static inline int ocfs2_local_alloc_size(int blocksize)
1498 {
1499 int size;
1500
1501 size = blocksize -
1502 offsetof(struct ocfs2_dinode, id2.i_lab.la_bitmap);
1503
1504 return size;
1505 }
1506
1507 static inline int ocfs2_group_bitmap_size(int blocksize,
1508 int suballocator,
1509 uint32_t feature_incompat)
1510 {
1511 int size = sb->s_blocksize -
1512 offsetof(struct ocfs2_group_desc, bg_bitmap);
1513
1514
1515
1516
1517
1518
1519
1520 if (suballocator &&
1521 (feature_incompat & OCFS2_FEATURE_INCOMPAT_DISCONTIG_BG))
1522 size = OCFS2_MAX_BG_BITMAP_SIZE;
1523
1524 return size;
1525 }
1526
1527 static inline int ocfs2_truncate_recs_per_inode(int blocksize)
1528 {
1529 int size;
1530
1531 size = blocksize -
1532 offsetof(struct ocfs2_dinode, id2.i_dealloc.tl_recs);
1533
1534 return size / sizeof(struct ocfs2_truncate_rec);
1535 }
1536
1537 static inline uint64_t ocfs2_backup_super_blkno(int blocksize, int index)
1538 {
1539 uint64_t offset = OCFS2_BACKUP_SB_START;
1540
1541 if (index >= 0 && index < OCFS2_MAX_BACKUP_SUPERBLOCKS) {
1542 offset <<= (2 * index);
1543 offset /= blocksize;
1544 return offset;
1545 }
1546
1547 return 0;
1548 }
1549
1550 static inline int ocfs2_xattr_recs_per_xb(int blocksize)
1551 {
1552 int size;
1553
1554 size = blocksize -
1555 offsetof(struct ocfs2_xattr_block,
1556 xb_attrs.xb_root.xt_list.l_recs);
1557
1558 return size / sizeof(struct ocfs2_extent_rec);
1559 }
1560 #endif
1561
1562
1563 static inline int ocfs2_system_inode_is_global(int type)
1564 {
1565 return ((type >= 0) &&
1566 (type <= OCFS2_LAST_GLOBAL_SYSTEM_INODE));
1567 }
1568
1569 static inline int ocfs2_sprintf_system_inode_name(char *buf, int len,
1570 int type, int slot)
1571 {
1572 int chars;
1573
1574
1575
1576
1577
1578
1579 if (type <= OCFS2_LAST_GLOBAL_SYSTEM_INODE)
1580 chars = snprintf(buf, len, "%s",
1581 ocfs2_system_inodes[type].si_name);
1582 else
1583 chars = snprintf(buf, len,
1584 ocfs2_system_inodes[type].si_name,
1585 slot);
1586
1587 return chars;
1588 }
1589
1590 static inline void ocfs2_set_de_type(struct ocfs2_dir_entry *de,
1591 umode_t mode)
1592 {
1593 de->file_type = fs_umode_to_ftype(mode);
1594 }
1595
1596 static inline int ocfs2_gd_is_discontig(struct ocfs2_group_desc *gd)
1597 {
1598 if ((offsetof(struct ocfs2_group_desc, bg_bitmap) +
1599 le16_to_cpu(gd->bg_size)) !=
1600 offsetof(struct ocfs2_group_desc, bg_list))
1601 return 0;
1602
1603
1604
1605
1606 if (!gd->bg_list.l_next_free_rec)
1607 return 0;
1608 return 1;
1609 }
1610 #endif
1611