]> git.baikalelectronics.ru Git - kernel.git/commit
d_path: introduce struct prepend_buffer
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 12 May 2021 18:51:03 +0000 (14:51 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 19 May 2021 00:14:53 +0000 (20:14 -0400)
commit8583e9307e6c3e56014e636bf93b215e115d9d32
tree913a993f6105312326fac24cbb6f909c80ecb899
parent891964e3d9c0e6b95d8ed09ee28fd5aa4c053c28
d_path: introduce struct prepend_buffer

        We've a lot of places where we have pairs of form (pointer to end
of buffer, amount of space left in front of that).  These sit in pairs of
variables located next to each other and usually passed by reference.
Turn those into instances of new type (struct prepend_buffer) and pass
reference to the pair instead of pairs of references to its fields.

Declared and initialized by DECLARE_BUFFER(name, buf, buflen).

extract_string(prepend_buffer) returns the buffer contents if
no overflow has happened, ERR_PTR(ENAMETOOLONG) otherwise.
All places where we used to have that boilerplate converted to use
of that helper.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/d_path.c