1 #ifndef __LINUX_UDF_SB_H
2 #define __LINUX_UDF_SB_H
3
4 /* Since UDF 1.50 is ISO 13346 based... */
5 #define UDF_SUPER_MAGIC 0x15013346
6
7 #define UDF_MAX_READ_VERSION 0x0200
8 #define UDF_MAX_WRITE_VERSION 0x0200
9
10 #define UDF_FLAG_USE_EXTENDED_FE 0
11 #define UDF_VERS_USE_EXTENDED_FE 0x0200
12 #define UDF_FLAG_USE_STREAMS 1
13 #define UDF_VERS_USE_STREAMS 0x0200
14 #define UDF_FLAG_USE_SHORT_AD 2
15 #define UDF_FLAG_USE_AD_IN_ICB 3
16 #define UDF_FLAG_USE_FILE_CTIME_EA 4
17 #define UDF_FLAG_STRICT 5
18 #define UDF_FLAG_UNDELETE 6
19 #define UDF_FLAG_UNHIDE 7
20 #define UDF_FLAG_VARCONV 8
21
22 #define UDF_PART_FLAG_UNALLOC_BITMAP 0x0001
23 #define UDF_PART_FLAG_UNALLOC_TABLE 0x0002
24 #define UDF_PART_FLAG_FREED_BITMAP 0x0004
25 #define UDF_PART_FLAG_FREED_TABLE 0x0008
26
27 #define UDF_SB_FREE(X)\
28 {\
29 if (UDF_SB(X))\
30 {\
31 if (UDF_SB_PARTMAPS(X))\
32 kfree(UDF_SB_PARTMAPS(X));\
33 UDF_SB_PARTMAPS(X) = NULL;\
34 }\
35 }
36 #define UDF_SB(X) (&((X)->u.udf_sb))
37
38 #define UDF_SB_ALLOC_PARTMAPS(X,Y)\
39 {\
40 UDF_SB_NUMPARTS(X) = Y;\
41 UDF_SB_PARTMAPS(X) = kmalloc(sizeof(struct udf_part_map) * Y, GFP_KERNEL);\
42 memset(UDF_SB_PARTMAPS(X), 0x00, sizeof(struct udf_part_map) * Y);\
43 }
44
45 #define UDF_QUERY_FLAG(X,Y) ( UDF_SB(X)->s_flags & ( 1 << (Y) ) )
46 #define UDF_SET_FLAG(X,Y) ( UDF_SB(X)->s_flags |= ( 1 << (Y) ) )
47 #define UDF_CLEAR_FLAG(X,Y) ( UDF_SB(X)->s_flags &= ~( 1 << (Y) ) )
48
49 #define UDF_UPDATE_UDFREV(X,Y) ( ((Y) > UDF_SB_UDFREV(X)) ? UDF_SB_UDFREV(X) = (Y) : UDF_SB_UDFREV(X) )
50
51 #define UDF_SB_PARTMAPS(X) ( UDF_SB(X)->s_partmaps )
52 #define UDF_SB_PARTTYPE(X,Y) ( UDF_SB_PARTMAPS(X)[(Y)].s_partition_type )
53 #define UDF_SB_PARTROOT(X,Y) ( UDF_SB_PARTMAPS(X)[(Y)].s_partition_root )
54 #define UDF_SB_PARTLEN(X,Y) ( UDF_SB_PARTMAPS(X)[(Y)].s_partition_len )
55 #define UDF_SB_PARTVSN(X,Y) ( UDF_SB_PARTMAPS(X)[(Y)].s_volumeseqnum )
56 #define UDF_SB_PARTNUM(X,Y) ( UDF_SB_PARTMAPS(X)[(Y)].s_partition_num )
57 #define UDF_SB_TYPESPAR(X,Y) ( UDF_SB_PARTMAPS(X)[(Y)].s_type_specific.s_sparing )
58 #define UDF_SB_TYPEVIRT(X,Y) ( UDF_SB_PARTMAPS(X)[(Y)].s_type_specific.s_virtual )
59 #define UDF_SB_PARTFUNC(X,Y) ( UDF_SB_PARTMAPS(X)[(Y)].s_partition_func )
60 #define UDF_SB_PARTFLAGS(X,Y) ( UDF_SB_PARTMAPS(X)[(Y)].s_partition_flags )
61
62 #define UDF_SB_VOLIDENT(X) ( UDF_SB(X)->s_volident )
63 #define UDF_SB_NUMPARTS(X) ( UDF_SB(X)->s_partitions )
64 #define UDF_SB_PARTITION(X) ( UDF_SB(X)->s_partition )
65 #define UDF_SB_SESSION(X) ( UDF_SB(X)->s_session )
66 #define UDF_SB_ANCHOR(X) ( UDF_SB(X)->s_anchor )
67 #define UDF_SB_LASTBLOCK(X) ( UDF_SB(X)->s_lastblock )
68 #define UDF_SB_LVIDBH(X) ( UDF_SB(X)->s_lvidbh )
69 #define UDF_SB_LVID(X) ( (struct LogicalVolIntegrityDesc *)UDF_SB_LVIDBH(X)->b_data )
70 #define UDF_SB_LVIDIU(X) ( (struct LogicalVolIntegrityDescImpUse *)&(UDF_SB_LVID(X)->impUse[UDF_SB_LVID(X)->numOfPartitions * 2 * sizeof(Uint32)/sizeof(Uint8)]) )
71
72 #define UDF_SB_LOADED_BLOCK_BITMAPS(X) ( UDF_SB(X)->s_loaded_block_bitmaps )
73 #define UDF_SB_BLOCK_BITMAP_NUMBER(X,Y) ( UDF_SB(X)->s_block_bitmap_number[(Y)] )
74 #define UDF_SB_BLOCK_BITMAP(X,Y) ( UDF_SB(X)->s_block_bitmap[(Y)] )
75 #define UDF_SB_UMASK(X) ( UDF_SB(X)->s_umask )
76 #define UDF_SB_GID(X) ( UDF_SB(X)->s_gid )
77 #define UDF_SB_UID(X) ( UDF_SB(X)->s_uid )
78 #define UDF_SB_RECORDTIME(X) ( UDF_SB(X)->s_recordtime )
79 #define UDF_SB_SERIALNUM(X) ( UDF_SB(X)->s_serialnum )
80 #define UDF_SB_UDFREV(X) ( UDF_SB(X)->s_udfrev )
81 #define UDF_SB_FLAGS(X) ( UDF_SB(X)->s_flags )
82 #define UDF_SB_VAT(X) ( UDF_SB(X)->s_vat )
83
84 #endif /* __LINUX_UDF_SB_H */
85
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.