Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[linux-2.6-block.git] / fs / udf / udf_i.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
15aebd28
CH
2#ifndef _UDF_I_H
3#define _UDF_I_H
4
99600051
NJ
5struct extent_position {
6 struct buffer_head *bh;
7 uint32_t offset;
8 struct kernel_lb_addr block;
9};
10
11struct udf_ext_cache {
12 /* Extent position */
13 struct extent_position epos;
14 /* Start logical offset in bytes */
15 loff_t lstart;
16};
17
4d0fb621
AIB
18/*
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.
26 *
27 * For directories i_mutex is used for all the necessary protection.
28 */
29
15aebd28 30struct udf_inode_info {
c3b9cecd 31 struct timespec64 i_crtime;
15aebd28 32 /* Physical address of inode */
5ca4e4be 33 struct kernel_lb_addr i_location;
15aebd28
CH
34 __u64 i_unique;
35 __u32 i_lenEAttr;
36 __u32 i_lenAlloc;
37 __u64 i_lenExtents;
38 __u32 i_next_alloc_block;
39 __u32 i_next_alloc_goal;
d5e2cf07 40 __u32 i_checkpoint;
15aebd28 41 unsigned i_alloc_type : 3;
d652eefb 42 unsigned i_efe : 1; /* extendedFileEntry */
43 unsigned i_use : 1; /* unallocSpaceEntry */
15aebd28
CH
44 unsigned i_strat4096 : 1;
45 unsigned reserved : 26;
46 union {
5ca4e4be
PE
47 struct short_ad *i_sad;
48 struct long_ad *i_lad;
15aebd28
CH
49 __u8 *i_data;
50 } i_ext;
4d0fb621 51 struct rw_semaphore i_data_sem;
99600051
NJ
52 struct udf_ext_cache cached_extent;
53 /* Spinlock for protecting extent cache */
54 spinlock_t i_extent_cache_lock;
15aebd28
CH
55 struct inode vfs_inode;
56};
1da177e4 57
1da177e4
LT
58static inline struct udf_inode_info *UDF_I(struct inode *inode)
59{
db6172c4 60 return container_of(inode, struct udf_inode_info, vfs_inode);
1da177e4
LT
61}
62
15aebd28 63#endif /* _UDF_I_H) */