Lines Matching refs:ip

75 ffs_balloc(struct inode *ip, off_t offset, int bufsize, struct buf **bpp)  in ffs_balloc()  argument
77 if (ip->i_fs->fs_magic == FS_UFS2_MAGIC) in ffs_balloc()
78 return ffs_balloc_ufs2(ip, offset, bufsize, bpp); in ffs_balloc()
80 return ffs_balloc_ufs1(ip, offset, bufsize, bpp); in ffs_balloc()
84 ffs_balloc_ufs1(struct inode *ip, off_t offset, int bufsize, struct buf **bpp) in ffs_balloc_ufs1() argument
90 struct fs *fs = ip->i_fs; in ffs_balloc_ufs1()
115 lastlbn = ffs_lblkno(fs, ip->i_ffs1_size); in ffs_balloc_ufs1()
118 osize = ffs_blksize(fs, ip, nb); in ffs_balloc_ufs1()
130 nb = ufs_rw32(ip->i_ffs1_db[lbn], needswap); in ffs_balloc_ufs1()
131 if (nb != 0 && ip->i_ffs1_size >= ffs_lblktosize(fs, lbn + 1)) { in ffs_balloc_ufs1()
141 error = bread(ip->i_devvp, lbn, fs->fs_bsize, in ffs_balloc_ufs1()
156 osize = ffs_fragroundup(fs, ffs_blkoff(fs, ip->i_ffs1_size)); in ffs_balloc_ufs1()
167 error = bread(ip->i_devvp, lbn, osize, in ffs_balloc_ufs1()
186 if (ip->i_ffs1_size < ffs_lblktosize(fs, lbn + 1)) in ffs_balloc_ufs1()
190 error = ffs_alloc(ip, lbn, in ffs_balloc_ufs1()
191 ffs_blkpref_ufs1(ip, lbn, (int)lbn, in ffs_balloc_ufs1()
192 &ip->i_ffs1_db[0]), in ffs_balloc_ufs1()
197 bp = getblk(ip->i_devvp, lbn, nsize, 0, 0); in ffs_balloc_ufs1()
203 ip->i_ffs1_db[lbn] = ufs_rw32((int32_t)newb, needswap); in ffs_balloc_ufs1()
212 if ((error = ufs_getlbns(ip, lbn, indirs, &num)) != 0) in ffs_balloc_ufs1()
225 nb = ufs_rw32(ip->i_ffs1_ib[indirs[0].in_off], needswap); in ffs_balloc_ufs1()
229 pref = ffs_blkpref_ufs1(ip, lbn, 0, (int32_t *)0); in ffs_balloc_ufs1()
230 error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, &newb); in ffs_balloc_ufs1()
235 bp = getblk(ip->i_devvp, indirs[1].in_lbn, fs->fs_bsize, 0, 0); in ffs_balloc_ufs1()
244 allocib = &ip->i_ffs1_ib[indirs[0].in_off]; in ffs_balloc_ufs1()
253 error = bread(ip->i_devvp, indirs[i].in_lbn, fs->fs_bsize, in ffs_balloc_ufs1()
269 pref = ffs_blkpref_ufs1(ip, lbn, 0, (int32_t *)0); in ffs_balloc_ufs1()
270 error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, &newb); in ffs_balloc_ufs1()
277 nbp = getblk(ip->i_devvp, indirs[i].in_lbn, fs->fs_bsize, 0, 0); in ffs_balloc_ufs1()
299 pref = ffs_blkpref_ufs1(ip, lbn, indirs[num].in_off, &bap[0]); in ffs_balloc_ufs1()
300 error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, &newb); in ffs_balloc_ufs1()
308 nbp = getblk(ip->i_devvp, lbn, fs->fs_bsize, 0, 0); in ffs_balloc_ufs1()
324 error = bread(ip->i_devvp, lbn, (int)fs->fs_bsize, 0, &nbp); in ffs_balloc_ufs1()
335 ffs_balloc_ufs2(struct inode *ip, off_t offset, int bufsize, struct buf **bpp) in ffs_balloc_ufs2() argument
340 struct fs *fs = ip->i_fs; in ffs_balloc_ufs2()
365 lastlbn = ffs_lblkno(fs, ip->i_ffs2_size); in ffs_balloc_ufs2()
368 osize = ffs_blksize(fs, ip, nb); in ffs_balloc_ufs2()
380 nb = ufs_rw64(ip->i_ffs2_db[lbn], needswap); in ffs_balloc_ufs2()
381 if (nb != 0 && ip->i_ffs2_size >= ffs_lblktosize(fs, lbn + 1)) { in ffs_balloc_ufs2()
391 error = bread(ip->i_devvp, lbn, fs->fs_bsize, in ffs_balloc_ufs2()
406 osize = ffs_fragroundup(fs, ffs_blkoff(fs, ip->i_ffs2_size)); in ffs_balloc_ufs2()
417 error = bread(ip->i_devvp, lbn, osize, in ffs_balloc_ufs2()
436 if (ip->i_ffs2_size < ffs_lblktosize(fs, lbn + 1)) in ffs_balloc_ufs2()
440 error = ffs_alloc(ip, lbn, in ffs_balloc_ufs2()
441 ffs_blkpref_ufs2(ip, lbn, (int)lbn, in ffs_balloc_ufs2()
442 &ip->i_ffs2_db[0]), in ffs_balloc_ufs2()
447 bp = getblk(ip->i_devvp, lbn, nsize, 0, 0); in ffs_balloc_ufs2()
453 ip->i_ffs2_db[lbn] = ufs_rw64(newb, needswap); in ffs_balloc_ufs2()
462 if ((error = ufs_getlbns(ip, lbn, indirs, &num)) != 0) in ffs_balloc_ufs2()
475 nb = ufs_rw64(ip->i_ffs2_ib[indirs[0].in_off], needswap); in ffs_balloc_ufs2()
479 pref = ffs_blkpref_ufs2(ip, lbn, 0, (int64_t *)0); in ffs_balloc_ufs2()
480 error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, &newb); in ffs_balloc_ufs2()
485 bp = getblk(ip->i_devvp, indirs[1].in_lbn, fs->fs_bsize, 0, 0); in ffs_balloc_ufs2()
494 allocib = &ip->i_ffs2_ib[indirs[0].in_off]; in ffs_balloc_ufs2()
503 error = bread(ip->i_devvp, indirs[i].in_lbn, fs->fs_bsize, in ffs_balloc_ufs2()
519 pref = ffs_blkpref_ufs2(ip, lbn, 0, (int64_t *)0); in ffs_balloc_ufs2()
520 error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, &newb); in ffs_balloc_ufs2()
527 nbp = getblk(ip->i_devvp, indirs[i].in_lbn, fs->fs_bsize, 0, 0); in ffs_balloc_ufs2()
549 pref = ffs_blkpref_ufs2(ip, lbn, indirs[num].in_off, &bap[0]); in ffs_balloc_ufs2()
550 error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, &newb); in ffs_balloc_ufs2()
558 nbp = getblk(ip->i_devvp, lbn, fs->fs_bsize, 0, 0); in ffs_balloc_ufs2()
574 error = bread(ip->i_devvp, lbn, (int)fs->fs_bsize, 0, in ffs_balloc_ufs2()