// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2000-2001 Christoph Hellwig. */ /* * Veritas filesystem driver - filesystem to disk block mapping. */ #include <linux/fs.h> #include <linux/buffer_head.h> #include <linux/kernel.h> #include "vxfs.h" #include "vxfs_inode.h" #include "vxfs_extern.h" #ifdef DIAGNOSTIC static void vxfs_typdump(struct vxfs_typed *typ) { printk(KERN_DEBUG "type=%Lu ", typ->vt_hdr >> VXFS_TYPED_TYPESHIFT); printk("offset=%Lx ", typ->vt_hdr & VXFS_TYPED_OFFSETMASK); printk("block=%x ", typ->vt_block); printk("size=%x\n", typ->vt_size); } #endif /** * vxfs_bmap_ext4 - do bmap for ext4 extents * @ip: pointer to the inode we do bmap for * @bn: logical block. * * Description: * vxfs_bmap_ext4 performs the bmap operation for inodes with * ext4-style extents (which are much like the traditional UNIX * inode organisation). * * Returns: * The physical block number on success, else Zero. */ static daddr_t vxfs_bmap_ext4(struct inode *ip, long bn) { … } /** * vxfs_bmap_indir - recursion for vxfs_bmap_typed * @ip: pointer to the inode we do bmap for * @indir: indirect block we start reading at * @size: size of the typed area to search * @block: partially result from further searches * * Description: * vxfs_bmap_indir reads a &struct vxfs_typed at @indir * and performs the type-defined action. * * Returns: * The physical block number on success, else Zero. * * Note: * Kernelstack is rare. Unrecurse? */ static daddr_t vxfs_bmap_indir(struct inode *ip, long indir, int size, long block) { … } /** * vxfs_bmap_typed - bmap for typed extents * @ip: pointer to the inode we do bmap for * @iblock: logical block * * Description: * Performs the bmap operation for typed extents. * * Returns: * The physical block number on success, else Zero. */ static daddr_t vxfs_bmap_typed(struct inode *ip, long iblock) { … } /** * vxfs_bmap1 - vxfs-internal bmap operation * @ip: pointer to the inode we do bmap for * @iblock: logical block * * Description: * vxfs_bmap1 perfoms a logical to physical block mapping * for vxfs-internal purposes. * * Returns: * The physical block number on success, else Zero. */ daddr_t vxfs_bmap1(struct inode *ip, long iblock) { … }