Lines Matching refs:fs
85 #include <ufs/ffs/fs.h>
107 register struct fs *fs;
125 fs = ip->i_fs;
137 nb = lblkno(fs, ip->i_size);
144 osize = blksize(fs, ip, nb);
147 if (osize < fs->fs_bsize && osize > 0) {
155 osize, (int)fs->fs_bsize, cred, &bp);
160 ip->i_size = (nb + 1) * fs->fs_bsize;
163 ip->i_db[nb] = dbtofsb(fs, (ufs_daddr_t)buf_blkno(bp));
180 if (nb != 0 && ip->i_size >= (lbn + 1) * fs->fs_bsize) {
182 error = (int)buf_bread(vp, (daddr64_t)((unsigned)lbn), fs->fs_bsize, NOCRED, &bp);
195 osize = fragroundup(fs, blkoff(fs, ip->i_size));
196 nsize = fragroundup(fs, size);
218 ip->i_db[lbn] = dbtofsb(fs, (ufs_daddr_t)buf_blkno(bp));
222 ip->i_size = (lbn * fs->fs_bsize) + size;
237 if (ip->i_size < (lbn + 1) * fs->fs_bsize)
238 nsize = fragroundup(fs, size);
240 nsize = fs->fs_bsize;
248 buf_setblkno(bp, (daddr64_t)((unsigned)fsbtodb(fs, newb)));
282 if (error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize,
287 bp = buf_getblk(vp, (daddr64_t)((unsigned)(indirs[1].in_lbn)), fs->fs_bsize, 0, 0, BLK_META);
288 buf_setblkno(bp, (daddr64_t)((unsigned)fsbtodb(fs, nb)));
307 error = (int)buf_meta_bread(vp, (daddr64_t)((unsigned)(indirs[i].in_lbn)), (int)fs->fs_bsize, NOCRED, &bp);
332 ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, cred, &newb)) {
338 nbp = buf_getblk(vp, (daddr64_t)((unsigned)(indirs[i].in_lbn)), fs->fs_bsize, 0, 0, BLK_META);
339 buf_setblkno(nbp, (daddr64_t)((unsigned)fsbtodb(fs, nb)));
376 lbn, pref, (int)fs->fs_bsize, cred, &newb)) {
401 nbp = buf_getblk(vp, (daddr64_t)((unsigned)lbn), fs->fs_bsize, 0, 0, BLK_WRITE);
402 buf_setblkno(nbp, (daddr64_t)((unsigned)fsbtodb(fs, nb)));
408 *blk_alloc = fs->fs_bsize;
418 error = (int)buf_bread(vp, (daddr64_t)((unsigned)lbn), (int)fs->fs_bsize, NOCRED, &nbp);
424 nbp = buf_getblk(vp, (daddr64_t)((unsigned)lbn), fs->fs_bsize, 0, 0, BLK_WRITE);
425 buf_setblkno(nbp, (daddr64_t)((unsigned)fsbtodb(fs, nb)));
436 ffs_blkfree(ip, *blkp, fs->fs_bsize);
437 deallocated += fs->fs_bsize;
473 register struct fs *fs;
487 fs = ip->i_fs;
489 if(size > fs->fs_bsize)
497 nb = lblkno(fs, ip->i_size);
506 if (nb != 0 && ip->i_size >= (lbn + 1) * fs->fs_bsize) {
514 osize = fragroundup(fs, blkoff(fs, ip->i_size));
515 nsize = fragroundup(fs, size);
521 if (ip->i_size < (lbn + 1) * fs->fs_bsize)
522 nsize = fragroundup(fs, size);
524 nsize = fs->fs_bsize;
555 if (error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize,
560 bp = buf_getblk(vp, (daddr64_t)((unsigned)(indirs[1].in_lbn)), fs->fs_bsize, 0, 0, BLK_META);
561 buf_setblkno(bp, (daddr64_t)((unsigned)fsbtodb(fs, nb)));
580 error = (int)buf_meta_bread(vp, (daddr64_t)((unsigned)(indirs[i].in_lbn)), (int)fs->fs_bsize, NOCRED, &bp);
605 ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, cred, &newb)) {
611 nbp = buf_getblk(vp, (daddr64_t)((unsigned)(indirs[i].in_lbn)), fs->fs_bsize, 0, 0, BLK_META);
612 buf_setblkno(nbp, (daddr64_t)((unsigned)fsbtodb(fs, nb)));
649 lbn, pref, (int)fs->fs_bsize, cred, &newb)) {
683 ffs_blkfree(ip, *blkp, fs->fs_bsize);
684 deallocated += fs->fs_bsize;