Changeset View
Changeset View
Standalone View
Standalone View
sbin/ffsinfo/ffsinfo.c
Show First 20 Lines • Show All 371 Lines • ▼ Show 20 Lines | dump_whole_ufs1_inode(ino_t inode, int level) | ||||
if (!(level & 0x200)) { | if (!(level & 0x200)) { | ||||
DBG_LEAVE; | DBG_LEAVE; | ||||
return; | return; | ||||
} | } | ||||
/* | /* | ||||
* Ok, now prepare for dumping all direct and indirect pointers. | * Ok, now prepare for dumping all direct and indirect pointers. | ||||
*/ | */ | ||||
rb=howmany(ino->di_size, sblock.fs_bsize)-NDADDR; | rb = howmany(ino->di_size, sblock.fs_bsize) - UFS_NDADDR; | ||||
if(rb>0) { | if(rb>0) { | ||||
/* | /* | ||||
* Dump single indirect block. | * Dump single indirect block. | ||||
*/ | */ | ||||
if (bread(&disk, fsbtodb(&sblock, ino->di_ib[0]), (void *)&i1blk, | if (bread(&disk, fsbtodb(&sblock, ino->di_ib[0]), (void *)&i1blk, | ||||
(size_t)sblock.fs_bsize) == -1) { | (size_t)sblock.fs_bsize) == -1) { | ||||
err(1, "bread: %s", disk.d_error); | err(1, "bread: %s", disk.d_error); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | dump_whole_ufs2_inode(ino_t inode, int level) | ||||
if (!(level & 0x200)) { | if (!(level & 0x200)) { | ||||
DBG_LEAVE; | DBG_LEAVE; | ||||
return; | return; | ||||
} | } | ||||
/* | /* | ||||
* Ok, now prepare for dumping all direct and indirect pointers. | * Ok, now prepare for dumping all direct and indirect pointers. | ||||
*/ | */ | ||||
rb = howmany(ino->di_size, sblock.fs_bsize) - NDADDR; | rb = howmany(ino->di_size, sblock.fs_bsize) - UFS_NDADDR; | ||||
if (rb > 0) { | if (rb > 0) { | ||||
/* | /* | ||||
* Dump single indirect block. | * Dump single indirect block. | ||||
*/ | */ | ||||
if (bread(&disk, fsbtodb(&sblock, ino->di_ib[0]), (void *)&i1blk, | if (bread(&disk, fsbtodb(&sblock, ino->di_ib[0]), (void *)&i1blk, | ||||
(size_t)sblock.fs_bsize) == -1) { | (size_t)sblock.fs_bsize) == -1) { | ||||
err(1, "bread: %s", disk.d_error); | err(1, "bread: %s", disk.d_error); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 106 Lines • Show Last 20 Lines |