^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) #include <linux/fs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #include <linux/qnx4_fs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #define QNX4_DEBUG 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #if QNX4_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #define QNX4DEBUG(X) printk X
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #define QNX4DEBUG(X) (void) 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) struct qnx4_sb_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) unsigned int Version; /* may be useful */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) struct qnx4_inode_entry *BitMap; /* useful */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) struct qnx4_inode_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) struct qnx4_inode_entry raw;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) loff_t mmu_private;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) struct inode vfs_inode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) extern struct inode *qnx4_iget(struct super_block *, unsigned long);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) extern struct dentry *qnx4_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) extern unsigned long qnx4_count_free_blocks(struct super_block *sb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) extern unsigned long qnx4_block_map(struct inode *inode, long iblock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) extern const struct inode_operations qnx4_dir_inode_operations;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) extern const struct file_operations qnx4_dir_operations;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) extern int qnx4_is_free(struct super_block *sb, long block);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) static inline struct qnx4_sb_info *qnx4_sb(struct super_block *sb)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) return sb->s_fs_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) static inline struct qnx4_inode_info *qnx4_i(struct inode *inode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) return container_of(inode, struct qnx4_inode_info, vfs_inode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) static inline struct qnx4_inode_entry *qnx4_raw_inode(struct inode *inode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) return &qnx4_i(inode)->raw;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) }