blob: 97959bdfe214231018cd5182248dbe313eb1538b [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _REISER_FS_I
2#define _REISER_FS_I
3
4#include <linux/list.h>
5
6struct reiserfs_journal_list;
7
8/** bitmasks for i_flags field in reiserfs-specific part of inode */
9typedef 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 Torvaldsbd4c6252005-07-12 20:21:28 -070013 i_item_key_version_mask = 0x0001,
Linus Torvalds1da177e2005-04-16 15:20:36 -070014 /** 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 Torvaldsbd4c6252005-07-12 20:21:28 -070016 i_stat_data_version_mask = 0x0002,
Linus Torvalds1da177e2005-04-16 15:20:36 -070017 /** file might need tail packing on close */
Linus Torvaldsbd4c6252005-07-12 20:21:28 -070018 i_pack_on_close_mask = 0x0004,
Linus Torvalds1da177e2005-04-16 15:20:36 -070019 /** don't pack tail of file */
Linus Torvaldsbd4c6252005-07-12 20:21:28 -070020 i_nopack_mask = 0x0008,
Linus Torvalds1da177e2005-04-16 15:20:36 -070021 /** 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 Torvaldsbd4c6252005-07-12 20:21:28 -070024 i_link_saved_unlink_mask = 0x0010,
25 i_link_saved_truncate_mask = 0x0020,
26 i_has_xattr_dir = 0x0040,
27 i_data_log = 0x0080,
Linus Torvalds1da177e2005-04-16 15:20:36 -070028} reiserfs_inode_flags;
29
Linus Torvalds1da177e2005-04-16 15:20:36 -070030struct reiserfs_inode_info {
Linus Torvaldsbd4c6252005-07-12 20:21:28 -070031 __u32 i_key[4]; /* key is still 4 32 bit integers */
Linus Torvalds1da177e2005-04-16 15:20:36 -070032 /** transient inode flags that are never stored on disk. Bitmasks
33 for this field are defined above. */
Linus Torvaldsbd4c6252005-07-12 20:21:28 -070034 __u32 i_flags;
Linus Torvalds1da177e2005-04-16 15:20:36 -070035
Linus Torvaldsbd4c6252005-07-12 20:21:28 -070036 __u32 i_first_direct_byte; // offset of first byte stored in direct item.
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
Linus Torvaldsbd4c6252005-07-12 20:21:28 -070038 /* copy of persistent inode flags read from sd_attrs. */
39 __u32 i_attrs;
Linus Torvalds1da177e2005-04-16 15:20:36 -070040
Linus Torvaldsbd4c6252005-07-12 20:21:28 -070041 int i_prealloc_block; /* first unused block of a sequence of unused blocks */
42 int i_prealloc_count; /* length of that sequence */
43 struct list_head i_prealloc_list; /* per-transaction list of inodes which
44 * have preallocated blocks */
Linus Torvalds1da177e2005-04-16 15:20:36 -070045
Linus Torvaldsbd4c6252005-07-12 20:21:28 -070046 unsigned new_packing_locality:1; /* new_packig_locality is created; new blocks
47 * for the contents of this directory should be
48 * displaced */
Linus Torvalds1da177e2005-04-16 15:20:36 -070049
Linus Torvaldsbd4c6252005-07-12 20:21:28 -070050 /* we use these for fsync or O_SYNC to decide which transaction
51 ** needs to be committed in order for this inode to be properly
52 ** flushed */
Jeff Mahoney600ed412009-03-30 14:02:17 -040053 unsigned int i_trans_id;
Linus Torvaldsbd4c6252005-07-12 20:21:28 -070054 struct reiserfs_journal_list *i_jl;
Al Viro0e4f6a72010-07-04 12:18:57 +040055 atomic_t openers;
56 struct mutex tailpack;
Alexey Dobriyan068fbb32006-09-29 01:59:58 -070057#ifdef CONFIG_REISERFS_FS_XATTR
Jeff Mahoney8b6dd722009-03-30 14:02:36 -040058 struct rw_semaphore i_xattr_sem;
Alexey Dobriyan068fbb32006-09-29 01:59:58 -070059#endif
Linus Torvaldsbd4c6252005-07-12 20:21:28 -070060 struct inode vfs_inode;
Linus Torvalds1da177e2005-04-16 15:20:36 -070061};
62
63#endif