From e06eb6e5cc4e14be50a5def15a19159c368ecc5e Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 13 Dec 2019 11:10:11 -0700 Subject: [PATCH] fs: make build_open_flags() available internally to #26323588 commit 35cb6d54c1d5daf1d1ed585ef5ce4557e7ab284c upstream. This is a prep patch for supporting non-blocking open from io_uring. Signed-off-by: Jens Axboe Signed-off-by: Joseph Qi Acked-by: Xiaoguang Wang --- fs/internal.h | 2 ++ fs/open.c | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/internal.h b/fs/internal.h index 7b7af2f77d5c..47b6d0530dae 100644 --- a/fs/internal.h +++ b/fs/internal.h @@ -117,6 +117,8 @@ extern struct file *do_filp_open(int dfd, struct filename *pathname, const struct open_flags *op); extern struct file *do_file_open_root(struct dentry *, struct vfsmount *, const char *, const struct open_flags *); +extern struct open_how build_open_how(int flags, umode_t mode); +extern int build_open_flags(const struct open_how *how, struct open_flags *op); long do_sys_ftruncate(unsigned int fd, loff_t length, int small); long do_faccessat(int dfd, const char __user *filename, int mode); diff --git a/fs/open.c b/fs/open.c index 89be988a373f..67c2199c3121 100644 --- a/fs/open.c +++ b/fs/open.c @@ -949,7 +949,7 @@ EXPORT_SYMBOL(open_with_fake_path); #define WILL_CREATE(flags) (flags & (O_CREAT | __O_TMPFILE)) #define O_PATH_FLAGS (O_DIRECTORY | O_NOFOLLOW | O_PATH | O_CLOEXEC) -static inline struct open_how build_open_how(int flags, umode_t mode) +inline struct open_how build_open_how(int flags, umode_t mode) { struct open_how how = { .flags = flags & VALID_OPEN_FLAGS, @@ -965,8 +965,7 @@ static inline struct open_how build_open_how(int flags, umode_t mode) return how; } -static inline int build_open_flags(const struct open_how *how, - struct open_flags *op) +inline int build_open_flags(const struct open_how *how, struct open_flags *op) { int flags = how->flags; int lookup_flags = 0; -- GitLab