On Tue, Apr 24, 2018 at 10:34:44AM -0700, Christoph Hellwig wrote:
> On Sat, Apr 21, 2018 at 02:54:05PM +0200, Jan Kara wrote:
> > > - if (iocb->ki_flags & IOCB_DSYNC)
> > > + if (iocb->ki_flags & IOCB_DSYNC) {
> > > dio->flags |= IOMAP_DIO_NEED_SYNC;
> > > +
On Wed 25-04-18 00:07:07, Holger Hoffstätte wrote:
> On 04/24/18 19:34, Christoph Hellwig wrote:
> > On Sat, Apr 21, 2018 at 02:54:05PM +0200, Jan Kara wrote:
> > > > - if (iocb->ki_flags & IOCB_DSYNC)
> > > > + if (iocb->ki_flags & IOCB_DSYNC) {
> > > >
On Wed, Apr 25, 2018 at 12:07:07AM +0200, Holger Hoffstätte wrote:
> The above line just gives parenthesis salad errors, so why not compromise
> on:
>
> if ((iocb->ki_flags & (IOCB_DSYNC | IOCB_SYNC)) == IOCB_DSYNC) {
>
> Unless my bit twiddling has completely left me I think this is what
On 04/24/18 19:34, Christoph Hellwig wrote:
On Sat, Apr 21, 2018 at 02:54:05PM +0200, Jan Kara wrote:
- if (iocb->ki_flags & IOCB_DSYNC)
+ if (iocb->ki_flags & IOCB_DSYNC) {
dio->flags |= IOMAP_DIO_NEED_SYNC;
+ /*
+
On Sat, Apr 21, 2018 at 02:54:05PM +0200, Jan Kara wrote:
> > - if (iocb->ki_flags & IOCB_DSYNC)
> > + if (iocb->ki_flags & IOCB_DSYNC) {
> > dio->flags |= IOMAP_DIO_NEED_SYNC;
> > + /*
> > +* We optimistically try using
On Wed 18-04-18 14:08:28, Dave Chinner wrote:
> @@ -1012,8 +1035,16 @@ iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter,
> dio->flags |= IOMAP_DIO_DIRTY;
> } else {
> dio->flags |= IOMAP_DIO_WRITE;
> - if (iocb->ki_flags & IOCB_DSYNC)
> +
From: Dave Chinner
If we are doing direct IO writes with datasync semantics, we often
have to flush metadata changes along with the data write. However,
if we are overwriting existing data, there are no metadata changes
that we need to flush. In this case, optimising the IO