Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

move close_range(2) into fs/file.c, fold __close_range() into it

We never had callers for __close_range() except for close_range(2)
itself. Nothing of that sort has appeared in four years and if any users
do show up, we can always separate those suckers again.

Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro cab05152 1fa4ffd8

+4 -20
+4 -2
fs/file.c
··· 713 713 } 714 714 715 715 /** 716 - * __close_range() - Close all file descriptors in a given range. 716 + * sys_close_range() - Close all file descriptors in a given range. 717 717 * 718 718 * @fd: starting file descriptor to close 719 719 * @max_fd: last file descriptor to close ··· 721 721 * 722 722 * This closes a range of file descriptors. All file descriptors 723 723 * from @fd up to and including @max_fd are closed. 724 + * Currently, errors to close a given file descriptor are ignored. 724 725 */ 725 - int __close_range(unsigned fd, unsigned max_fd, unsigned int flags) 726 + SYSCALL_DEFINE3(close_range, unsigned int, fd, unsigned int, max_fd, 727 + unsigned int, flags) 726 728 { 727 729 struct task_struct *me = current; 728 730 struct files_struct *cur_fds = me->files, *fds = NULL;
-17
fs/open.c
··· 1574 1574 return retval; 1575 1575 } 1576 1576 1577 - /** 1578 - * sys_close_range() - Close all file descriptors in a given range. 1579 - * 1580 - * @fd: starting file descriptor to close 1581 - * @max_fd: last file descriptor to close 1582 - * @flags: reserved for future extensions 1583 - * 1584 - * This closes a range of file descriptors. All file descriptors 1585 - * from @fd up to and including @max_fd are closed. 1586 - * Currently, errors to close a given file descriptor are ignored. 1587 - */ 1588 - SYSCALL_DEFINE3(close_range, unsigned int, fd, unsigned int, max_fd, 1589 - unsigned int, flags) 1590 - { 1591 - return __close_range(fd, max_fd, flags); 1592 - } 1593 - 1594 1577 /* 1595 1578 * This routine simulates a hangup on the tty, to arrange that users 1596 1579 * are given clean terminals at login time.
-1
include/linux/fdtable.h
··· 111 111 const void *); 112 112 113 113 extern int close_fd(unsigned int fd); 114 - extern int __close_range(unsigned int fd, unsigned int max_fd, unsigned int flags); 115 114 extern struct file *file_close_fd(unsigned int fd); 116 115 117 116 extern struct kmem_cache *files_cachep;