Subject: Re: sys/kern/vnode_if.src inconsistencies
To: None <>
From: Bill Studenmund <>
List: tech-kern
Date: 12/29/2005 17:28:18
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Dec 29, 2005 at 11:42:39PM +0100, Reinoud Zandijk wrote:
> Dear folks,
> running trough sys/kern/vnode_if.src to lookup the locking protocol for=
> VOP_BMAP i stumbled on:
> #
> #% bmap               vp      =3D =3D =3D
> #% bmap               vpp     - U -
> #      =20
> vop_bmap {
>         IN LOCKED=3DYES struct vnode *vp;
>         IN daddr_t bn;
>         OUT struct vnode **vpp;
>         IN daddr_t *bnp;
>         OUT int *runp;
> };
> Wich is an inconsistency. The first part indicates the locking is not=20
> relevant but shouldn't change and the second part of the description tell=
> that struct vnode *vp should be locked on entry!

=46rom looking at the code, I think the "LOCKED=3DYES" is wishful thinking.=
There are a lot of places that don't bother locking the vnode. Since the=20
node may already have been locked or we may not be able to lock it, I=20
think "=3D =3D =3D" is best.

> One of the others i've found is
> #
> #% strategy   vp      =3D =3D =3D
> #      =20
> vop_strategy {
>         IN struct vnode *vp;
>         IN struct buf *bp;
> };=20
> Shouldn't that be "L L L" for *vp ?

I don't think so. I wish it were, but it isn't. I think it's cleanest if=20
we move to the little-external-locking scheme used in SVR4 and which=20
Yamamoto-san wants to do.

Take care,


Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.2.3 (NetBSD)