Subject: Re: CVS commit: src/usr.sbin/makefs
To: David Laight , Luke Mewburn <lukem@NetBSD.org>
From: David Young <dyoung@pobox.com>
List: source-changes
Date: 10/31/2005 03:10:26
On Mon, Oct 31, 2005 at 10:53:47AM +1100, Luke Mewburn wrote:
> On Sun, Oct 30, 2005 at 09:27:49AM +0000, David Young wrote:
>   | 	src/usr.sbin/makefs: cd9660.c cd9660.h
>   | 	src/usr.sbin/makefs/cd9660: cd9660_write.c
>   | 
>   | Add hard-link support:  keep a hashtable that maps inodes for
>   | regular files on the source filesystem to the offset of the first
>   | data block on the target filesystem.  Don't allocate blocks for a
>   | file a second time (i.e., if it is already present in the hashtable).
>   | Avoid writing the blocks of a file twice (use the FS_WRITTEN flag
>   | in fsinode->flags for this purpose).
> 
> Could you leverage off the existing link_check() funcion
> in makefs/walk.c to do this?

link_check() is now leveraged.

On Sun, Oct 30, 2005 at 07:55:16PM +0000, David Laight wrote:
> On Sun, Oct 30, 2005 at 09:27:49AM +0000, David Young wrote:
> > 
> > Add hard-link support:  keep a hashtable that maps inodes for
> > regular files on the source filesystem to the offset of the first
> > data block on the target filesystem.
> 
> Since not all filesystems manage to have unique inode numbers, you need
> to compare more than the st_dev and st_ino fields - even when st_nlink > 1.

Does link_check() DTRT?

Dave

-- 
David Young             OJC Technologies
dyoung@ojctech.com      Urbana, IL * (217) 278-3933