1 /*
2  * Copyright 2000-2002 by Hans Reiser, licensing governed by reiserfs/README
3  */
4 #ifndef _REISER_FS_I
5 #define _REISER_FS_I
6 
7 #include <linux/list.h>
8 
9 /** bitmasks for i_flags field in reiserfs-specific part of inode */
10 typedef enum {
11     /** this says what format of key do all items (but stat data) of
12 	an object have.  If this is set, that format is 3.6 otherwise
13 	- 3.5 */
14     i_item_key_version_mask    =  0x0001,
15     /** If this is unset, object has 3.5 stat data, otherwise, it has
16 	3.6 stat data with 64bit size, 32bit nlink etc. */
17     i_stat_data_version_mask   =  0x0002,
18     /** file might need tail packing on close */
19     i_pack_on_close_mask       =  0x0004,
20     /** don't pack tail of file */
21     i_nopack_mask              =  0x0008,
22     /** If those is set, "safe link" was created for this file during
23 	truncate or unlink. Safe link is used to avoid leakage of disk
24 	space on crash with some files open, but unlinked. */
25     i_link_saved_unlink_mask   =  0x0010,
26     i_link_saved_truncate_mask =  0x0020
27 } reiserfs_inode_flags;
28 
29 
30 struct reiserfs_inode_info {
31     __u32 i_key [4];/* key is still 4 32 bit integers */
32 
33     /** transient inode flags that are never stored on disk. Bitmasks
34 	for this field are defined above. */
35     __u32 i_flags;
36 
37     __u32 i_first_direct_byte; // offset of first byte stored in direct item.
38 
39     /* copy of persistent inode flags read from sd_attrs. */
40     __u32 i_attrs;
41 
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 */
46 
47     int new_packing_locality:1;		/* new_packig_locality is created; new blocks
48 					 * for the contents of this directory should be
49 					 * displaced */
50 
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 */
54     unsigned long i_trans_id ;
55     unsigned long i_trans_index ;
56 
57     /* direct io needs to make sure the tail is on disk to avoid
58      * buffer alias problems.  This records the transaction last
59      * involved in a direct->indirect conversion for this file
60      */
61     unsigned long i_tail_trans_id;
62     unsigned long i_tail_trans_index;
63 };
64 
65 #endif
66 
67