get rid of fs_value_is_filename_empty
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 18 Dec 2019 01:09:08 +0000 (20:09 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 7 Feb 2020 19:48:30 +0000 (14:48 -0500)
Its behaviour is identical to that of fs_value_is_filename.
It makes no sense, anyway - LOOKUP_EMPTY affects nothing
whatsoever once the pathname has been imported from userland.
And both fs_value_is_filename and fs_value_is_filename_empty
carry an already imported pathname.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Documentation/filesystems/mount_api.txt
fs/fs_parser.c
fs/fsopen.c
include/linux/fs_context.h

index 00ff0cfccfa71cdce0d02ddd8608cf962ee99308..b96e73591327b16e9f4f8048b64731d2698a1648 100644 (file)
@@ -427,7 +427,6 @@ returned.
        fs_value_is_string,             Value is a string
        fs_value_is_blob,               Value is a binary blob
        fs_value_is_filename,           Value is a filename* + dirfd
-       fs_value_is_filename_empty,     Value is a filename* + dirfd + AT_EMPTY_PATH
        fs_value_is_file,               Value is an open file (file*)
 
      If there is a value, that value is stored in a union in the struct in one
index 065ce6c225874865dfb345e82c9fdf157343b39b..dc5c6737c2807feb563795a6f128bba6f1d9cdf7 100644 (file)
@@ -268,9 +268,6 @@ int fs_lookup_param(struct fs_context *fc,
                        return PTR_ERR(f);
                put_f = true;
                break;
-       case fs_value_is_filename_empty:
-               flags = LOOKUP_EMPTY;
-               /* Fall through */
        case fs_value_is_filename:
                f = param->name;
                put_f = false;
index 043ffa8dc2637d88b813f223f459ac16ed76f150..c822d8924ca9ebe4a5f0b6e819b07864792b4f06 100644 (file)
@@ -321,6 +321,7 @@ SYSCALL_DEFINE5(fsconfig,
        struct fs_context *fc;
        struct fd f;
        int ret;
+       int lookup_flags = 0;
 
        struct fs_parameter param = {
                .type   = fs_value_is_undefined,
@@ -409,19 +410,12 @@ SYSCALL_DEFINE5(fsconfig,
                        goto out_key;
                }
                break;
+       case FSCONFIG_SET_PATH_EMPTY:
+               lookup_flags = LOOKUP_EMPTY;
+               /* fallthru */
        case FSCONFIG_SET_PATH:
                param.type = fs_value_is_filename;
-               param.name = getname_flags(_value, 0, NULL);
-               if (IS_ERR(param.name)) {
-                       ret = PTR_ERR(param.name);
-                       goto out_key;
-               }
-               param.dirfd = aux;
-               param.size = strlen(param.name->name);
-               break;
-       case FSCONFIG_SET_PATH_EMPTY:
-               param.type = fs_value_is_filename_empty;
-               param.name = getname_flags(_value, LOOKUP_EMPTY, NULL);
+               param.name = getname_flags(_value, lookup_flags, NULL);
                if (IS_ERR(param.name)) {
                        ret = PTR_ERR(param.name);
                        goto out_key;
index e5c14e2c53d351c5496d9be717178295171add9c..c7c69640a6c60eac68cb0329f07db2e6cb2f6c94 100644 (file)
@@ -54,7 +54,6 @@ enum fs_value_type {
        fs_value_is_string,             /* Value is a string */
        fs_value_is_blob,               /* Value is a binary blob */
        fs_value_is_filename,           /* Value is a filename* + dirfd */
-       fs_value_is_filename_empty,     /* Value is a filename* + dirfd + AT_EMPTY_PATH */
        fs_value_is_file,               /* Value is a file* */
 };