Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _REISER_FS_I |
| 2 | #define _REISER_FS_I |
| 3 | |
| 4 | #include <linux/list.h> |
| 5 | |
| 6 | struct reiserfs_journal_list; |
| 7 | |
| 8 | /** bitmasks for i_flags field in reiserfs-specific part of inode */ |
| 9 | typedef enum { |
| 10 | /** this says what format of key do all items (but stat data) of |
| 11 | an object have. If this is set, that format is 3.6 otherwise |
| 12 | - 3.5 */ |
Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 13 | i_item_key_version_mask = 0x0001, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | /** If this is unset, object has 3.5 stat data, otherwise, it has |
| 15 | 3.6 stat data with 64bit size, 32bit nlink etc. */ |
Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 16 | i_stat_data_version_mask = 0x0002, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | /** file might need tail packing on close */ |
Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 18 | i_pack_on_close_mask = 0x0004, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | /** don't pack tail of file */ |
Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 20 | i_nopack_mask = 0x0008, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | /** If those is set, "safe link" was created for this file during |
| 22 | truncate or unlink. Safe link is used to avoid leakage of disk |
| 23 | space on crash with some files open, but unlinked. */ |
Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 24 | i_link_saved_unlink_mask = 0x0010, |
| 25 | i_link_saved_truncate_mask = 0x0020, |
| 26 | i_has_xattr_dir = 0x0040, |
| 27 | i_data_log = 0x0080, |
Vladimir Saveliev | de14569 | 2007-01-22 20:40:46 -0800 | [diff] [blame] | 28 | i_ever_mapped = 0x0100 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | } reiserfs_inode_flags; |
| 30 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | struct reiserfs_inode_info { |
Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 32 | __u32 i_key[4]; /* key is still 4 32 bit integers */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | /** transient inode flags that are never stored on disk. Bitmasks |
| 34 | for this field are defined above. */ |
Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 35 | __u32 i_flags; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | |
Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 37 | __u32 i_first_direct_byte; // offset of first byte stored in direct item. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | |
Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 39 | /* copy of persistent inode flags read from sd_attrs. */ |
| 40 | __u32 i_attrs; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | |
Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 42 | int i_prealloc_block; /* first unused block of a sequence of unused blocks */ |
| 43 | int i_prealloc_count; /* length of that sequence */ |
| 44 | struct list_head i_prealloc_list; /* per-transaction list of inodes which |
| 45 | * have preallocated blocks */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | |
Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 47 | unsigned new_packing_locality:1; /* new_packig_locality is created; new blocks |
| 48 | * for the contents of this directory should be |
| 49 | * displaced */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | |
Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 51 | /* we use these for fsync or O_SYNC to decide which transaction |
| 52 | ** needs to be committed in order for this inode to be properly |
| 53 | ** flushed */ |
Jeff Mahoney | 600ed41 | 2009-03-30 14:02:17 -0400 | [diff] [blame] | 54 | unsigned int i_trans_id; |
Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 55 | struct reiserfs_journal_list *i_jl; |
Vladimir Saveliev | de14569 | 2007-01-22 20:40:46 -0800 | [diff] [blame] | 56 | struct mutex i_mmap; |
Alexey Dobriyan | 068fbb3 | 2006-09-29 01:59:58 -0700 | [diff] [blame] | 57 | #ifdef CONFIG_REISERFS_FS_XATTR |
Jeff Mahoney | 8b6dd72 | 2009-03-30 14:02:36 -0400 | [diff] [blame] | 58 | struct rw_semaphore i_xattr_sem; |
Alexey Dobriyan | 068fbb3 | 2006-09-29 01:59:58 -0700 | [diff] [blame] | 59 | #endif |
Linus Torvalds | bd4c625 | 2005-07-12 20:21:28 -0700 | [diff] [blame] | 60 | struct inode vfs_inode; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 61 | }; |
| 62 | |
| 63 | #endif |