Subject: Re: funlink() for fun!
To: Greywolf <greywolf@starwolf.com>
From: Greg A. Woods <woods@weird.com>
List: tech-kern
Date: 07/10/2003 12:35:37
[ On Wednesday, July 9, 2003 at 13:00:03 (-0700), Greywolf wrote: ]
> Subject: Re: POSIX shm_open() vs. mmap(MAP_ANON|MAP_SHARED)....
>
> Um, slightly off-topic, but wouldn't funlink() be somewhat disastrous in
> practice?

No more than unlink(), provided that the link count was only one;
alternately the pathname could be cached in the kernel.  ;-)

> That would require a file-
> system cleaner process or a routine that knew instantly how to match inode
> numbers to pathnames

Why "instantly"?  funlink() could block until it found the directory
entry and confirmed that the link count was still one.  :-)

>  You will note that there is no converse
> routine, since while name -> ino-dev is unique for each ino-dev, the
> reverse is untrue -- consider /foo/bar/.. and /foo, for example...").

Yes, that's strictly true, but your example is slightly wrong.  :-)

-- 
								Greg A. Woods

+1 416 218-0098;            <g.a.woods@ieee.org>;           <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>