From owner-cvs-src@FreeBSD.ORG  Thu Feb 22 21:27:41 2007
Return-Path: <owner-cvs-src@FreeBSD.ORG>
X-Original-To: cvs-src@freebsd.org
Delivered-To: cvs-src@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 8631216A403;
	Thu, 22 Feb 2007 21:27:41 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net
	[66.23.211.162])
	by mx1.freebsd.org (Postfix) with ESMTP id 2F2B313C4A3;
	Thu, 22 Feb 2007 21:27:39 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1])
	(authenticated bits=0)
	by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id l1MLRP5Z005744;
	Thu, 22 Feb 2007 16:27:28 -0500 (EST) (envelope-from jhb@freebsd.org)
From: John Baldwin <jhb@freebsd.org>
To: Kostik Belousov <kostikbel@gmail.com>
Date: Thu, 22 Feb 2007 12:38:11 -0500
User-Agent: KMail/1.9.1
References: <200702191056.l1JAuASc059200@repoman.freebsd.org>
	<200702201122.00390.jhb@freebsd.org>
	<20070222171720.GI39168@deviant.kiev.zoral.com.ua>
In-Reply-To: <20070222171720.GI39168@deviant.kiev.zoral.com.ua>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200702221238.11641.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by
	milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]);
	Thu, 22 Feb 2007 16:27:30 -0500 (EST)
X-Virus-Scanned: ClamAV 0.88.3/2630/Thu Feb 22 14:12:40 2007 on
	server.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-4.2 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00,
	DATE_IN_PAST_03_06 autolearn=ham version=3.1.3
X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx
Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org
Subject: Re: cvs commit: src/sys/kern vfs_syscalls.c
X-BeenThere: cvs-src@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: CVS commit messages for the src tree <cvs-src.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/cvs-src>,
	<mailto:cvs-src-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/cvs-src>
List-Post: <mailto:cvs-src@freebsd.org>
List-Help: <mailto:cvs-src-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/cvs-src>,
	<mailto:cvs-src-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 22 Feb 2007 21:27:41 -0000

On Thursday 22 February 2007 12:17, Kostik Belousov wrote:
> On Tue, Feb 20, 2007 at 11:21:59AM -0500, John Baldwin wrote:
> > On Tuesday 20 February 2007 09:49, Kostik Belousov wrote:
> > > On Mon, Feb 19, 2007 at 06:39:58PM -0500, John Baldwin wrote:
> > > > On Monday 19 February 2007 05:56, Konstantin Belousov wrote:
> > > > > kib         2007-02-19 10:56:10 UTC
> > > > > 
> > > > >   FreeBSD src repository
> > > > > 
> > > > >   Modified files:
> > > > >     sys/kern             vfs_syscalls.c 
> > > > >   Log:
> > > > >   Remove union_dircheckp hook, it is not needed by new unionfs code anymore.
> > > > >   As consequence, getdirentries() no longer needs to drop/reacquire
> > > > >   directory vnode lock, that would allow it to be reclaimed in between.
> > > > 
> > > > I think there is at least one more copy of getdirentries() under sys/compat,
> > > > possibly multiple.  Are you going to fix this in all of them?
> > > 
> > > Could you, please, point out where is it ? My grep told me that I removed
> > > all references to the union_dircheckp, and I think that getdirentries() code
> > > had to have references to it. My change modified two syscalls: getdirentries()
> > > and ogetdirentries().
> > 
> > Well, I did find at least 3 ABIs (Linux, svr4, and ibcs2) that do their own
> > wrapper around VOP_READDIR(), but none of them had the union check in them.
> As result, "mount -o union" does not work for compat binaries.
> 
> > Do you know why the ABIs use cookies for VOP_READDIR() but getdirentries()
> > doesn't?
> No, and it seems that cookies, as well as vfs_syscalls.c avoidance of cookies
> (together with union_dircheckp) go back to at least 1994/1997 years, and
> Lite-2 import (see commit logs for rev. 1.9 and 1.54 of vfs_syscalls.c).

What would be nice would be to have a kern_getdirentries() that took a
function pointer that took a directory record and did the actual
conversion + UIO so we could cut down on the duplicated code.

-- 
John Baldwin