-/*
- * Return buffer with contents of block "offset"
- * from the beginning of directory "ip". If "res"
- * is non-zero, fill it in with a pointer to the
- * remaining space in the directory.
- */
-blkatoff(ip, offset, res, bpp)
- struct inode *ip;
- off_t offset;
- char **res;
- struct buf **bpp;
-{
- register struct fs *fs = ip->i_fs;
- daddr_t lbn = lblkno(fs, offset);
- int bsize = blksize(fs, ip, lbn);
- struct buf *bp;
- daddr_t bn;
- int error;
-
- *bpp = 0;
- if (error = bread(ITOV(ip), lbn, bsize, NOCRED, &bp)) {
- brelse(bp);
- return (error);
- }
- if (res)
- *res = bp->b_un.b_addr + blkoff(fs, offset);
- *bpp = bp;
- return (0);
-}
-