Subject: Re: letting userland issue FUA writes
To: Christos Zoulas <christos@astron.com>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 03/15/2006 16:44:59
--LiQwW4YX+w4axhAx
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Mar 16, 2006 at 12:37:00AM +0000, Christos Zoulas wrote:
> In article <20060316003059.GG8438@netbsd.org>,
> Bill Studenmund  <wrstuden@netbsd.org> wrote:
> >-=3D-=3D-=3D-=3D-=3D-
> >
> >On Wed, Mar 15, 2006 at 05:23:51PM +0100, Pavel Cahyna wrote:
> >> On Tue, Mar 14, 2006 at 06:35:46PM -0800, Bill Studenmund wrote:
> >> > I'm interested in adding infrastructure so that applications can iss=
ue=20
> >> > writes that have the FUA (Force Unit Access) bit set. SCSI CDBs hand=
le=20
> >> > this, as do some RAID cards.
> >> >=20
> >> > The main question I have is what kind of user-level interfaces exist=
 for=20
> >> > this? I certainly could cook up a new system call, but I would much =
rather=20
> >> > use prior art. My simplistic attempt at googling for this failed. Do=
es=20
> >> > anyone else have suggestions?
> >>=20
> >> O_DSYNC is documented as: "each write will wait for the file data=20
> >> to be committed to stable storage."
> >>=20
> >> Is this semantics different from FUA?
> >
> >Not really. However I really want a system call where I can request this=
=20
> >on a per-call basis. Otherwise I have to have two open file descriptors,=
=20
> >one with and one without this flag set. That seems kinda silly.
> >
>=20
> Can't you use fcntl for this?

Per call? Also, having to set/clear the FUA mode before a call will=20
complicate concurrency; I must have a userlevel lock so that no operation=
=20
gets between an fcntl() and its write().

If separate file descriptors are the only option, so be it. But I was=20
hoping for some other call API to help out.

Take care,

Bill

--LiQwW4YX+w4axhAx
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iD8DBQFEGLULWz+3JHUci9cRAg7RAJ98Nch8HsBh5mFjgz5HHi+UGOdp4QCeN9CB
5Xmo2JgDaBsC92G0zRGczeo=
=xKKc
-----END PGP SIGNATURE-----

--LiQwW4YX+w4axhAx--