Subject: RE: ufs-ism in lookup(9)
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: Gordon Waidhofer <gww@traakan.com>
List: tech-kern
Date: 03/23/2004 07:58:48
> 
> IMHO, eventually, VOP_REMOVE shouldn't take the vnode to be removed at all.
> the directory vnode and the name is enough and each filesystem code can
> deal with their issues.

I agree with this.

rm a/b/c is currently done VOP_LOOKUP(a), VOP_LOOKUP(b),
VOP_LOOKUP(c) with lots of modifiers, VOP_REMOVE(c). It should
be VOP_LOOKUP(a), VOP_LOOKUP(b), VOP_REMOVE(c). The actual directory
search and cache management should be done below VOP_REMOVE() itself.

File system implementers are compelled to squirrel away hints
at VOP_LOOKUP(c) time to keep things efficient. VOP_LOOKUP(c),
VOP_REMOVE(c) may seem natural (for UFS), but is awkward
in other situations (NFS, my work on OTFS). In the end, I
had to accept that remove(c) would result in two directory
searches: one for VOP_LOOKUP(c) and one for VOP_REMOVE(c).

Similarly for other "dirops": link, mkdir, rmdir, etc.

Such a change will probably never be made. I wouldn't
even advocate such. But it is a VOP design goink worth note.

	-gww