minimal loss of information when deallocating inodes?

Stephen J. Friedl friedl at vsi.COM
Wed Dec 28 17:46:07 AEST 1988


In article <88Dec24.170417est.38019 at neat.ai.toronto.edu>, rayan at ai.toronto.edu (Rayan Zachariassen) writes:
> I'd think that a zero nlink field should be enough to mark the inode as
> deallocated.

This is not sufficient, because a file with zero links can still
be used by the system (pipes, etc.).

It seems to me that marking the mode field to zero is sufficient
for this, as any other kind of file has at least one high-order
bit set (even regular files).  This is from <sys/stat.h> from
System V:

	#define	S_IFMT	0170000		/* type of file		*/
	#define		S_IFDIR	0040000	/* directory		*/
	#define		S_IFCHR	0020000	/* character special	*/
	#define		S_IFBLK	0060000	/* block special	*/
	#define		S_IFREG	0100000	/* regular		*/
	#define		S_IFIFO	0010000	/* fifo			*/

Comments?

     Steve

-- 
Stephen J. Friedl        3B2-kind-of-guy            friedl at vsi.com
V-Systems, Inc.          ****Hi Mom!****        attmail!vsi!friedl
Santa Ana, CA  USA       +1 714 545 6442    {backbones}!vsi!friedl
-------Nancy Reagan on Usenix in San Diego: "Just say *go*"-------



More information about the Comp.unix.wizards mailing list