Re: [PATCH v1] cifs: simplify SWN code with dummy funcs instead of ifdefs

Samuel Cabrero
2021-03-24T08:58:22Z

On Thu, 2021-03-18 at 18:55 +0100, Aurélien Aptel wrote:
> From: Aurelien Aptel <aaptel@suse.com>
>
> This commit doesn't change the logic of SWN.
>
> Add dummy implementation of SWN functions when SWN is disabled instead
> of using ifdef sections.
>
> The dummy functions get optimized out, this leads to clearer code and
> compile time type-checking regardless of config options with no
> runtime penalty.
>
> Leave the simple ifdefs section as-is.
>
> A single bitfield (bool foo:1) on its own will use up one int. Move
> tcon->use_witness out of ifdefs with the other tcon bitfields.
>
> Signed-off-by: Aurelien Aptel <aaptel@suse.com>

Thanks Aurelien, it LGTM.

Reviewed-by: Samuel Cabrero <scabrero@suse.de>

--
Samuel Cabrero / SUSE Labs Samba Team
GPG: D7D6 E259 F91C F0B3 2E61 1239 3655 6EC9 7051 0856
scabrero@suse.com
scabrero@suse.de