From owner-freebsd-hackers@FreeBSD.ORG Mon Jun 13 18:39:43 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 431C216A41F; Mon, 13 Jun 2005 18:39:43 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id A6E2843D1D; Mon, 13 Jun 2005 18:39:42 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from [192.168.254.14] (imini.samsco.home [192.168.254.14]) (authenticated bits=0) by pooker.samsco.org (8.13.3/8.13.3) with ESMTP id j5DIiVvZ005878; Mon, 13 Jun 2005 12:44:31 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <42ADD253.4020606@samsco.org> Date: Mon, 13 Jun 2005 12:37:07 -0600 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.7) Gecko/20050416 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Christoph Hellwig References: <42ADC762.6010801@elischer.org> <20050613181435.GA3096@infradead.org> In-Reply-To: <20050613181435.GA3096@infradead.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=3.8 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on pooker.samsco.org Cc: Daniel Eischen , freebsd-hackers@freebsd.org, Julian Elischer , Apache Xie Subject: Re: contigmalloc() and mmap() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2005 18:39:43 -0000 Christoph Hellwig wrote: > On Mon, Jun 13, 2005 at 10:50:26AM -0700, Julian Elischer wrote: > >>Several times in the past we've seen people complainign that Linux >>allows a device driver to know >>who called it and somehow it seems to store somewhere some information >>about who >>openned the device.. thos somehow allows linux to store an arbitrary >>structure >>for each openning process. I thin from the sond of it that he wants to >>do something >>similar. From the sond of it he wants to have a different buffer be used >>depending on >>who is calling. This would partly work but would not work when processes >>fork etc. >> >>I think Linux must do some extra housekeeping in this case. > > > What Linux does is pretty simple. The driver has access to the file > structure, and this structure has a field for driver private data. > It can store private data in open and free it again in the release > callback. > How does linux handle the implications of fork(2) in this scenario? Scott