1 /* SPDX-License-Identifier: GPL-2.0 */ << 2 #ifndef _UDF_I_H 1 #ifndef _UDF_I_H 3 #define _UDF_I_H 2 #define _UDF_I_H 4 3 5 struct extent_position { 4 struct extent_position { 6 struct buffer_head *bh; 5 struct buffer_head *bh; 7 uint32_t offset; 6 uint32_t offset; 8 struct kernel_lb_addr block; 7 struct kernel_lb_addr block; 9 }; 8 }; 10 9 11 struct udf_ext_cache { 10 struct udf_ext_cache { 12 /* Extent position */ 11 /* Extent position */ 13 struct extent_position epos; 12 struct extent_position epos; 14 /* Start logical offset in bytes */ 13 /* Start logical offset in bytes */ 15 loff_t lstart; 14 loff_t lstart; 16 }; 15 }; 17 16 18 /* 17 /* 19 * The i_data_sem and i_mutex serve for protec 18 * The i_data_sem and i_mutex serve for protection of allocation information 20 * of a regular files and symlinks. This inclu 19 * of a regular files and symlinks. This includes all extents belonging to 21 * the file/symlink, a fact whether data are i 20 * the file/symlink, a fact whether data are in-inode or in external data 22 * blocks, preallocation, goal block informati 21 * blocks, preallocation, goal block information... When extents are read, 23 * i_mutex or i_data_sem must be held (for rea 22 * i_mutex or i_data_sem must be held (for reading is enough in case of 24 * i_data_sem). When extents are changed, i_da 23 * i_data_sem). When extents are changed, i_data_sem must be held for writing 25 * and also i_mutex must be held. 24 * and also i_mutex must be held. 26 * 25 * 27 * For directories i_mutex is used for all the 26 * For directories i_mutex is used for all the necessary protection. 28 */ 27 */ 29 28 30 struct udf_inode_info { 29 struct udf_inode_info { 31 struct timespec64 i_crtime; !! 30 struct timespec i_crtime; 32 /* Physical address of inode */ 31 /* Physical address of inode */ 33 struct kernel_lb_addr i_loca 32 struct kernel_lb_addr i_location; 34 __u64 i_unique; 33 __u64 i_unique; 35 __u32 i_lenEAttr; 34 __u32 i_lenEAttr; 36 __u32 i_lenAlloc; 35 __u32 i_lenAlloc; 37 __u64 i_lenExtents; 36 __u64 i_lenExtents; 38 __u32 i_next_alloc_b 37 __u32 i_next_alloc_block; 39 __u32 i_next_alloc_g 38 __u32 i_next_alloc_goal; 40 __u32 i_checkpoint; 39 __u32 i_checkpoint; 41 __u32 i_extraPerms; << 42 unsigned i_alloc_type : 40 unsigned i_alloc_type : 3; 43 unsigned i_efe : 1; 41 unsigned i_efe : 1; /* extendedFileEntry */ 44 unsigned i_use : 1; 42 unsigned i_use : 1; /* unallocSpaceEntry */ 45 unsigned i_strat4096 : 43 unsigned i_strat4096 : 1; 46 unsigned i_streamdir : !! 44 unsigned reserved : 26; 47 unsigned i_hidden : 1; !! 45 union { 48 unsigned reserved : 24; !! 46 struct short_ad *i_sad; 49 __u8 *i_data; !! 47 struct long_ad *i_lad; 50 struct kernel_lb_addr i_locStreamdir !! 48 __u8 *i_data; 51 __u64 i_lenStreams; !! 49 } i_ext; 52 struct rw_semaphore i_data_sem; 50 struct rw_semaphore i_data_sem; 53 struct udf_ext_cache cached_extent; 51 struct udf_ext_cache cached_extent; 54 /* Spinlock for protecting extent cach 52 /* Spinlock for protecting extent cache */ 55 spinlock_t i_extent_cache_lock; 53 spinlock_t i_extent_cache_lock; 56 struct inode vfs_inode; 54 struct inode vfs_inode; 57 }; 55 }; 58 56 59 static inline struct udf_inode_info *UDF_I(str 57 static inline struct udf_inode_info *UDF_I(struct inode *inode) 60 { 58 { 61 return container_of(inode, struct udf_ 59 return container_of(inode, struct udf_inode_info, vfs_inode); 62 } 60 } 63 61 64 #endif /* _UDF_I_H) */ 62 #endif /* _UDF_I_H) */ 65 63
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.