Al Viro e896474fe4 getname_maybe_null() - the third variant of pathname copy-in
Semantics used by statx(2) (and later *xattrat(2)): without AT_EMPTY_PATH
it's standard getname() (i.e. ERR_PTR(-ENOENT) on empty string,
ERR_PTR(-EFAULT) on NULL), with AT_EMPTY_PATH both empty string and
NULL are accepted.

Calling conventions: getname_maybe_null(user_pointer, flags) returns
	* pointer to struct filename when non-empty string had been
successfully read
	* ERR_PTR(...) on error
	* NULL if an empty string or NULL pointer had been given
with AT_EMPTY_PATH in the flags argument.

It tries to avoid allocation in the last case; it's not always
able to do so, in which case the temporary struct filename instance
is freed and NULL returned anyway.

Fast path is inlined.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2024-10-19 20:33:34 -04:00
..
2024-09-26 11:54:40 -07:00
2024-09-19 10:18:15 +02:00
2024-09-20 18:28:26 +03:00
2024-09-19 11:28:51 +02:00
2024-09-17 10:48:09 +02:00
2024-09-14 09:09:59 +02:00
2024-09-29 09:35:10 -07:00
2024-09-27 12:10:45 -07:00
2024-09-25 14:15:04 +02:00