diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/file.c | 14 | ||||
-rw-r--r-- | fs/open.c | 2 |
2 files changed, 10 insertions, 6 deletions
diff --git a/fs/file.c b/fs/file.c index 50df31e104a5..66f04442a384 100644 --- a/fs/file.c +++ b/fs/file.c @@ -796,7 +796,7 @@ int __close_range(unsigned fd, unsigned max_fd, unsigned int flags) } /* - * See close_fd_get_file() below, this variant assumes current->files->file_lock + * See file_close_fd() below, this variant assumes current->files->file_lock * is held. */ struct file *__close_fd_get_file(unsigned int fd) @@ -804,11 +804,15 @@ struct file *__close_fd_get_file(unsigned int fd) return pick_file(current->files, fd); } -/* - * variant of close_fd that gets a ref on the file for later fput. - * The caller must ensure that filp_close() called on the file. +/** + * file_close_fd - return file associated with fd + * @fd: file descriptor to retrieve file for + * + * Doesn't take a separate reference count. + * + * Returns: The file associated with @fd (NULL if @fd is not open) */ -struct file *close_fd_get_file(unsigned int fd) +struct file *file_close_fd(unsigned int fd) { struct files_struct *files = current->files; struct file *file; diff --git a/fs/open.c b/fs/open.c index 02dc608d40d8..48775329f3f1 100644 --- a/fs/open.c +++ b/fs/open.c @@ -1577,7 +1577,7 @@ SYSCALL_DEFINE1(close, unsigned int, fd) int retval; struct file *file; - file = close_fd_get_file(fd); + file = file_close_fd(fd); if (!file) return -EBADF; |