Lines Matching +full:ip +full:- +full:block

2  * Copyright (c) 2000-2001 Christoph Hellwig.
31 * Veritas filesystem driver - filesystem to disk block mapping.
46 printk(KERN_DEBUG "type=%Lu ", typ->vt_hdr >> VXFS_TYPED_TYPESHIFT); in vxfs_typdump()
47 printk("offset=%Lx ", typ->vt_hdr & VXFS_TYPED_OFFSETMASK); in vxfs_typdump()
48 printk("block=%x ", typ->vt_block); in vxfs_typdump()
49 printk("size=%x\n", typ->vt_size); in vxfs_typdump()
54 * vxfs_bmap_ext4 - do bmap for ext4 extents
55 * @ip: pointer to the inode we do bmap for
56 * @iblock: logical block.
60 * ext4-style extents (which are much like the traditional UNIX
64 * The physical block number on success, else Zero.
67 vxfs_bmap_ext4(struct inode *ip, long bn) in vxfs_bmap_ext4() argument
69 struct super_block *sb = ip->i_sb; in vxfs_bmap_ext4()
70 struct vxfs_inode_info *vip = VXFS_INO(ip); in vxfs_bmap_ext4()
72 unsigned long bsize = sb->s_blocksize; in vxfs_bmap_ext4()
73 u32 indsize = fs32_to_cpu(sbi, vip->vii_ext4.ve4_indsize); in vxfs_bmap_ext4()
76 if (indsize > sb->s_blocksize) in vxfs_bmap_ext4()
80 struct direct *d = vip->vii_ext4.ve4_direct + i; in vxfs_bmap_ext4()
81 if (bn >= 0 && bn < fs32_to_cpu(sbi, d->size)) in vxfs_bmap_ext4()
82 return (bn + fs32_to_cpu(sbi, d->extent)); in vxfs_bmap_ext4()
83 bn -= fs32_to_cpu(sbi, d->size); in vxfs_bmap_ext4()
92 fs32_to_cpu(sbi, vip->vii_ext4.ve4_indir[0])); in vxfs_bmap_ext4()
96 indir = (__fs32 *)buf->b_data; in vxfs_bmap_ext4()
114 * vxfs_bmap_indir - recursion for vxfs_bmap_typed
115 * @ip: pointer to the inode we do bmap for
116 * @indir: indirect block we start reading at
118 * @block: partially result from further searches
122 * and performs the type-defined action.
125 * The physical block number on success, else Zero.
131 vxfs_bmap_indir(struct inode *ip, long indir, int size, long block) in vxfs_bmap_indir() argument
133 struct vxfs_sb_info *sbi = VXFS_SBI(ip->i_sb); in vxfs_bmap_indir()
138 for (i = 0; i < size * VXFS_TYPED_PER_BLOCK(ip->i_sb); i++) { in vxfs_bmap_indir()
142 bp = sb_bread(ip->i_sb, in vxfs_bmap_indir()
143 indir + (i / VXFS_TYPED_PER_BLOCK(ip->i_sb))); in vxfs_bmap_indir()
147 typ = ((struct vxfs_typed *)bp->b_data) + in vxfs_bmap_indir()
148 (i % VXFS_TYPED_PER_BLOCK(ip->i_sb)); in vxfs_bmap_indir()
149 off = fs64_to_cpu(sbi, typ->vt_hdr) & VXFS_TYPED_OFFSETMASK; in vxfs_bmap_indir()
151 if (block < off) { in vxfs_bmap_indir()
156 switch ((u_int32_t)(fs64_to_cpu(sbi, typ->vt_hdr) >> in vxfs_bmap_indir()
159 pblock = vxfs_bmap_indir(ip, in vxfs_bmap_indir()
160 fs32_to_cpu(sbi, typ->vt_block), in vxfs_bmap_indir()
161 fs32_to_cpu(sbi, typ->vt_size), in vxfs_bmap_indir()
162 block - off); in vxfs_bmap_indir()
163 if (pblock == -2) in vxfs_bmap_indir()
167 if ((block - off) >= fs32_to_cpu(sbi, typ->vt_size)) in vxfs_bmap_indir()
169 pblock = fs32_to_cpu(sbi, typ->vt_block) + block - off; in vxfs_bmap_indir()
177 printk(KERN_INFO "block: %llu\tsize: %lld\tdev: %d\n", in vxfs_bmap_indir()
178 fs64_to_cpu(sbi, typ4->vd4_block), in vxfs_bmap_indir()
179 fs64_to_cpu(sbi, typ4->vd4_size), in vxfs_bmap_indir()
180 fs32_to_cpu(sbi, typ4->vd4_dev)); in vxfs_bmap_indir()
185 __LINE__, fs64_to_cpu(sbi, typ->vt_hdr)); in vxfs_bmap_indir()
199 * vxfs_bmap_typed - bmap for typed extents
200 * @ip: pointer to the inode we do bmap for
201 * @iblock: logical block
207 * The physical block number on success, else Zero.
210 vxfs_bmap_typed(struct inode *ip, long iblock) in vxfs_bmap_typed() argument
212 struct vxfs_inode_info *vip = VXFS_INO(ip); in vxfs_bmap_typed()
213 struct vxfs_sb_info *sbi = VXFS_SBI(ip->i_sb); in vxfs_bmap_typed()
218 struct vxfs_typed *typ = vip->vii_org.typed + i; in vxfs_bmap_typed()
219 u64 hdr = fs64_to_cpu(sbi, typ->vt_hdr); in vxfs_bmap_typed()
229 pblock = vxfs_bmap_indir(ip, in vxfs_bmap_typed()
230 fs32_to_cpu(sbi, typ->vt_block), in vxfs_bmap_typed()
231 fs32_to_cpu(sbi, typ->vt_size), in vxfs_bmap_typed()
232 iblock - off); in vxfs_bmap_typed()
233 if (pblock == -2) in vxfs_bmap_typed()
237 if ((iblock - off) < fs32_to_cpu(sbi, typ->vt_size)) in vxfs_bmap_typed()
238 return (fs32_to_cpu(sbi, typ->vt_block) + in vxfs_bmap_typed()
239 iblock - off); in vxfs_bmap_typed()
247 printk(KERN_INFO "block: %llu\tsize: %lld\tdev: %d\n", in vxfs_bmap_typed()
248 fs64_to_cpu(sbi, typ4->vd4_block), in vxfs_bmap_typed()
249 fs64_to_cpu(sbi, typ4->vd4_size), in vxfs_bmap_typed()
250 fs32_to_cpu(sbi, typ4->vd4_dev)); in vxfs_bmap_typed()
262 * vxfs_bmap1 - vxfs-internal bmap operation
263 * @ip: pointer to the inode we do bmap for
264 * @iblock: logical block
267 * vxfs_bmap1 perfoms a logical to physical block mapping
268 * for vxfs-internal purposes.
271 * The physical block number on success, else Zero.
274 vxfs_bmap1(struct inode *ip, long iblock) in vxfs_bmap1() argument
276 struct vxfs_inode_info *vip = VXFS_INO(ip); in vxfs_bmap1()
279 return vxfs_bmap_ext4(ip, iblock); in vxfs_bmap1()
281 return vxfs_bmap_typed(ip, iblock); in vxfs_bmap1()
288 ip->i_ino, vip->vii_orgtype); in vxfs_bmap1()
293 ip->i_ino, vip->vii_orgtype); in vxfs_bmap1()