mirror of https://github.com/torvalds/linux.git
namespace: convert open_tree() to FD_ADD()
Link: https://patch.msgid.link/20251123-work-fd-prepare-v4-5-b6efa1706cfd@kernel.org Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
fbe58faa69
commit
542a406543
|
|
@ -3103,19 +3103,7 @@ static struct file *vfs_open_tree(int dfd, const char __user *filename, unsigned
|
|||
|
||||
SYSCALL_DEFINE3(open_tree, int, dfd, const char __user *, filename, unsigned, flags)
|
||||
{
|
||||
int fd;
|
||||
struct file *file __free(fput) = NULL;
|
||||
|
||||
file = vfs_open_tree(dfd, filename, flags);
|
||||
if (IS_ERR(file))
|
||||
return PTR_ERR(file);
|
||||
|
||||
fd = get_unused_fd_flags(flags & O_CLOEXEC);
|
||||
if (fd < 0)
|
||||
return fd;
|
||||
|
||||
fd_install(fd, no_free_ptr(file));
|
||||
return fd;
|
||||
return FD_ADD(flags, vfs_open_tree(dfd, filename, flags));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue