Description
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