Subject: [bug#51346] [PATCH 0/1 core-updates-frozen] Rework swap device to add dependencies and flags

From: Ludovic Courtès <[email-masked]>
Date: Mon, 15 Nov 2021 11:59:35 +0100

Josselin Poiret <[email-masked]> skribis:

> * gnu/system/file-systems.scm (swap-space)[priority, discard?]: Add
> them.
> * guix/build/syscalls.scm (SWAP_FLAG_PREFER, SWAP_FLAG_PRIO_MASK,
> SWAP_FLAG_PRIO_SHIFT, SWAP_FLAG_DISCARD): Add them.
> * gnu/build/file-systems.scm (swap-space->flags-bit-mask): Add it.
> * gnu/services/base.scm (swap-service-type): Use it.

[...]

>                     (let ((device #$device-lookup))
>                       (and device
>                            (begin
> -                            (restart-on-EINTR (swapon device))
> +                            (restart-on-EINTR (swapon device
> +						      #$(swap-space->flags-bit-mask
> +							 swap)))

Note for later: IWBN to have a ‘sanitize’ field in <swap-space> that
checks the flags, similar to commit 5eb5c0789f34e87ee417a53ddfcfa3b6521bb337.

> -            swap-space-dependencies))
> +            swap-space-dependencies
> +	    swap-space-priority
> +	    swap-space-discard?))

Please don’t use tabs at all in Scheme code.

LGTM!

Ludo’.