Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 02 Mar 2003 19:25:01 -0800
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Jeff Roberson <jroberson@chesapeake.net>
Cc:        arch@freebsd.org
Subject:   Re: New getblk parameter.
Message-ID:  <3E62CB0D.92E9FF78@mindspring.com>
References:  <20030302220232.C56877-100000@mail.chesapeake.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3E62CB0D.92E9FF78>