Subject: Re: Redoing file system suspension API (update)
To: Jason Thorpe <thorpej@shagadelic.org>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 07/05/2006 10:30:32
--GvXjxJ+pjyke8COw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Jul 04, 2006 at 04:23:55PM +0200, Juergen Hannken-Illjes wrote:
> On Mon, Jul 03, 2006 at 03:51:35PM -0700, Jason Thorpe wrote:
> >=20
> > On Jul 2, 2006, at 2:22 AM, Juergen Hannken-Illjes wrote:
> >=20
> > I also would say the names of the functions should be changed as so:
> >=20
> > vn_trans_destroy() -> fstrans_exit()
> >=20
> > vn_trans_lock() -> fstrans_start()
> >=20
> > vn_trans_unlock() -> fstrans_done()
> >=20
> > it's really file systems you're operating on, not vnodes.
> >=20
> > Also, I'd say put the new routines in kern/vfs_trans.c
>=20
> Ok.
>=20
>=20
> Next step: How will we place the initial set of gates.

I'd say not. The point of all of this is to help file systems that=20
snapshot. Ones that don't don't need this transaction locking.

> 1) Change the VOP_XXX operations as
>=20
>     int
>     VOP_XXX(args)
>     {
> 	struct vop_xxx_args a;
>    +	struct mount *mp;
>    +	int error;
>=20
>    +	if ((error =3D fstrans_start((mp =3D vp->v_mount), FSTRANS_SHARED)) =
< 0)
>    +		return error;
>=20
> 	<setup a from args>;
>=20
>    -	return ((VCALL(vp, VOFFSET(vop_xxx), &a));
>    +	error =3D VCALL(vp, VOFFSET(vop_xxx), &a);
>    +	fstrans_done(mp);
>    +	return error;
>     }
>=20
>    Should be possible for all operations but VOP_LOCK, VOP_UNLOCK,
>    VOP_GETPAGES and VOP_PUTPAGES.  These operations (may) take the
>    vnode interlock on entry and therefore cannot sleep.  We have to
>    place the gates for these operations inside the file systems.

Gates for VOP_LOCK() and VOP_UNLOCK() ?? They don't need it.

> 2) Put all gates inside the file systems as

My preference.

>     int
>     fsy_xxx(...)
>     {
> 	...
>=20
> 	if ((error =3D fstrans_start(mp, FSTRANS_SHARED)) < 0)
> 		return error;
> 	...
> 	...
> 	fstrans_done(mp);
> 	...
>     }

Take care,

Bill

--GvXjxJ+pjyke8COw
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQFEq/c4Wz+3JHUci9cRAsmbAKCQ8rauKBrxsgBTOHaHj2Il6qE4MQCffmWg
VH5DEBussaukbGFBUxdu+r4=
=BQmL
-----END PGP SIGNATURE-----

--GvXjxJ+pjyke8COw--