Date: Fri, 20 Feb 2009 13:40:08 +0100 From: Alexander Leidinger <Alexander@Leidinger.net> To: Ed Schouten <ed@80386.nl> Cc: freebsd-emulation@FreeBSD.org Subject: Re: Making Linux stat() less evil Message-ID: <20090220134008.483828kdvanc31xc@webmail.leidinger.net> In-Reply-To: <20090219212749.GI19161@hoeg.nl> References: <20090219205645.GF19161@hoeg.nl> <20090219212749.GI19161@hoeg.nl>
index | next in thread | previous in thread | raw e-mail
Quoting Ed Schouten <ed@80386.nl> (from Thu, 19 Feb 2009 22:27:49 +0100): > Roman, > > After some discussion with kib@ on IRC, I changed the patch a little: I > added a new function called kern_statat_vnhook(). This function allows > the Linuxolator to use a hook to modify struct stat, to reduce some > redundant code: > > http://80386.nl/pub/linux-stat.diff > > Shall I commit this patch to SVN? From your patch: ---snip--- @@ -2359,6 +2366,8 @@ vfslocked = NDHASGIANT(&nd); error = vn_stat(nd.ni_vp, &sb, td->td_ucred, NOCRED, td); if (!error) { + if (hook != NULL) + hook(nd.ni_vp, &sb); SDT_PROBE(vfs, , stat, mode, path, sb.st_mode, 0, 0, 0); if (S_ISREG(sb.st_mode)) SDT_PROBE(vfs, , stat, reg, path, pathseg, 0, 0, 0); ---snip--- I think you should call the hook after SDT_PROBE, not before. This way it doesn't matter what the hook does to sb, the dtrace probe will get what it expects (the FreeBSD style sb). I don't think we need to add another dtrace probe here after the probe, as I think this should be handled somewhere near the code of the hook (in this case in the linuxulator... which means I will take care about this in my linuxulator-dtrace branch). Bye, Alexander. -- You are a bundle of energy, always on the go. http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090220134008.483828kdvanc31xc>
