blob: bb8309dcd5c1bd2d797b5e774e86c8e2d97e529f [file] [log] [blame]
Christoph Hellwig15aebd22008-02-22 12:39:12 +01001#ifndef _UDF_I_H
2#define _UDF_I_H
Linus Torvalds1da177e2005-04-16 15:20:36 -07003
Alessio Igor Bogani4d0fb622010-11-16 18:40:47 +01004/*
5 * The i_data_sem and i_mutex serve for protection of allocation information
6 * of a regular files and symlinks. This includes all extents belonging to
7 * the file/symlink, a fact whether data are in-inode or in external data
8 * blocks, preallocation, goal block information... When extents are read,
9 * i_mutex or i_data_sem must be held (for reading is enough in case of
10 * i_data_sem). When extents are changed, i_data_sem must be held for writing
11 * and also i_mutex must be held.
12 *
13 * For directories i_mutex is used for all the necessary protection.
14 */
15
Christoph Hellwig15aebd22008-02-22 12:39:12 +010016struct udf_inode_info {
17 struct timespec i_crtime;
18 /* Physical address of inode */
Pekka Enberg5ca4e4b2008-10-15 12:28:03 +020019 struct kernel_lb_addr i_location;
Christoph Hellwig15aebd22008-02-22 12:39:12 +010020 __u64 i_unique;
21 __u32 i_lenEAttr;
22 __u32 i_lenAlloc;
23 __u64 i_lenExtents;
24 __u32 i_next_alloc_block;
25 __u32 i_next_alloc_goal;
Steve Nickeld5e2cf02012-02-14 00:28:42 -050026 __u32 i_checkpoint;
Christoph Hellwig15aebd22008-02-22 12:39:12 +010027 unsigned i_alloc_type : 3;
marcin.slusarz@gmail.comd652eef2008-01-30 22:03:59 +010028 unsigned i_efe : 1; /* extendedFileEntry */
29 unsigned i_use : 1; /* unallocSpaceEntry */
Christoph Hellwig15aebd22008-02-22 12:39:12 +010030 unsigned i_strat4096 : 1;
31 unsigned reserved : 26;
32 union {
Pekka Enberg5ca4e4b2008-10-15 12:28:03 +020033 struct short_ad *i_sad;
34 struct long_ad *i_lad;
Christoph Hellwig15aebd22008-02-22 12:39:12 +010035 __u8 *i_data;
36 } i_ext;
Alessio Igor Bogani4d0fb622010-11-16 18:40:47 +010037 struct rw_semaphore i_data_sem;
Christoph Hellwig15aebd22008-02-22 12:39:12 +010038 struct inode vfs_inode;
39};
40
Linus Torvalds1da177e2005-04-16 15:20:36 -070041static inline struct udf_inode_info *UDF_I(struct inode *inode)
42{
43 return list_entry(inode, struct udf_inode_info, vfs_inode);
44}
45
Christoph Hellwig15aebd22008-02-22 12:39:12 +010046#endif /* _UDF_I_H) */