[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: Re: [PATCH v4 9/9] loop: Add LOOP_CONFIGURE ioctl
From: Denys Vlasenko <vda.linux () googlemail ! com>
Date: 2022-12-13 14:22:47
Message-ID: CAK1hOcPFsTqvg6KZeXMBfzqeE6CBLp0fZQ5HqXhXGe-EWLqcng () mail ! gmail ! com
[Download RAW message or body]
> +config LOOP_CONFIGURE
> + bool "always uses LOOP_CONFIGURE, kernel version >= 5.8"
> +
> +config NO_LOOP_CONFIGURE
> + bool "never uses LOOP_CONFIGURE, kernel version < 5.8"
> +
> +config TRY_LOOP_CONFIGURE
> + bool "try LOOP_CONFIGURE, kernel version is unknown"
The descriptions need improvement.
> +static int set_loop_configure(int ffd, int lfd, const bb_loop_info *loopinfo)
> +{
> + int rc;
> + struct loop_config config;
> +
> + memset(&config, 0, sizeof(config));
> + config.fd = ffd;
> + memcpy(&config.info, loopinfo, sizeof(config.info));
This copying of the struct can be eliminated, a-la:
+#if ENABLE_TRY_LOOP_CONFIGURE || ENABLE_LOOP_CONFIGURE
+ struct loop_config lconfig;
+# define loopinfo lconfig.info
+#else
bb_loop_info loopinfo;
+#endif
I reworked and applied it. Please try current git.
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic