]> www.infradead.org Git - users/hch/block.git/commitdiff
fs: split off do_user_path_at_empty from user_path_at_empty()
authorStefan Roesch <shr@fb.com>
Thu, 23 Dec 2021 23:51:19 +0000 (15:51 -0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 24 Dec 2021 14:42:31 +0000 (07:42 -0700)
This splits off a do_user_path_at_empty function from the
user_path_at_empty_function. This is required so it can be
called from io_uring.

Signed-off-by: Stefan Roesch <shr@fb.com>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Link: https://lore.kernel.org/r/20211223235123.4092764-2-shr@fb.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/namei.c
include/linux/namei.h

index 1f9d2187c76555813b21f07b56ddf026d67d6337..d988e241b32c1e2a376e04ea82de1e4859a403bb 100644 (file)
@@ -2794,12 +2794,18 @@ int path_pts(struct path *path)
 }
 #endif
 
+int do_user_path_at_empty(int dfd, struct filename *filename, unsigned int flags,
+                      struct path *path)
+{
+       return filename_lookup(dfd, filename, flags, path, NULL);
+}
+
 int user_path_at_empty(int dfd, const char __user *name, unsigned flags,
-                struct path *path, int *empty)
+               struct path *path, int *empty)
 {
        struct filename *filename = getname_flags(name, flags, empty);
-       int ret = filename_lookup(dfd, filename, flags, path, NULL);
 
+       int ret = do_user_path_at_empty(dfd, filename, flags, path);
        putname(filename);
        return ret;
 }
index e89329bb3134e8b99add6f91db42b9bd3b33185c..8f3ef38c057bad840a012e95ce1828d93e571de0 100644 (file)
@@ -49,6 +49,8 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT};
 
 extern int path_pts(struct path *path);
 
+extern int do_user_path_at_empty(int dfd, struct filename *filename,
+                               unsigned int flags, struct path *path);
 extern int user_path_at_empty(int, const char __user *, unsigned, struct path *, int *empty);
 
 static inline int user_path_at(int dfd, const char __user *name, unsigned flags,