linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] loop.4: Document loop_configure ioctl
@ 2020-08-03  2:38 Yang Xu
  2020-08-04 12:55 ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 3+ messages in thread
From: Yang Xu @ 2020-08-03  2:38 UTC (permalink / raw)
  To: linux-man; +Cc: Yang Xu

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
---
 man4/loop.4 | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/man4/loop.4 b/man4/loop.4
index 2dcbac807..abf722a25 100644
--- a/man4/loop.4
+++ b/man4/loop.4
@@ -177,6 +177,41 @@ This value must be a power of two in the range
 otherwise, an
 .B EINVAL
 error results.
+.TP
+.BR LOOP_CONFIGURE " (since Linux 5.8)"
+.\" commit 3448914e8cc550ba792d4ccc74471d1ca4293aae
+Setup and configure all loop device parameters using the (third)
+.BR ioctl (2)
+argument at once.
+This argument is a pointer to
+.I loop_config
+structure, defined in
+.I <linux/loop.h>
+as:
+.IP
+.in +4n
+.EX
+struct loop_config {
+    __u32               fd;
+    __u32               block_size;
+    struct loop_info64  info;
+    __u64               __reserved[8];
+};
+.EE
+.in
+.IP
+In addition to doing what
+.BR LOOP_SET_STATUS
+can do,
+.BR LOOP_CONFIGURE
+can also be used to set the correct block size immediately
+by setting loop_config.block_size. Explicitly request
+direct I/O mode by setting
+.BR LO_FLAGS_DIRECT_IO
+in loop_config.info.lo_flags. Explicitly request read-only
+mode by setting
+.BR LO_FLAGS_READ_ONLY
+in loop_config.info.lo_flags.
 .PP
 Since Linux 2.6, there are two new
 .BR ioctl (2)
-- 
2.23.0




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] loop.4: Document loop_configure ioctl
  2020-08-03  2:38 [PATCH] loop.4: Document loop_configure ioctl Yang Xu
@ 2020-08-04 12:55 ` Michael Kerrisk (man-pages)
  2020-08-05  2:13   ` Yang Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-08-04 12:55 UTC (permalink / raw)
  To: Yang Xu; +Cc: linux-man

Hello Yang Xu,

Thank you for your patch. Please see my comments below.

On Mon, 3 Aug 2020 at 04:38, Yang Xu <xuyang2018.jy@cn.fujitsu.com> wrote:
>
> Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
> ---
>  man4/loop.4 | 35 +++++++++++++++++++++++++++++++++++
>  1 file changed, 35 insertions(+)
>
> diff --git a/man4/loop.4 b/man4/loop.4
> index 2dcbac807..abf722a25 100644
> --- a/man4/loop.4
> +++ b/man4/loop.4
> @@ -177,6 +177,41 @@ This value must be a power of two in the range
>  otherwise, an
>  .B EINVAL
>  error results.
> +.TP
> +.BR LOOP_CONFIGURE " (since Linux 5.8)"
> +.\" commit 3448914e8cc550ba792d4ccc74471d1ca4293aae
> +Setup and configure all loop device parameters using the (third)
> +.BR ioctl (2)
> +argument at once.
> +This argument is a pointer to
> +.I loop_config
> +structure, defined in
> +.I <linux/loop.h>
> +as:
> +.IP
> +.in +4n
> +.EX
> +struct loop_config {
> +    __u32               fd;
> +    __u32               block_size;
> +    struct loop_info64  info;
> +    __u64               __reserved[8];
> +};
> +.EE
> +.in
> +.IP
> +In addition to doing what
> +.BR LOOP_SET_STATUS
> +can do,
> +.BR LOOP_CONFIGURE
> +can also be used to set the correct block size immediately
> +by setting loop_config.block_size. Explicitly request
> +direct I/O mode by setting
> +.BR LO_FLAGS_DIRECT_IO
> +in loop_config.info.lo_flags. Explicitly request read-only
> +mode by setting
> +.BR LO_FLAGS_READ_ONLY
> +in loop_config.info.lo_flags.

The last two sentences (starting "Explicitly request") are hard for me
to understand. Could you expand the wording here a little please to
clarify?

Thanks,

Michael

>  .PP
>  Since Linux 2.6, there are two new
>  .BR ioctl (2)
> --
> 2.23.0
>
>
>


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] loop.4: Document loop_configure ioctl
  2020-08-04 12:55 ` Michael Kerrisk (man-pages)
@ 2020-08-05  2:13   ` Yang Xu
  0 siblings, 0 replies; 3+ messages in thread
From: Yang Xu @ 2020-08-05  2:13 UTC (permalink / raw)
  To: mtk.manpages; +Cc: linux-man

Hi Michael

> Hello Yang Xu,
> 
> Thank you for your patch. Please see my comments below.
> 
> On Mon, 3 Aug 2020 at 04:38, Yang Xu <xuyang2018.jy@cn.fujitsu.com> wrote:
>>
>> Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
>> ---
>>   man4/loop.4 | 35 +++++++++++++++++++++++++++++++++++
>>   1 file changed, 35 insertions(+)
>>
>> diff --git a/man4/loop.4 b/man4/loop.4
>> index 2dcbac807..abf722a25 100644
>> --- a/man4/loop.4
>> +++ b/man4/loop.4
>> @@ -177,6 +177,41 @@ This value must be a power of two in the range
>>   otherwise, an
>>   .B EINVAL
>>   error results.
>> +.TP
>> +.BR LOOP_CONFIGURE " (since Linux 5.8)"
>> +.\" commit 3448914e8cc550ba792d4ccc74471d1ca4293aae
>> +Setup and configure all loop device parameters using the (third)
>> +.BR ioctl (2)
>> +argument at once.
>> +This argument is a pointer to
>> +.I loop_config
>> +structure, defined in
>> +.I <linux/loop.h>
>> +as:
>> +.IP
>> +.in +4n
>> +.EX
>> +struct loop_config {
>> +    __u32               fd;
>> +    __u32               block_size;
>> +    struct loop_info64  info;
>> +    __u64               __reserved[8];
>> +};
>> +.EE
>> +.in
>> +.IP
>> +In addition to doing what
>> +.BR LOOP_SET_STATUS
>> +can do,
>> +.BR LOOP_CONFIGURE
>> +can also be used to set the correct block size immediately
>> +by setting loop_config.block_size. Explicitly request
>> +direct I/O mode by setting
>> +.BR LO_FLAGS_DIRECT_IO
>> +in loop_config.info.lo_flags. Explicitly request read-only
>> +mode by setting
>> +.BR LO_FLAGS_READ_ONLY
>> +in loop_config.info.lo_flags.
> 
> The last two sentences (starting "Explicitly request") are hard for me
> to understand. Could you expand the wording here a little please to
> clarify?

In drivers/block/loop.c code, set status function(loop_set_status) 
doesn't handle LO_FLAGS_READ_ONLY flag and ingore it. it is the same for
LO_FLAGS_DIRECT_IO flag. "Explicitly request" is compared with 
LOOP_SET_STATUS ioctl.

Best Regards
Yang Xu
> 
> Thanks,
> 
> Michael
> 
>>   .PP
>>   Since Linux 2.6, there are two new
>>   .BR ioctl (2)
>> --
>> 2.23.0
>>
>>
>>
> 
> 



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-05  2:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-03  2:38 [PATCH] loop.4: Document loop_configure ioctl Yang Xu
2020-08-04 12:55 ` Michael Kerrisk (man-pages)
2020-08-05  2:13   ` Yang Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).