summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* switch simple cases of fget_light to fdgetAl Viro2012-09-2644-763/+633
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* new helpers: fdget()/fdput()Al Viro2012-09-261-0/+26
| | | | Signed-off-bs: Al Viro <viro@zeniv.linux.org.uk>
* switch o2hb_region_dev_write() to fget_light()Al Viro2012-09-261-2/+3
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* proc_map_files_readdir(): don't bother with grabbing filesAl Viro2012-09-261-19/+9
| | | | | | all we need is their ->f_mode, so just collect _that_ Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* make get_file() return its argumentAl Viro2012-09-2616-38/+23
| | | | | | simplifies a bunch of callers... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* vhost_set_vring(): turn pollstart/pollstop into boolAl Viro2012-09-261-4/+4
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch prctl_set_mm_exe_file() to fget_light()Al Viro2012-09-261-4/+4
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch xfs_find_handle() to fget_light()Al Viro2012-09-261-3/+3
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch xfs_swapext() to fget_light()Al Viro2012-09-261-5/+5
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch coda get_device_index() to fget_light()Al Viro2012-09-261-17/+15
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch infinibarf users of fget() to fget_light()Al Viro2012-09-263-14/+10
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch vfio_group_set_container() to fget_light()Al Viro2012-09-261-4/+4
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch btrfs_ioctl_clone() to fget_light()Al Viro2012-09-261-3/+3
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch mqueue syscalls to fget_light()Al Viro2012-09-261-12/+14
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch SNDRV_PCM_IOCTL_LINK to fget_light()Al Viro2012-09-261-6/+7
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch timerfd_[sg]ettime(2) to fget_light()Al Viro2012-09-261-8/+9
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch epoll_wait(2) to fget_light()Al Viro2012-09-261-3/+3
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch btrfs_ioctl_snap_create_transid() to fget_light()Al Viro2012-09-261-7/+7
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch EXT4_IOC_MOVE_EXT to fget_light()Al Viro2012-09-261-3/+3
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* export fget_lightAl Viro2012-09-261-0/+1
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* ext4: close struct file leak on EXT4_IOC_MOVE_EXTAl Viro2012-09-261-1/+2
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch hpux_getdents() to fget_light()Al Viro2012-09-261-3/+3
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch itanic perfmonctl(2) to fget_light()Al Viro2012-09-261-2/+3
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch osf_getdirentries() to fget_light()Al Viro2012-09-261-3/+3
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch readahead(2) to fget_light()Al Viro2012-09-261-2/+3
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch fadvise(2) to fget_light()Al Viro2012-09-261-2/+3
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch fchmod(2) to fget_light()Al Viro2012-09-261-7/+5
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch fallocate(2) to fget_light()Al Viro2012-09-261-3/+3
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch ftruncate(2) to fget_lightAl Viro2012-09-261-5/+5
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* namei.c: fix BS commentAl Viro2012-09-261-1/+1
| | | | | | | get_write_access() is needed for nfsd, not binfmt_aout (the latter has no business doing anything of that kind, of course) Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* don't leak O_CLOEXEC into ->f_flagsAl Viro2012-09-262-2/+2
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* procfs: Convert /proc/pid/fdinfo/ handling routines to seq-file v2Cyrill Gorcunov2012-09-261-48/+64
| | | | | | | | | | | This patch converts /proc/pid/fdinfo/ handling routines to seq-file which is needed to extend seq operations and plug in auxiliary fdinfo provides from subsystems like eventfd/eventpoll/fsnotify. Note the proc_fd_link no longer call for proc_fd_info, simply because the guts of proc_fd_info() got merged into ->show() of that seq_file Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* procfs: Move /proc/pid/fd[info] handling code to fd.[ch]Cyrill Gorcunov2012-09-265-387/+416
| | | | | | | | | | | | | | | | | | | | | | This patch prepares the ground for further extension of /proc/pid/fd[info] handling code by moving fdinfo handling code into fs/proc/fd.c. I think such move makes both fs/proc/base.c and fs/proc/fd.c easier to read. Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Acked-by: Pavel Emelyanov <xemul@parallels.com> CC: Al Viro <viro@ZenIV.linux.org.uk> CC: Alexey Dobriyan <adobriyan@gmail.com> CC: Andrew Morton <akpm@linux-foundation.org> CC: James Bottomley <jbottomley@parallels.com> CC: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> CC: Alexey Dobriyan <adobriyan@gmail.com> CC: Matthew Helsley <matt.helsley@gmail.com> CC: "J. Bruce Fields" <bfields@fieldses.org> CC: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* new helper: daemonize_descriptors()Al Viro2012-09-263-3/+8
| | | | | | | | descriptor-related parts of daemonize, done right. As the result we simplify the locking rules for ->files - we hold task_lock in *all* cases when we modify ->files. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch spufs/coredump to iterate_fd()Al Viro2012-09-261-20/+20
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* do_coredump(): make sure that descriptor table isn't sharedAl Viro2012-09-261-0/+7
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* new helper: iterate_fd()Al Viro2012-09-265-84/+71
| | | | | | | | | | | | | iterates through the opened files in given descriptor table, calling a supplied function; we stop once non-zero is returned. Callback gets struct file *, descriptor number and const void * argument passed to iterator. It is called with files->file_lock held, so it is not allowed to block. tty_io, netprio_cgroup and selinux flush_unauthorized_files() converted to its use. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* make expand_files() and alloc_fd() staticAl Viro2012-09-263-4/+2
| | | | | | no callers outside of fs/file.c left Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* take __{set,clear}_{open_fd,close_on_exec}() into fs/file.cAl Viro2012-09-262-20/+20
| | | | | | nobody uses those outside anymore. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch flush_unauthorized_files() to replace_fd()Al Viro2012-09-261-32/+15
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* new helper: replace_fd()Al Viro2012-09-263-39/+64
| | | | | | analog of dup2(), except that it takes struct file * as source. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* take purely descriptor-related stuff from fcntl.c to file.cAl Viro2012-09-263-128/+137
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* take close-on-exec logics to fs/file.c, clean it up a bitAl Viro2012-09-263-35/+44
| | | | | | | ... and add cond_resched() there, while we are at it. We can get large latencies as is... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* um: resurrect the right variant of mconsole_proc()Al Viro2012-09-261-78/+21
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* take descriptor-related part of close() to file.cAl Viro2012-09-264-53/+31
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* take fget() and friends to fs/file.cAl Viro2012-09-262-106/+106
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* expose a low-level variant of fd_install() for binderAl Viro2012-09-263-13/+18
| | | | | | | | | | | | | | Similar situation to that of __alloc_fd(); do not use unless you really have to. You should not touch any descriptor table other than your own; it's a sure sign of a really bad API design. As with __alloc_fd(), you *must* use a first-class reference to struct files_struct; something obtained by get_files_struct(some task) (let alone direct task->files) will not do. It must be either current->files, or obtained by get_files_struct(current) by the owner of that sucker and given to you. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* move put_unused_fd() and fd_install() to fs/file.cAl Viro2012-09-262-44/+44
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* trim free_fdtable_rcu()Al Viro2012-09-261-15/+2
| | | | | | embedded case isn't hit anymore Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* don't bother with call_rcu() in put_files_struct()Al Viro2012-09-261-9/+5
| | | | | | | | | | | At that point nobody can see us anyway; everything that looks at files_fdtable(files) is separated from the guts of put_files_struct(files) - either since files is current->files or because we fetched it under task_lock() and hadn't dropped that yet, or because we'd bumped files->count while holding task_lock()... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
OpenPOWER on IntegriCloud