1 /* SPDX-License-Identifier: GPL-2.0 */
5 struct extent_position {
6 struct buffer_head *bh;
8 struct kernel_lb_addr block;
11 struct udf_ext_cache {
13 struct extent_position epos;
14 /* Start logical offset in bytes */
19 * The i_data_sem and i_mutex serve for protection of allocation information
20 * of a regular files and symlinks. This includes all extents belonging to
21 * the file/symlink, a fact whether data are in-inode or in external data
22 * blocks, preallocation, goal block information... When extents are read,
23 * 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_data_sem must be held for writing
25 * and also i_mutex must be held.
27 * For directories i_mutex is used for all the necessary protection.
30 struct udf_inode_info {
31 struct timespec64 i_crtime;
32 /* Physical address of inode */
33 struct kernel_lb_addr i_location;
38 __u32 i_next_alloc_block;
39 __u32 i_next_alloc_goal;
42 unsigned i_alloc_type : 3;
43 unsigned i_efe : 1; /* extendedFileEntry */
44 unsigned i_use : 1; /* unallocSpaceEntry */
45 unsigned i_strat4096 : 1;
46 unsigned i_streamdir : 1;
47 unsigned reserved : 25;
49 struct kernel_lb_addr i_locStreamdir;
51 struct rw_semaphore i_data_sem;
52 struct udf_ext_cache cached_extent;
53 /* Spinlock for protecting extent cache */
54 spinlock_t i_extent_cache_lock;
55 struct inode vfs_inode;
58 static inline struct udf_inode_info *UDF_I(struct inode *inode)
60 return container_of(inode, struct udf_inode_info, vfs_inode);
63 #endif /* _UDF_I_H) */