From owner-freebsd-emulation@FreeBSD.ORG Fri Feb 20 12:40:21 2009 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1A21106564A for ; Fri, 20 Feb 2009 12:40:21 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from redbull.bpaserver.net (redbullneu.bpaserver.net [213.198.78.217]) by mx1.freebsd.org (Postfix) with ESMTP id 4C2178FC12 for ; Fri, 20 Feb 2009 12:40:21 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (pD9E2D8A3.dip.t-dialin.net [217.226.216.163]) by redbull.bpaserver.net (Postfix) with ESMTP id F24782E0FD; Fri, 20 Feb 2009 13:40:12 +0100 (CET) Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id CA2F1BBF0B; Fri, 20 Feb 2009 13:40:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net; s=outgoing-alex; t=1235133608; bh=ClG3xJHa7Gz0/lMRlXaEAhyZ3fcezKvqP apzcjt7/8w=; h=Message-ID:Date:From:To:Cc:Subject:References: In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=Dryl6Mfps/uR0xn6lfhJhJUmm1yrjDLIm504Pa9H29RuTMXCGfIDat0rjHzOwwwgV yXkjfOtgQFJAhQIgTbN8GTR6uPR3H77+4YHsiX/+ZlkG5eRQUh31r78r6wxTbGEqtXc b+DnyVUhSlY45GDewTSiw2T3cWLLq0yNPgKRNjwWMbRQHjVmFiSq++smMicqAvmYGSc g/dmCpmoha/fBiR7sDUpITYEX11yAinXFrDi1UYY9tcFJZUolLUwlFUjWse+3W1Vc1I G0PGQUKz7mA8Chj6/Rf3CnstiIDfaFj7jcvmV3gd0dQGHQAI8eCs+pbjzaCDlmhVcNt 7rz/zyUKA== Received: (from www@localhost) by webmail.leidinger.net (8.14.3/8.13.8/Submit) id n1KCe8VM034912; Fri, 20 Feb 2009 13:40:08 +0100 (CET) (envelope-from Alexander@Leidinger.net) Received: from Luna.Leidinger.net (Luna.Leidinger.net [192.168.2.100]) by webmail.leidinger.net (Horde Framework) with HTTP; Fri, 20 Feb 2009 13:40:08 +0100 Message-ID: <20090220134008.483828kdvanc31xc@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Fri, 20 Feb 2009 13:40:08 +0100 From: Alexander Leidinger To: Ed Schouten References: <20090219205645.GF19161@hoeg.nl> <20090219212749.GI19161@hoeg.nl> In-Reply-To: <20090219212749.GI19161@hoeg.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.3) / FreeBSD-8.0 X-BPAnet-MailScanner-Information: Please contact the ISP for more information X-MailScanner-ID: F24782E0FD.E4F0C X-BPAnet-MailScanner: Found to be clean X-BPAnet-MailScanner-SpamCheck: not spam, ORDB-RBL, SpamAssassin (not cached, score=-14.9, required 6, BAYES_00 -15.00, DKIM_SIGNED 0.00, DKIM_VERIFIED -0.00, RDNS_DYNAMIC 0.10) X-BPAnet-MailScanner-From: alexander@leidinger.net X-Spam-Status: No Cc: freebsd-emulation@FreeBSD.org Subject: Re: Making Linux stat() less evil X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 12:40:21 -0000 Quoting Ed Schouten (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