Util-Linux package development
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Ming Lei <tom.leiming@gmail.com>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH 0/2] losetup: support direct-IO to backing file
Date: Mon, 9 Nov 2015 11:29:31 +0100	[thread overview]
Message-ID: <20151109102931.GU19508@ws.net.home> (raw)
In-Reply-To: <1446856818-26532-1-git-send-email-tom.leiming@gmail.com>

On Sat, Nov 07, 2015 at 08:40:16AM +0800, Ming Lei wrote:
> The loop direct I/O patches[1] have been merged to linus kernel tree
> and will be released in v4.4.
> 
> So the two patches provide interfaces for using direct IO/AIO
> in losetup.

Thanks!

>  include/loopdev.h   |  4 ++++
>  lib/loopdev.c       | 40 ++++++++++++++++++++++++++++++++++++++++
>  sys-utils/losetup.c | 30 +++++++++++++++++++++++++++---
>  3 files changed, 71 insertions(+), 3 deletions(-)
> 
> [1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=bc07c10a3603a5ab3ef01ba42b3d41f9ac63d1b6

If I read correctly the kernel code than LO_FLAGS_DIRECT_IO is not
possible to use when initialize loop device by LOOP_SET_FD ioctl. I
need extra LOOP_SET_DIRECT_IO ioctl. Why?

Why kernel function loop_set_fd() does not initialize lo->use_dio
according to "lo_flags & LO_FLAGS_DIRECT_IO" as we use for another
loopdev stuff? See for example LO_FLAGS_PARTSCAN. Would be possible 
to improve kernel a little bit?


Now you have to use two commands (ioctls):

 # losetup /dev/loop0 file.img
 # losetup --direct-io 1 /dev/loop0

It's fine to use --direct-io as toggle, but it would be nice to
support it also when initialize the device.

    Karel


-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

  parent reply	other threads:[~2015-11-09 10:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-07  0:40 [PATCH 0/2] losetup: support direct-IO to backing file Ming Lei
2015-11-07  0:40 ` [PATCH 1/2] losetup: support ioctl cmd of LOOP_SET_DIRECT_IO Ming Lei
2015-11-07  0:40 ` [PATCH 2/2] losetup: support list direct io Ming Lei
2015-11-09 10:29 ` Karel Zak [this message]
2015-11-09 11:29   ` [PATCH 0/2] losetup: support direct-IO to backing file Ming Lei
2015-11-09 11:46     ` Karel Zak
2015-11-10  6:05       ` Ming Lei
2015-11-10 11:40         ` Karel Zak
2015-11-10 15:20           ` Ming Lei

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=20151109102931.GU19508@ws.net.home \
    --to=kzak@redhat.com \
    --cc=tom.leiming@gmail.com \
    --cc=util-linux@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox