From: Christoph Hellwig <hch@infradead.org>
To: target-devel@vger.kernel.org
Subject: Re: [PATCH v2] target/file: add support of direct and async I/O
Date: Thu, 22 Mar 2018 17:34:34 +0000 [thread overview]
Message-ID: <20180322173434.GA32348@infradead.org> (raw)
In-Reply-To: <20180322065502.25569-1-avagin@openvz.org>
>
> DIF (PI) emulation doesn't work when a target uses async I/O, because
> DIF metadata is saved in a separate file, and it is another non-trivial
> task how to synchronize writing in two files, so that a following read
> operation always returns a consisten metadata for a specified block.
As said, this isn't really in any way aio specific.
> + int is_write = !(data_direction = DMA_FROM_DEVICE);
bool is_write = data_direction != DMA_FROM_DEVICE;
> + if (is_write && (cmd->se_cmd_flags & SCF_FUA))
> + aio_cmd->iocb.ki_flags |= IOCB_DSYNC;
> +
> + if (is_write)
> + ret = call_write_iter(file, &aio_cmd->iocb, &iter);
> + else
> + ret = call_read_iter(file, &aio_cmd->iocb, &iter);
> +
> + kfree(bvec);
While this looks good to me this is the same pattern just said doesn't
work in loop. So it works here just fine?
Otherwise this looks fine to me:
Signed-off-by: Christoph Hellwig <hch@lst.de>
next prev parent reply other threads:[~2018-03-22 17:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-22 6:55 [PATCH v2] target/file: add support of direct and async I/O Andrei Vagin
2018-03-22 17:34 ` Christoph Hellwig [this message]
2018-03-22 18:27 ` Bryant G. Ly
2018-03-22 21:19 ` Andrei Vagin
2018-04-19 18:29 ` Andrei Vagin
2018-05-07 18:37 ` Bryant G. Ly
2018-05-08 5:47 ` Martin K. Petersen
2018-05-08 16:26 ` Mike Christie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180322173434.GA32348@infradead.org \
--to=hch@infradead.org \
--cc=target-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.