Subject: Re: eliminating veriexec #ifdefs in vfs_vnops.c
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: Elad Efrat <elad@NetBSD.org>
List: tech-kern
Date: 12/30/2006 00:53:46
YAMAMOTO Takashi wrote:
>> let's just move the namei() to the top and have the veriexec stuff
>> after it.
>>
>> something like:
>>
>> 	if (fmode & O_CREAT) {
>> 		ndp->ni_cnd.cn_nameiop = CREATE;
>> 		ndp->ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF;
>> 	} else {
>> 		ndp->ni_cnd.cn_nameiop = LOOKUP;
>> 		ndp->ni_cnd.cn_flags = LOCKLEAF;
>> 	}
>> 	error = namei(ndp);
>> 	/* stuff */
>>
>> right after the 'restart:' label.
>>
>> -e.
> 
> namei() calls in vn_open() are almost immediately after "restart:",
> aren't they?
> 
> YAMAMOTO Takashi

the reason there are #ifdefs is that there are "calls" and not "a call".
the code is, mind you, horrible. if there's only one call, then there's
only one place we'd need to hook in.

-e.