From owner-freebsd-arch@FreeBSD.ORG Mon May 19 15:01:05 2008 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1542710656B1 for ; Mon, 19 May 2008 15:01:05 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id F03558FC22 for ; Mon, 19 May 2008 15:01:04 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (unknown [208.65.91.234]) by elvis.mu.org (Postfix) with ESMTP id 30D9F1A4D84; Mon, 19 May 2008 08:01:03 -0700 (PDT) From: John Baldwin To: Kostik Belousov Date: Mon, 19 May 2008 10:15:34 -0400 User-Agent: KMail/1.9.7 References: <20080504171002.GN18958@deviant.kiev.zoral.com.ua> <200805150730.08418.jhb@freebsd.org> <20080515123055.GY18958@deviant.kiev.zoral.com.ua> In-Reply-To: <20080515123055.GY18958@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: <200805191015.35212.jhb@freebsd.org> Cc: freebsd-arch@freebsd.org Subject: Re: Per-open file private data for the cdevs X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2008 15:01:05 -0000 On Thursday 15 May 2008 08:30:55 am Kostik Belousov wrote: > On Thu, May 15, 2008 at 07:30:07AM -0400, John Baldwin wrote: > > On Wednesday 14 May 2008 05:32:23 am Kostik Belousov wrote: > > > So, I cannot implement overlay of the cdevpriv over the seqaccess data > > > without some additional flag. On the other hand, use of 2 bytes for the > > > f_type is overkill when the range of the types is [1,8]. I divided it > > > to two one-byte fields, and new field is used for filetype-specific > > > flags. > > > > > > http://people.freebsd.org/~kib/misc/fdpriv.4.patch > > > shall give the same size of the struct file while not causing > > > unconditional acquire of the cdevpriv_mtx on the last file close. > > > > > > Jeff, do you agree with the proposed vivisection of the f_type ? I will > > > ask Peter to retest the patch then. > > > > I would rather add the new pointer to struct file and avoid breaking the > > ABI of fstat. That is, I would like this patch to be MFCable, but you > > can't MFC this w/o breaking the ABI of struct file since fstat(1) will be > > reading the full short to get the DTYPE. > > Oh, I thought that fstat uses struct xfile, at least for live systems. > > I considered to introduce new f_type value for devfs files; the > DTYPE_VNODE is not a complete truth due to custom f_ops. But DTYPE_VNODE > is special-cased in enough locations to make this much less preferrable > then another pointer. fstat always uses libkvm and direct access unfortunately. Also, I greatly care about fstat on crash dumps as well. :) -- John Baldwin