2 * Copyright 2000 Hans Reiser
3 * See README for licensing and copyright details
5 * Ported to FreeBSD by Jean-Sébastien Pédron <jspedron@club-internet.fr>
10 #ifndef _GNU_REISERFS_REISERFS_FS_I_H
11 #define _GNU_REISERFS_REISERFS_FS_I_H
13 #include <sys/queue.h>
15 /* Bitmasks for i_flags field in reiserfs-specific part of inode */
18 * This says what format of key do all items (but stat data) of
19 * an object have. If this is set, that format is 3.6 otherwise
22 i_item_key_version_mask = 0x0001,
23 /* If this is unset, object has 3.5 stat data, otherwise, it has
24 * 3.6 stat data with 64bit size, 32bit nlink etc. */
25 i_stat_data_version_mask = 0x0002,
26 /* File might need tail packing on close */
27 i_pack_on_close_mask = 0x0004,
28 /* Don't pack tail of file */
29 i_nopack_mask = 0x0008,
30 /* If those is set, "safe link" was created for this file during
31 * truncate or unlink. Safe link is used to avoid leakage of disk
32 * space on crash with some files open, but unlinked. */
33 i_link_saved_unlink_mask = 0x0010,
34 i_link_saved_truncate_mask = 0x0020,
35 i_priv_object = 0x0080,
36 i_has_xattr_dir = 0x0100,
37 } reiserfs_inode_flags;
39 struct reiserfs_node {
40 struct vnode *i_vnode;
41 struct vnode *i_devvp;
47 struct reiserfs_sb_info *i_reiserfs;
49 uint32_t i_flag; /* Flags, see below */
50 uint32_t i_key[4]; /* Key is still 4 32 bit
52 uint32_t i_flags; /* Transient inode flags that
53 are never stored on disk.
54 Bitmasks for this field
56 uint32_t i_first_direct_byte; /* Offset of first byte stored
58 uint32_t i_attrs; /* Copy of persistent inode
59 flags read from sd_attrs. */
61 uint16_t i_mode; /* IFMT, permissions. */
62 uint16_t i_nlink; /* File link count. */
63 uint64_t i_size; /* File byte count. */
65 uid_t i_uid; /* File owner. */
66 gid_t i_gid; /* File group. */
67 struct timespec i_atime; /* Last access time. */
68 struct timespec i_mtime; /* Last modified time. */
69 struct timespec i_ctime; /* Last inode change time. */
72 uint32_t i_generation;
75 #define VTOI(vp) ((struct reiserfs_node *)(vp)->v_data)
76 #define ITOV(ip) ((ip)->i_vnode)
78 /* These flags are kept in i_flag. */
79 #define IN_HASHED 0x0020 /* Inode is on hash list */
81 /* This overlays the fid structure (see mount.h) */
83 uint16_t rfid_len; /* Length of structure */
84 uint16_t rfid_pad; /* Force 32-bit alignment */
85 ino_t rfid_dirid; /* File key */
87 uint32_t rfid_gen; /* Generation number */
90 #endif /* !defined _GNU_REISERFS_REISERFS_FS_I_H */