On 3/16/26 9:37 AM, Mikulas Patocka wrote:
The command "dmsetup remove_all" may take a long time (a minute for
removing 1000 devices), so make it interruptible with fatal signals.

For better readability, the bool arguments were changed to flags.

Does this patch follow the "one change per patch" rule?

+#define KEEP_OPEN_DEVICES      1
+#define MARK_DEFERRED          2
+#define ONLY_DEFERRED          4
+#define INTERRUPTIBLE          8

Has it been considered to add a (short) prefix to these flag names?

+       int r = dm_hash_remove_all(KEEP_OPEN_DEVICES | (param->flags & 
DM_DEFERRED_REMOVE ? MARK_DEFERRED : 0) | INTERRUPTIBLE);

Code readability could be improved by writing the above code as follows:

        int r, flags = KEEP_OPEN_DEVICES | INTERRUPTIBLE;

        if (param->flags & DM_DEFERRED_REMOVE)
                flags |= MARK_DEFERRED;
        r = dm_hash_remove_all(flags);

Otherwise this patch looks good to me.

Thanks,

Bart.

Reply via email to