mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
anon_inodes: convert to FD_ADD()
Link: https://patch.msgid.link/20251123-work-fd-prepare-v4-2-b6efa1706cfd@kernel.org Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
@@ -280,27 +280,8 @@ static int __anon_inode_getfd(const char *name,
|
||||
const struct inode *context_inode,
|
||||
bool make_inode)
|
||||
{
|
||||
int error, fd;
|
||||
struct file *file;
|
||||
|
||||
error = get_unused_fd_flags(flags);
|
||||
if (error < 0)
|
||||
return error;
|
||||
fd = error;
|
||||
|
||||
file = __anon_inode_getfile(name, fops, priv, flags, context_inode,
|
||||
make_inode);
|
||||
if (IS_ERR(file)) {
|
||||
error = PTR_ERR(file);
|
||||
goto err_put_unused_fd;
|
||||
}
|
||||
fd_install(fd, file);
|
||||
|
||||
return fd;
|
||||
|
||||
err_put_unused_fd:
|
||||
put_unused_fd(fd);
|
||||
return error;
|
||||
return FD_ADD(flags, __anon_inode_getfile(name, fops, priv, flags,
|
||||
context_inode, make_inode));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user