1 #ifndef __LINUX_UDF_SB_H
2 #define __LINUX_UDF_SB_H
4 #include <linux/udf_167.h>
5 #include <linux/udf_udf.h>
7 /* Since UDF 1.50 is ISO 13346 based... */
8 #define UDF_SUPER_MAGIC 0x15013346
10 #define UDF_FLAG_STRICT 0x00000001U
11 #define UDF_FLAG_UNDELETE 0x00000002U
12 #define UDF_FLAG_UNHIDE 0x00000004U
13 #define UDF_FLAG_VARCONV 0x00000008U
15 #define UDF_SB_FREE(X)\
19 if (UDF_SB_PARTMAPS(X))\
20 kfree(UDF_SB_PARTMAPS(X));\
21 UDF_SB_PARTMAPS(X) = NULL;\
24 #define UDF_SB(X) (&((X)->u.udf_sb))
26 #define UDF_SB_ALLOC_PARTMAPS(X,Y)\
28 UDF_SB_NUMPARTS(X) = Y;\
29 UDF_SB_PARTMAPS(X) = kmalloc(sizeof(struct udf_part_map) * Y, GFP_KERNEL);\
32 #define IS_STRICT(X) ( UDF_SB(X)->s_flags & UDF_FLAG_STRICT )
33 #define IS_UNDELETE(X) ( UDF_SB(X)->s_flags & UDF_FLAG_UNDELETE )
34 #define IS_UNHIDE(X) ( UDF_SB(X)->s_flags & UDF_FLAG_UNHIDE )
36 #define UDF_SB_SESSION(X) ( UDF_SB(X)->s_session )
37 #define UDF_SB_ANCHOR(X) ( UDF_SB(X)->s_anchor )
38 #define UDF_SB_NUMPARTS(X) ( UDF_SB(X)->s_partitions )
39 #define UDF_SB_VOLUME(X) ( UDF_SB(X)->s_thisvolume )
40 #define UDF_SB_LASTBLOCK(X) ( UDF_SB(X)->s_lastblock )
41 #define UDF_SB_VOLDESC(X) ( UDF_SB(X)->s_voldesc )
42 #define UDF_SB_LVIDBH(X) ( UDF_SB(X)->s_lvidbh )
43 #define UDF_SB_LVID(X) ( (struct LogicalVolIntegrityDesc *)UDF_SB_LVIDBH(X)->b_data )
44 #define UDF_SB_LVIDIU(X) ( (struct LogicalVolIntegrityDescImpUse *)&(UDF_SB_LVID(sb)->impUse[UDF_SB_LVID(sb)->numOfPartitions * 2 * sizeof(Uint32)/sizeof(Uint8)]) )
45 #define UDF_SB_PARTITION(X) ( UDF_SB(X)->s_partition )
46 #define UDF_SB_RECORDTIME(X) ( UDF_SB(X)->s_recordtime )
47 #define UDF_SB_VOLIDENT(X) ( UDF_SB(X)->s_volident )
48 #define UDF_SB_PARTMAPS(X) ( UDF_SB(X)->s_partmaps )
49 #define UDF_SB_LOCATION(X) ( UDF_SB(X)->s_location )
50 #define UDF_SB_SERIALNUM(X) ( UDF_SB(X)->s_serialnum )
51 #define UDF_SB_CHARSET(X) ( UDF_SB(X)->s_nls_iocharset )
52 #define UDF_SB_VAT(X) ( UDF_SB(X)->s_vat )
54 #define UDF_SB_BLOCK_BITMAP_NUMBER(X,Y) ( UDF_SB(X)->s_block_bitmap_number[Y] )
55 #define UDF_SB_BLOCK_BITMAP(X,Y) ( UDF_SB(X)->s_block_bitmap[Y] )
56 #define UDF_SB_LOADED_BLOCK_BITMAPS(X) ( UDF_SB(X)->s_loaded_block_bitmaps )
58 #define UDF_SB_PARTTYPE(X,Y) ( UDF_SB_PARTMAPS(X)[Y].s_partition_type )
59 #define UDF_SB_PARTROOT(X,Y) ( UDF_SB_PARTMAPS(X)[Y].s_partition_root )
60 #define UDF_SB_PARTLEN(X,Y) ( UDF_SB_PARTMAPS(X)[Y].s_partition_len )
61 #define UDF_SB_PARTVSN(X,Y) ( UDF_SB_PARTMAPS(X)[Y].s_volumeseqnum )
62 #define UDF_SB_PARTNUM(X,Y) ( UDF_SB_PARTMAPS(X)[Y].s_partition_num )
63 #define UDF_SB_TYPESPAR(X,Y) ( UDF_SB_PARTMAPS(X)[Y].s_type_specific.s_sparing )
64 #define UDF_SB_TYPEVIRT(X,Y) ( UDF_SB_PARTMAPS(X)[Y].s_type_specific.s_virtual )
66 #endif /* __LINUX_UDF_SB_H */