I am building a tool to identify the file that has a specific LBA. The approach I am using is to search through each inode from number 2 up. This approach works well with UFS1 file systems as then preinitialize all the inodes. However, UFS2 does lazy inode initialization so there are always some that are basically garbage. I have not found any relaiable way to determine from the inode contents if it is in use or not. I suspect that information is in the inode bit map. However, I haven't found any way to access that. Nothing in ffs.h seems to fit the need. Is there a way to tell if inode x is initialized or in use?
At 07:11 PM 3/7/2006, Doug Hardie wrote:>I am building a tool to identify the file that has a specific LBA. >The approach I am using is to search through each inode from number 2 >up. This approach works well with UFS1 file systems as then >preinitialize all the inodes. However, UFS2 does lazy inode >initialization so there are always some that are basically garbage. >I have not found any relaiable way to determine from the inode >contents if it is in use or not. I suspect that information is in >the inode bit map. However, I haven't found any way to access that. >Nothing in ffs.h seems to fit the need. Is there a way to tell if >inode x is initialized or in use?I believe there are macros for that in sys/ufs/ffs/fs.h. Also, the source for dumpfs probably has good examples of how to use them. -Glenn>_______________________________________________ >freebsd-stable@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-stable >To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"
On Tue, Mar 07, 2006 at 07:11:25PM -0800, Doug Hardie wrote:> I am building a tool to identify the file that has a specific LBA. > The approach I am using is to search through each inode from number 2 > up. This approach works well with UFS1 file systems as then > preinitialize all the inodes. However, UFS2 does lazy inode > initialization so there are always some that are basically garbage. > I have not found any relaiable way to determine from the inode > contents if it is in use or not. I suspect that information is in > the inode bit map. However, I haven't found any way to access that.Have a look at the patch I committed to quot last week: http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.sbin/quot/quot.c.diff?r1=1.23&r2=1.24 David.
Possibly Parallel Threads
- [PATCH v2 0/2] UFS1/2 support series
- [PATCH 0/2] UFS1/2 support series
- [PATCH 1/1] core: Check if ldlinux.sys exceeds the limit at its building time.
- [PATCH 001/001] Add UFS1/2 support to Extlinux installer.
- [PATCH 1/1 v2] Add UFS1/2 support to Extlinux installer.