Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _UDF_I_H
0003 #define _UDF_I_H
0004 
0005 struct extent_position {
0006     struct buffer_head *bh;
0007     uint32_t offset;
0008     struct kernel_lb_addr block;
0009 };
0010 
0011 struct udf_ext_cache {
0012     /* Extent position */
0013     struct extent_position epos;
0014     /* Start logical offset in bytes */
0015     loff_t lstart;
0016 };
0017 
0018 /*
0019  * The i_data_sem and i_mutex serve for protection of allocation information
0020  * of a regular files and symlinks. This includes all extents belonging to
0021  * the file/symlink, a fact whether data are in-inode or in external data
0022  * blocks, preallocation, goal block information... When extents are read,
0023  * i_mutex or i_data_sem must be held (for reading is enough in case of
0024  * i_data_sem). When extents are changed, i_data_sem must be held for writing
0025  * and also i_mutex must be held.
0026  *
0027  * For directories i_mutex is used for all the necessary protection.
0028  */
0029 
0030 struct udf_inode_info {
0031     struct timespec64   i_crtime;
0032     /* Physical address of inode */
0033     struct kernel_lb_addr       i_location;
0034     __u64           i_unique;
0035     __u32           i_lenEAttr;
0036     __u32           i_lenAlloc;
0037     __u64           i_lenExtents;
0038     __u32           i_next_alloc_block;
0039     __u32           i_next_alloc_goal;
0040     __u32           i_checkpoint;
0041     __u32           i_extraPerms;
0042     unsigned        i_alloc_type : 3;
0043     unsigned        i_efe : 1;  /* extendedFileEntry */
0044     unsigned        i_use : 1;  /* unallocSpaceEntry */
0045     unsigned        i_strat4096 : 1;
0046     unsigned        i_streamdir : 1;
0047     unsigned        reserved : 25;
0048     __u8            *i_data;
0049     struct kernel_lb_addr   i_locStreamdir;
0050     __u64           i_lenStreams;
0051     struct rw_semaphore i_data_sem;
0052     struct udf_ext_cache cached_extent;
0053     /* Spinlock for protecting extent cache */
0054     spinlock_t i_extent_cache_lock;
0055     struct inode vfs_inode;
0056 };
0057 
0058 static inline struct udf_inode_info *UDF_I(struct inode *inode)
0059 {
0060     return container_of(inode, struct udf_inode_info, vfs_inode);
0061 }
0062 
0063 #endif /* _UDF_I_H) */