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