Lines Matching defs:lbn
252 * Finds the disk block address at the specified lbn within the inode
254 * di_extsize so it is a true test of reachability. The lbn may be
258 ino_blkatoff(union dinode *dp, ino_t ino, ufs_lbn_t lbn, int *frags,
270 if (lbn < 0 && lbn >= -UFS_NXADDR) {
271 lbn = -1 - lbn;
272 if (lbn > lblkno(&sblock, dp->dp2.di_extsize - 1))
275 sblksize(&sblock, dp->dp2.di_extsize, lbn));
276 return (dp->dp2.di_extb[lbn]);
284 if (lbn >= 0 && lbn < UFS_NDADDR) {
286 sblksize(&sblock, DIP(dp, di_size), lbn));
287 return (DIP(dp, di_db[lbn]));
294 if (lbn == -cur - i)
297 * Determine whether the lbn in question is within this tree.
299 if (lbn < 0 && -lbn >= next)
301 if (lbn > 0 && lbn >= next)
303 return (indir_blkatoff(DIP(dp, di_ib[i]), ino, -cur - i, lbn,
306 pfatal("lbn %jd not in ino %ju\n", lbn, (uintmax_t)ino);
311 * Fetch an indirect block to find the block at a given lbn. The lbn
316 indir_blkatoff(ufs2_daddr_t blk, ino_t ino, ufs_lbn_t cur, ufs_lbn_t lbn,
328 pfatal("Invalid indir lbn %jd in ino %ju\n",
329 lbn, (uintmax_t)ino);
330 if (level == 0 && lbn < 0)
331 pfatal("Invalid lbn %jd in ino %ju\n",
332 lbn, (uintmax_t)ino);
337 if (lbn > 0)
338 i = (lbn - base) / lbnadd;
340 i = (-lbn - base) / lbnadd;
342 pfatal("Invalid indirect index %d produced by lbn %jd "
343 "in ino %ju\n", i, lbn, (uintmax_t)ino);
359 if (cur == lbn)
362 pfatal("Invalid lbn %jd at level 0 for ino %ju\n", lbn,
364 return (indir_blkatoff(blk, ino, cur, lbn, bpp));