The code in the ntfl write function is rather complex, and it contains
a 512 byte on-stack buffer. The combination of these two leads to using
more than the per-function stack warning limit in some configurations,
especially with KASAN enabled:
Avoid this warning by moving the on-stack buffer into a separate function
that only copies one part of the device to another.
This does not really help with the total maximum stack usage in the
(non-KASAN) normal case, but it does two things:
- no single function has more than the warning limit
- the complexity goes down, so the parent function ends up
spilling few local variables, and the total actually goes
down slightly.