// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2000-2001 Christoph Hellwig. * Copyright (c) 2016 Krzysztof Blaszkowski */ /* * Veritas filesystem driver - inode routines. */ #include <linux/fs.h> #include <linux/buffer_head.h> #include <linux/pagemap.h> #include <linux/kernel.h> #include <linux/slab.h> #include <linux/namei.h> #include "vxfs.h" #include "vxfs_inode.h" #include "vxfs_extern.h" #ifdef DIAGNOSTIC /* * Dump inode contents (partially). */ void vxfs_dumpi(struct vxfs_inode_info *vip, ino_t ino) { printk(KERN_DEBUG "\n\n"); if (ino) printk(KERN_DEBUG "dumping vxfs inode %ld\n", ino); else printk(KERN_DEBUG "dumping unknown vxfs inode\n"); printk(KERN_DEBUG "---------------------------\n"); printk(KERN_DEBUG "mode is %x\n", vip->vii_mode); printk(KERN_DEBUG "nlink:%u, uid:%u, gid:%u\n", vip->vii_nlink, vip->vii_uid, vip->vii_gid); printk(KERN_DEBUG "size:%Lx, blocks:%u\n", vip->vii_size, vip->vii_blocks); printk(KERN_DEBUG "orgtype:%u\n", vip->vii_orgtype); } #endif /** * vxfs_transmod - mode for a VxFS inode * @vip: VxFS inode * * Description: * vxfs_transmod returns a Linux mode_t for a given * VxFS inode structure. */ static __inline__ umode_t vxfs_transmod(struct vxfs_inode_info *vip) { … } static inline void dip2vip_cpy(struct vxfs_sb_info *sbi, struct vxfs_inode_info *vip, struct vxfs_dinode *dip) { … } /** * vxfs_blkiget - find inode based on extent # * @sbp: superblock of the filesystem we search in * @extent: number of the extent to search * @ino: inode number to search * * Description: * vxfs_blkiget searches inode @ino in the filesystem described by * @sbp in the extent @extent. * Returns the matching VxFS inode on success, else a NULL pointer. * * NOTE: * While __vxfs_iget uses the pagecache vxfs_blkiget uses the * buffercache. This function should not be used outside the * read_super() method, otherwise the data may be incoherent. */ struct inode * vxfs_blkiget(struct super_block *sbp, u_long extent, ino_t ino) { … } /** * __vxfs_iget - generic find inode facility * @ilistp: inode list * @vip: VxFS inode to fill in * @ino: inode number * * Description: * Search the for inode number @ino in the filesystem * described by @sbp. Use the specified inode table (@ilistp). * Returns the matching inode on success, else an error code. */ static int __vxfs_iget(struct inode *ilistp, struct vxfs_inode_info *vip, ino_t ino) { … } /** * vxfs_stiget - find inode using the structural inode list * @sbp: VFS superblock * @ino: inode # * * Description: * Find inode @ino in the filesystem described by @sbp using * the structural inode list. * Returns the matching inode on success, else a NULL pointer. */ struct inode * vxfs_stiget(struct super_block *sbp, ino_t ino) { … } /** * vxfs_iget - get an inode * @sbp: the superblock to get the inode for * @ino: the number of the inode to get * * Description: * vxfs_read_inode creates an inode, reads the disk inode for @ino and fills * in all relevant fields in the new inode. */ struct inode * vxfs_iget(struct super_block *sbp, ino_t ino) { … } /** * vxfs_evict_inode - remove inode from main memory * @ip: inode to discard. * * Description: * vxfs_evict_inode() is called on the final iput and frees the private * inode area. */ void vxfs_evict_inode(struct inode *ip) { … }