aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/nilfs.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nilfs2/nilfs.h')
-rw-r--r--fs/nilfs2/nilfs.h49
1 files changed, 19 insertions, 30 deletions
diff --git a/fs/nilfs2/nilfs.h b/fs/nilfs2/nilfs.h
index d3d54046e5f8..777e8fd04304 100644
--- a/fs/nilfs2/nilfs.h
+++ b/fs/nilfs2/nilfs.h
@@ -59,6 +59,7 @@ struct nilfs_inode_info {
59#endif 59#endif
60 struct buffer_head *i_bh; /* i_bh contains a new or dirty 60 struct buffer_head *i_bh; /* i_bh contains a new or dirty
61 disk inode */ 61 disk inode */
62 struct nilfs_root *i_root;
62 struct inode vfs_inode; 63 struct inode vfs_inode;
63}; 64};
64 65
@@ -100,7 +101,6 @@ enum {
100 NILFS_I_INODE_DIRTY, /* write_inode is requested */ 101 NILFS_I_INODE_DIRTY, /* write_inode is requested */
101 NILFS_I_BMAP, /* has bmap and btnode_cache */ 102 NILFS_I_BMAP, /* has bmap and btnode_cache */
102 NILFS_I_GCINODE, /* inode for GC, on memory only */ 103 NILFS_I_GCINODE, /* inode for GC, on memory only */
103 NILFS_I_GCDAT, /* shadow DAT, on memory only */
104}; 104};
105 105
106/* 106/*
@@ -190,22 +190,14 @@ static inline int nilfs_doing_construction(void)
190 return nilfs_test_transaction_flag(NILFS_TI_WRITER); 190 return nilfs_test_transaction_flag(NILFS_TI_WRITER);
191} 191}
192 192
193static inline struct inode *nilfs_dat_inode(const struct the_nilfs *nilfs)
194{
195 return nilfs_doing_gc() ? nilfs->ns_gc_dat : nilfs->ns_dat;
196}
197
198/* 193/*
199 * function prototype 194 * function prototype
200 */ 195 */
201#ifdef CONFIG_NILFS_POSIX_ACL 196#ifdef CONFIG_NILFS_POSIX_ACL
202#error "NILFS: not yet supported POSIX ACL" 197#error "NILFS: not yet supported POSIX ACL"
203extern int nilfs_permission(struct inode *, int, struct nameidata *);
204extern int nilfs_acl_chmod(struct inode *); 198extern int nilfs_acl_chmod(struct inode *);
205extern int nilfs_init_acl(struct inode *, struct inode *); 199extern int nilfs_init_acl(struct inode *, struct inode *);
206#else 200#else
207#define nilfs_permission NULL
208
209static inline int nilfs_acl_chmod(struct inode *inode) 201static inline int nilfs_acl_chmod(struct inode *inode)
210{ 202{
211 return 0; 203 return 0;
@@ -247,24 +239,28 @@ extern int nilfs_get_block(struct inode *, sector_t, struct buffer_head *, int);
247extern void nilfs_set_inode_flags(struct inode *); 239extern void nilfs_set_inode_flags(struct inode *);
248extern int nilfs_read_inode_common(struct inode *, struct nilfs_inode *); 240extern int nilfs_read_inode_common(struct inode *, struct nilfs_inode *);
249extern void nilfs_write_inode_common(struct inode *, struct nilfs_inode *, int); 241extern void nilfs_write_inode_common(struct inode *, struct nilfs_inode *, int);
250extern struct inode *nilfs_iget(struct super_block *, unsigned long); 242struct inode *nilfs_ilookup(struct super_block *sb, struct nilfs_root *root,
243 unsigned long ino);
244struct inode *nilfs_iget_locked(struct super_block *sb, struct nilfs_root *root,
245 unsigned long ino);
246struct inode *nilfs_iget(struct super_block *sb, struct nilfs_root *root,
247 unsigned long ino);
248extern struct inode *nilfs_iget_for_gc(struct super_block *sb,
249 unsigned long ino, __u64 cno);
251extern void nilfs_update_inode(struct inode *, struct buffer_head *); 250extern void nilfs_update_inode(struct inode *, struct buffer_head *);
252extern void nilfs_truncate(struct inode *); 251extern void nilfs_truncate(struct inode *);
253extern void nilfs_evict_inode(struct inode *); 252extern void nilfs_evict_inode(struct inode *);
254extern int nilfs_setattr(struct dentry *, struct iattr *); 253extern int nilfs_setattr(struct dentry *, struct iattr *);
255extern int nilfs_load_inode_block(struct nilfs_sb_info *, struct inode *, 254int nilfs_permission(struct inode *inode, int mask, unsigned int flags);
256 struct buffer_head **); 255int nilfs_load_inode_block(struct inode *inode, struct buffer_head **pbh);
257extern int nilfs_inode_dirty(struct inode *); 256extern int nilfs_inode_dirty(struct inode *);
258extern int nilfs_set_file_dirty(struct nilfs_sb_info *, struct inode *, 257int nilfs_set_file_dirty(struct inode *inode, unsigned nr_dirty);
259 unsigned);
260extern int nilfs_mark_inode_dirty(struct inode *); 258extern int nilfs_mark_inode_dirty(struct inode *);
261extern void nilfs_dirty_inode(struct inode *); 259extern void nilfs_dirty_inode(struct inode *);
262 260int nilfs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
263/* namei.c */ 261 __u64 start, __u64 len);
264extern struct dentry *nilfs_get_parent(struct dentry *);
265 262
266/* super.c */ 263/* super.c */
267extern struct inode *nilfs_alloc_inode_common(struct the_nilfs *);
268extern struct inode *nilfs_alloc_inode(struct super_block *); 264extern struct inode *nilfs_alloc_inode(struct super_block *);
269extern void nilfs_destroy_inode(struct inode *); 265extern void nilfs_destroy_inode(struct inode *);
270extern void nilfs_error(struct super_block *, const char *, const char *, ...) 266extern void nilfs_error(struct super_block *, const char *, const char *, ...)
@@ -283,8 +279,9 @@ extern struct nilfs_super_block **nilfs_prepare_super(struct nilfs_sb_info *,
283 int flip); 279 int flip);
284extern int nilfs_commit_super(struct nilfs_sb_info *, int); 280extern int nilfs_commit_super(struct nilfs_sb_info *, int);
285extern int nilfs_cleanup_super(struct nilfs_sb_info *); 281extern int nilfs_cleanup_super(struct nilfs_sb_info *);
286extern int nilfs_attach_checkpoint(struct nilfs_sb_info *, __u64); 282int nilfs_attach_checkpoint(struct nilfs_sb_info *sbi, __u64 cno, int curr_mnt,
287extern void nilfs_detach_checkpoint(struct nilfs_sb_info *); 283 struct nilfs_root **root);
284int nilfs_checkpoint_is_mounted(struct super_block *sb, __u64 cno);
288 285
289/* gcinode.c */ 286/* gcinode.c */
290int nilfs_gccache_submit_read_data(struct inode *, sector_t, sector_t, __u64, 287int nilfs_gccache_submit_read_data(struct inode *, sector_t, sector_t, __u64,
@@ -292,16 +289,8 @@ int nilfs_gccache_submit_read_data(struct inode *, sector_t, sector_t, __u64,
292int nilfs_gccache_submit_read_node(struct inode *, sector_t, __u64, 289int nilfs_gccache_submit_read_node(struct inode *, sector_t, __u64,
293 struct buffer_head **); 290 struct buffer_head **);
294int nilfs_gccache_wait_and_mark_dirty(struct buffer_head *); 291int nilfs_gccache_wait_and_mark_dirty(struct buffer_head *);
295int nilfs_init_gccache(struct the_nilfs *); 292int nilfs_init_gcinode(struct inode *inode);
296void nilfs_destroy_gccache(struct the_nilfs *); 293void nilfs_remove_all_gcinodes(struct the_nilfs *nilfs);
297void nilfs_clear_gcinode(struct inode *);
298struct inode *nilfs_gc_iget(struct the_nilfs *, ino_t, __u64);
299void nilfs_remove_all_gcinode(struct the_nilfs *);
300
301/* gcdat.c */
302int nilfs_init_gcdat_inode(struct the_nilfs *);
303void nilfs_commit_gcdat_inode(struct the_nilfs *);
304void nilfs_clear_gcdat_inode(struct the_nilfs *);
305 294
306/* 295/*
307 * Inodes and files operations 296 * Inodes and files operations