From owner-freebsd-arch Sun Mar 2 19:26:29 2003 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B969C37B401 for ; Sun, 2 Mar 2003 19:26:27 -0800 (PST) Received: from stork.mail.pas.earthlink.net (stork.mail.pas.earthlink.net [207.217.120.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id 38B3843F85 for ; Sun, 2 Mar 2003 19:26:27 -0800 (PST) (envelope-from tlambert2@mindspring.com) Received: from pool0459.cvx21-bradley.dialup.earthlink.net ([209.179.193.204] helo=mindspring.com) by stork.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 18pgau-00005I-00; Sun, 02 Mar 2003 19:26:25 -0800 Message-ID: <3E62CB0D.92E9FF78@mindspring.com> Date: Sun, 02 Mar 2003 19:25:01 -0800 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Jeff Roberson Cc: arch@freebsd.org Subject: Re: New getblk parameter. References: <20030302220232.C56877-100000@mail.chesapeake.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a48999fdfc135817524c2c768393a513e6350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Jeff Roberson wrote: > I'd like to add a new parameter to getblk called 'flags'. The only flag > I'm currently defining is GB_LOCK_NOWAIT so that it doesn't block trying > to get the block. This is useful in the vfs_cluster code where we want to > include a block in a cluster but only if it isn't currently in use. > > I have defined a new function 'getblkf' and put up a #define wrapper for > getblk. It'd be neat to have a getblk() that didn't have the slpflag and > slptimo args since almost nothing uses those and then use getblkf to > supply all possible arguments. I'm not doing that for now though. > > I have a patch that does this and makes use of it in vfs_cluster available > at: > > http://www.chesapeake.net/~jroberson/cluster.diff > > This clears up some other unsafe code in vfs cluster as well. > > Comments? FWIW, I like it; the cleanup that results in kern/vfs_cluster.c looks nice. If you are not going to change all the calls to getblk(), it should probably be a wrapper function, or, minimally, an inline and a wrapper function. The reasoning is that it chould be called from precompiled modules, so you want to leave a symbol visible for it, which defining it to getblkf(..., 0) doesn't do. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message