diff options
author | Jonas Jelonek <jelonek.jonas@gmail.com> | 2024-10-11 13:21:29 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2025-02-04 14:36:07 +0100 |
commit | 0ba75bea925ddb9e79240f0831f3674d7cc6f7a9 (patch) | |
tree | 9746c0943a3d179222bbc8efc998e4a8b338f097 /lib.c | |
parent | 18a2ffaf51fa2e0ead83fae62af87f0d7fc57a7a (diff) |
fs: ioctl: improve ioctl read to avoid allocating twice
Allocate memory for 'uc_string_t' with the proper size upfront and
use it's internal buffer as ioctl buffer. This avoids redundant
'ucv_string_new_length' calls and thus allocating memory a second time.
Also simplify the signature of the function, using a single parameter
for handling size and input buffer values.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
[simplify arguments, adjust documentation, prevent in-place string
modifications]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lib.c')
0 files changed, 0 insertions, 0 deletions