Date: Thu, 18 Aug 2016 10:53:16 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: Jilles Tjoelker <jilles@stack.nl> Cc: Konstantin Belousov <kib@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304176 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern Message-ID: <20160818075316.GW83214@kib.kiev.ua> In-Reply-To: <20160817202040.GA21263@stack.nl> References: <201608151908.u7FJ8phh091939@repo.freebsd.org> <20160817202040.GA21263@stack.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Aug 17, 2016 at 10:20:40PM +0200, Jilles Tjoelker wrote: > On Mon, Aug 15, 2016 at 07:08:51PM +0000, Konstantin Belousov wrote: > > /* ISO/IEC 9945-1: 1996 */ > > #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE > > int fsync(int); > > +int fdatasync(int); > > > > /* > > * ftruncate() was in the POSIX Realtime Extension (it's used for shared > > Apparently these functions were added closely enough in time that they > can stay together here :) Is this a form of suggestion to use other value for POSIX_VISIBLE ? > > +#if 0 > > + if (!fullsync) > > + /* XXXKIB: compete outstanding aio writes */; > > Under the _POSIX_SYNCHRONIZED_IO option, completing outstanding I/O > requests is in fact required for fsync() as well. The fdatasync() > function is completely under the _POSIX_SYNCHRONIZED_IO option. > > We do not implement this option, but keeping fdatasync()'s guarantees a > subset of fsync()'s guarantees seems sensible. I will consider this if and when the AIO flush would be implemented. I looked at the AIO code to estimate the needed work, but did not started coding and quite possible it would be postponed. > > +%% fdatasync vp L L L > > + > > +vop_fdatasync { > > + IN struct vnode *vp; > > + IN struct thread *td; > > +}; > A waitfor parameter like in vop_fsync may be useful to implement > aio_fsync(O_DSYNC) later on. I really do not see how would it be. aio_fsync(O_DSYNC) is equivalent to fdatasync(2) in the async context. Completion of the aio request indicates that virtual fdatasync(2) execution did finished in that context. The use of waitfor in the VOP_FSYNC() is to allow syncer to initiate flush without waiting, or getting notification for the completion. Could you, please, elaborate ? If the KPI change is needed there, it is obviously desirable to make it right before MFC to stable.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160818075316.GW83214>