ifile.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * ifile.h - NILFS inode file
  4. *
  5. * Copyright (C) 2006-2008 Nippon Telegraph and Telephone Corporation.
  6. *
  7. * Written by Amagai Yoshiji.
  8. * Revised by Ryusuke Konishi.
  9. *
  10. */
  11. #ifndef _NILFS_IFILE_H
  12. #define _NILFS_IFILE_H
  13. #include <linux/fs.h>
  14. #include <linux/buffer_head.h>
  15. #include "mdt.h"
  16. #include "alloc.h"
  17. static inline struct nilfs_inode *
  18. nilfs_ifile_map_inode(struct inode *ifile, ino_t ino, struct buffer_head *ibh)
  19. {
  20. void *kaddr = kmap(ibh->b_page);
  21. return nilfs_palloc_block_get_entry(ifile, ino, ibh, kaddr);
  22. }
  23. static inline void nilfs_ifile_unmap_inode(struct inode *ifile, ino_t ino,
  24. struct buffer_head *ibh)
  25. {
  26. kunmap(ibh->b_page);
  27. }
  28. int nilfs_ifile_create_inode(struct inode *, ino_t *, struct buffer_head **);
  29. int nilfs_ifile_delete_inode(struct inode *, ino_t);
  30. int nilfs_ifile_get_inode_block(struct inode *, ino_t, struct buffer_head **);
  31. int nilfs_ifile_count_free_inodes(struct inode *, u64 *, u64 *);
  32. int nilfs_ifile_read(struct super_block *sb, struct nilfs_root *root,
  33. size_t inode_size, struct nilfs_inode *raw_inode,
  34. struct inode **inodep);
  35. #endif /* _NILFS_IFILE_H */