Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal: x/sys/unix: new func IoctlLoopConfigure for linux #63962

Closed
alex-matei opened this issue Nov 6, 2023 · 1 comment
Closed

proposal: x/sys/unix: new func IoctlLoopConfigure for linux #63962

alex-matei opened this issue Nov 6, 2023 · 1 comment
Labels
Milestone

Comments

@alex-matei
Copy link

LOOP_CONFIGURE is a new ioctl introduced in 5.8 that is a lot faster than the LOOP_SET_FD+LOOP_SET_STATUS64 calls:

Setup and configure all loop device parameters in a single
step using the (third) ioctl(2) argument. This argument
is a pointer to a loop_config structure, defined in
<linux/loop.h> as:

struct loop_config {
__u32 fd;
__u32 block_size;
struct loop_info64 info;
__u64 __reserved[8];
};

In addition to doing what LOOP_SET_STATUS can do,
LOOP_CONFIGURE can also be used to do the following:

• set the correct block size immediately by setting
loop_config.block_size;

• explicitly request direct I/O mode by setting
LO_FLAGS_DIRECT_IO in loop_config.info.lo_flags; and

• explicitly request read-only mode by setting
LO_FLAGS_READ_ONLY in loop_config.info.lo_flags.
source: https://man7.org/linux/man-pages/man4/loop.4.html

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/540075 mentions this issue: unix: add IoctlLoopConfigure on linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Incoming
Development

Successfully merging a pull request may close this issue.

2 participants