OSDN Git Service

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 00ff0cf..b96e735 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 065ce6c..dc5c673 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 043ffa8..c822d89 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 e5c14e2..c7c6964 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* */
 };