2 #include <linux/ext2_fs.h>
5 * second extended file system inode data in memory
7 struct ext2_inode_info
{
19 * i_block_group is the number of the block group which contains
20 * this file's inode. Constant across the lifetime of the inode,
21 * it is ued for making block allocation decisions - we try to
22 * place a file's data blocks near its inode block, and new inodes
23 * near to their parent directory's inode.
28 * i_next_alloc_block is the logical (file-relative) number of the
29 * most-recently-allocated block in this file. Yes, it is misnamed.
30 * We use this for detecting linearly ascending allocation requests.
32 __u32 i_next_alloc_block
;
35 * i_next_alloc_goal is the *physical* companion to i_next_alloc_block.
36 * it the the physical block number of the block which was most-recently
37 * allocated to this file. This give us the goal (target) for the next
38 * allocation when we detect linearly ascending requests.
40 __u32 i_next_alloc_goal
;
41 __u32 i_prealloc_block
;
42 __u32 i_prealloc_count
;
43 __u32 i_dir_start_lookup
;
44 #ifdef CONFIG_EXT2_FS_XATTR
46 * Extended attributes can be read independently of the main file
47 * data. Taking i_sem even when reading would cause contention
48 * between readers of EAs and writers of regular file data, so
49 * instead we synchronize on xattr_sem when reading or changing
52 struct rw_semaphore xattr_sem
;
54 #ifdef CONFIG_EXT2_FS_POSIX_ACL
55 struct posix_acl
*i_acl
;
56 struct posix_acl
*i_default_acl
;
59 struct inode vfs_inode
;
63 * Inode dynamic state flags
65 #define EXT2_STATE_NEW 0x00000001 /* inode is newly created */
73 * Ok, these declarations are also in <linux/kernel.h> but none of the
74 * ext2 source programs needs to include it so they are duplicated here.
77 static inline struct ext2_inode_info
*EXT2_I(struct inode
*inode
)
79 return container_of(inode
, struct ext2_inode_info
, vfs_inode
);
83 extern int ext2_bg_has_super(struct super_block
*sb
, int group
);
84 extern unsigned long ext2_bg_num_gdb(struct super_block
*sb
, int group
);
85 extern int ext2_new_block (struct inode
*, unsigned long,
86 __u32
*, __u32
*, int *);
87 extern void ext2_free_blocks (struct inode
*, unsigned long,
89 extern unsigned long ext2_count_free_blocks (struct super_block
*);
90 extern unsigned long ext2_count_dirs (struct super_block
*);
91 extern void ext2_check_blocks_bitmap (struct super_block
*);
92 extern struct ext2_group_desc
* ext2_get_group_desc(struct super_block
* sb
,
93 unsigned int block_group
,
94 struct buffer_head
** bh
);
97 extern int ext2_add_link (struct dentry
*, struct inode
*);
98 extern ino_t
ext2_inode_by_name(struct inode
*, struct dentry
*);
99 extern int ext2_make_empty(struct inode
*, struct inode
*);
100 extern struct ext2_dir_entry_2
* ext2_find_entry (struct inode
*,struct dentry
*, struct page
**);
101 extern int ext2_delete_entry (struct ext2_dir_entry_2
*, struct page
*);
102 extern int ext2_empty_dir (struct inode
*);
103 extern struct ext2_dir_entry_2
* ext2_dotdot (struct inode
*, struct page
**);
104 extern void ext2_set_link(struct inode
*, struct ext2_dir_entry_2
*, struct page
*, struct inode
*);
107 extern int ext2_sync_file (struct file
*, struct dentry
*, int);
110 extern struct inode
* ext2_new_inode (struct inode
*, int);
111 extern void ext2_free_inode (struct inode
*);
112 extern unsigned long ext2_count_free_inodes (struct super_block
*);
113 extern void ext2_check_inodes_bitmap (struct super_block
*);
114 extern unsigned long ext2_count_free (struct buffer_head
*, unsigned);
117 extern void ext2_read_inode (struct inode
*);
118 extern int ext2_write_inode (struct inode
*, int);
119 extern void ext2_put_inode (struct inode
*);
120 extern void ext2_delete_inode (struct inode
*);
121 extern int ext2_sync_inode (struct inode
*);
122 extern void ext2_discard_prealloc (struct inode
*);
123 extern int ext2_get_block(struct inode
*, sector_t
, struct buffer_head
*, int);
124 extern void ext2_truncate (struct inode
*);
125 extern int ext2_setattr (struct dentry
*, struct iattr
*);
126 extern void ext2_set_inode_flags(struct inode
*inode
);
129 extern int ext2_ioctl (struct inode
*, struct file
*, unsigned int,
133 extern void ext2_error (struct super_block
*, const char *, const char *, ...)
134 __attribute__ ((format (printf
, 3, 4)));
135 extern void ext2_warning (struct super_block
*, const char *, const char *, ...)
136 __attribute__ ((format (printf
, 3, 4)));
137 extern void ext2_update_dynamic_rev (struct super_block
*sb
);
138 extern void ext2_write_super (struct super_block
*);
141 * Inodes and files operations
145 extern struct file_operations ext2_dir_operations
;
148 extern struct inode_operations ext2_file_inode_operations
;
149 extern struct file_operations ext2_file_operations
;
152 extern struct address_space_operations ext2_aops
;
153 extern struct address_space_operations ext2_nobh_aops
;
156 extern struct inode_operations ext2_dir_inode_operations
;
157 extern struct inode_operations ext2_special_inode_operations
;
160 extern struct inode_operations ext2_fast_symlink_inode_operations
;
161 extern struct inode_operations ext2_symlink_inode_operations
;