Skip site navigation (1)Skip section navigation (2)
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>

next in thread | previous in thread | raw e-mail | index | archive | help
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:
>
> =09http://80386.nl/pub/linux-stat.diff
>
> Shall I commit this patch to SVN?

 From your patch:
---snip---
@@ -2359,6 +2366,8 @@
  =09vfslocked =3D NDHASGIANT(&nd);
  =09error =3D vn_stat(nd.ni_vp, &sb, td->td_ucred, NOCRED, td);
  =09if (!error) {
+=09=09if (hook !=3D NULL)
+=09=09=09hook(nd.ni_vp, &sb);
  =09=09SDT_PROBE(vfs, , stat, mode, path, sb.st_mode, 0, 0, 0);
  =09=09if (S_ISREG(sb.st_mode))
  =09=09=09SDT_PROBE(vfs, , stat, reg, path, pathseg, 0, 0, 0);
---snip---

I think you should call the hook after SDT_PROBE, not before. This way =20
it doesn't matter what the hook does to sb, the dtrace probe will get =20
what it expects (the FreeBSD style sb). I don't think we need to add =20
another dtrace probe here after the probe, as I think this should be =20
handled somewhere near the code of the hook (in this case in the =20
linuxulator... which means I will take care about this in my =20
linuxulator-dtrace branch).

Bye,
Alexander.

--=20
You are a bundle of energy, always on the go.

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID =3D B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID =3D 72077137



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090220134008.483828kdvanc31xc>