0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef _NILFS_IFILE_H
0013 #define _NILFS_IFILE_H
0014
0015 #include <linux/fs.h>
0016 #include <linux/buffer_head.h>
0017 #include "mdt.h"
0018 #include "alloc.h"
0019
0020
0021 static inline struct nilfs_inode *
0022 nilfs_ifile_map_inode(struct inode *ifile, ino_t ino, struct buffer_head *ibh)
0023 {
0024 void *kaddr = kmap(ibh->b_page);
0025
0026 return nilfs_palloc_block_get_entry(ifile, ino, ibh, kaddr);
0027 }
0028
0029 static inline void nilfs_ifile_unmap_inode(struct inode *ifile, ino_t ino,
0030 struct buffer_head *ibh)
0031 {
0032 kunmap(ibh->b_page);
0033 }
0034
0035 int nilfs_ifile_create_inode(struct inode *, ino_t *, struct buffer_head **);
0036 int nilfs_ifile_delete_inode(struct inode *, ino_t);
0037 int nilfs_ifile_get_inode_block(struct inode *, ino_t, struct buffer_head **);
0038
0039 int nilfs_ifile_count_free_inodes(struct inode *, u64 *, u64 *);
0040
0041 int nilfs_ifile_read(struct super_block *sb, struct nilfs_root *root,
0042 size_t inode_size, struct nilfs_inode *raw_inode,
0043 struct inode **inodep);
0044
0045 #endif