summaryrefslogtreecommitdiffstats
path: root/fs
Commit message (Collapse)AuthorAgeFilesLines
* proc: Move proc_fd() to fs/proc/fd.hDavid Howells2013-05-012-5/+5
| | | | | | | Move proc_fd() to fs/proc/fd.h. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* proc: Uninline pid_delete_dentry()David Howells2013-05-012-9/+14
| | | | | | | Uninline pid_delete_dentry() as it's only used by three function pointers. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* proc: Supply PDE attribute setting accessor functionsDavid Howells2013-05-011-0/+13
| | | | | | | | | | | | | | | | | Supply accessor functions to set attributes in proc_dir_entry structs. The following are supplied: proc_set_size() and proc_set_user(). Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> cc: linuxppc-dev@lists.ozlabs.org cc: linux-media@vger.kernel.org cc: netdev@vger.kernel.org cc: linux-wireless@vger.kernel.org cc: linux-pci@vger.kernel.org cc: netfilter-devel@vger.kernel.org cc: alsa-devel@alsa-project.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* proc: Split kcore bits from linux/procfs.h into linux/kcore.hDavid Howells2013-04-292-1/+3
| | | | | | | | | | | | | Split kcore bits from linux/procfs.h into linux/kcore.h. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Acked-by: Ralf Baechle <ralf@linux-mips.org> cc: linux-mips@linux-mips.org cc: sparclinux@vger.kernel.org cc: x86@kernel.org cc: linux-mm@kvack.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Include missing linux/magic.h inclusionsDavid Howells2013-04-291-0/+1
| | | | | | | | | Include missing linux/magic.h inclusions where the source file is currently expecting to get magic numbers through linux/proc_fs.h. Signed-off-by: David Howells <dhowells@redhat.com> cc: linux-efi@vger.kernel.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Include missing linux/slab.h inclusionsDavid Howells2013-04-291-0/+1
| | | | | | | | | | | | | | | Include missing linux/slab.h inclusions where the source file is currently expecting to get kmalloc() and co. through linux/proc_fs.h. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> cc: linux-s390@vger.kernel.org cc: sparclinux@vger.kernel.org cc: linux-efi@vger.kernel.org cc: linux-mtd@lists.infradead.org cc: devel@driverdev.osuosl.org cc: x86@kernel.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* proc: Delete create_proc_read_entry()David Howells2013-04-293-204/+1
| | | | | | | | | | | Delete create_proc_read_entry() as it no longer has any users. Also delete read_proc_t, write_proc_t, the read_proc member of the proc_dir_entry struct and the support functions that use them. This saves a pointer for every PDE allocated. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* fanotify: don't wank with FASYNC on ->release()Al Viro2013-04-291-3/+0
| | | | | | ... it's done already by __fput() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* hppfs: get rid of ->fsync()Al Viro2013-04-291-7/+0
| | | | | | | it has grown by accident - directories there do *not* use page cache, so there's nothing to write. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* hppfs: fix the leaks on close()Al Viro2013-04-291-1/+12
| | | | | | we need to close the underlying procfs file and free ->private_data Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* new helper: read_code()Al Viro2013-04-294-43/+35
| | | | | | | | switch binfmts that use ->read() to that (and to kernel_read() in several cases in binfmt_flat - sure, it's nommu, but still, doing ->read() into kmalloc'ed buffer...) Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* try a saner locking for pde_opener...Al Viro2013-04-092-43/+23
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* deal with races between remove_proc_entry() and proc_reg_release()Al Viro2013-04-092-53/+34
| | | | | | | * serialize the call of ->release() on per-pdeo mutex * don't remove pdeo from per-pde list until we are through with it Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* procfs: preparations for remove_proc_entry() race fixesAl Viro2013-04-093-205/+133
| | | | | | | | * leave ->proc_fops alone; make ->pde_users negative instead * trim pde_opener * move relevant code in fs/proc/inode.c Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* procfs: Clean up huge if-statement in __proc_file_read()David Howells2013-04-091-51/+47
| | | | | | | | | Switch huge if-statement in __proc_file_read() around. This then puts the single line loop break immediately after the if-statement and allows us to de-indent the huge comment and make it take fewer lines. The code following the if-statement then follows naturally from the call to dp->read_proc(). Signed-off-by: David Howells <dhowells@redhat.com>
* proc: Kill create_proc_entry()David Howells2013-04-091-3/+6
| | | | | | | Kill create_proc_entry() in favour of create_proc_read_entry(), proc_create() and proc_create_data(). Signed-off-by: David Howells <dhowells@redhat.com>
* constify a bunch of struct file_operations instancesAl Viro2013-04-091-2/+2
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* procfs: new helper - PDE_DATA(inode)Al Viro2013-04-096-9/+9
| | | | | | | | | | The only part of proc_dir_entry the code outside of fs/proc really cares about is PDE(inode)->data. Provide a helper for that; static inline for now, eventually will be moved to fs/proc, along with the knowledge of struct proc_dir_entry layout. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* procfs: kill ->write_proc()Al Viro2013-04-091-25/+0
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* new helper: single_open_size()Al Viro2013-04-091-0/+18
| | | | | | | | | | | | | | | Same as single_open(), but preallocates the buffer of given size. Doesn't make any sense for sizes up to PAGE_SIZE and doesn't make sense if output of show() exceeds PAGE_SIZE only rarely - seq_read() will take care of growing the buffer and redoing show(). If you _know_ that it will be large, it might make more sense to look into saner iterator, rather than go with single-shot one. If that's impossible, single_open_size() might be for you. Again, don't use that without a good reason; occasionally that's really the best way to go, but very often there are better solutions. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* procfs: don't allow to use proc_create, create_proc_entry, etc. for directoriesAl Viro2013-04-092-34/+27
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* reiserfs: use proc_remove_subtree()Al Viro2013-04-091-21/+9
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* procfs: switch /proc/self away from proc_dir_entryAl Viro2013-04-095-12/+55
| | | | | | | Just have it pinned in dcache all along and let procfs ->kill_sb() drop it before kill_anon_super(). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* mode_t, whack-a-mole at 11...Al Viro2013-04-093-3/+3
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* get rid of the last free_pipe_info() callersAl Viro2013-04-091-12/+6
| | | | | | and rename __free_pipe_info() to free_pipe_info() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* get rid of alloc_pipe_info() argumentAl Viro2013-04-092-4/+4
| | | | | | not used anymore Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* get rid of pipe->inodeAl Viro2013-04-093-6/+5
| | | | | | | | it's used only as a flag to distinguish normal pipes/FIFOs from the internal per-task one used by file-to-file splice. And pipe->files would work just as well for that purpose... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* introduce variants of pipe_lock/pipe_unlock for real pipes/FIFOsAl Viro2013-04-091-15/+25
| | | | | | | fs/pipe.c file_operations methods *know* that pipe is not an internal one; no need to check pipe->inode for those callers. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* pipe: set file->private_data to ->i_pipeAl Viro2013-04-092-11/+10
| | | | | | simplify get_pipe_info(), while we are at it Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* pipe: don't use ->i_mutexAl Viro2013-04-092-6/+5
| | | | | | | now it can be done - put mutex into pipe_inode_info, use it instead of ->i_mutex Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* pipe: take allocation and freeing of pipe_inode_info out of ->i_mutexAl Viro2013-04-091-21/+51
| | | | | | | | | | | | | | | | | | * new field - pipe->files; number of struct file over that pipe (all sharing the same inode, of course); protected by inode->i_lock. * pipe_release() decrements pipe->files, clears inode->i_pipe when if the counter has reached 0 (all under ->i_lock) and, in that case, frees pipe after having done pipe_unlock() * fifo_open() starts with grabbing ->i_lock, and either bumps pipe->files if ->i_pipe was non-NULL or allocates a new pipe (dropping and regaining ->i_lock) and rechecks ->i_pipe; if it's still NULL, inserts new pipe there, otherwise bumps ->i_pipe->files and frees the one we'd allocated. At that point we know that ->i_pipe is non-NULL and won't go away, so we can do pipe_lock() on it and proceed as we used to. If we end up failing, decrement pipe->files and if it reaches 0 clear ->i_pipe and free the sucker after pipe_unlock(). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* pipe: preparation to new locking rulesAl Viro2013-04-091-23/+15
| | | | | | | | * use the fact that file_inode(file)->i_pipe doesn't change while the file is opened - no locks needed to access that. * switch to pipe_lock/pipe_unlock where it's easy to do Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* pipe: switch wait_for_partner() and wake_up_partner() to pipe_inode_infoAl Viro2013-04-091-9/+9
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* pipe: fold file_operations instances in oneAl Viro2013-04-093-190/+38
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* fold fifo.c into pipe.cAl Viro2013-04-093-154/+139
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* lift sb_start_write out of ->splice_write()Al Viro2013-04-091-6/+4
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* lift sb_start_write into default_file_splice_write()Al Viro2013-04-091-2/+2
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* lift sb_start_write() out of ->write()Al Viro2013-04-095-10/+22
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch compat readv/writev variants to COMPAT_SYSCALL_DEFINEAl Viro2013-04-093-192/+195
| | | | | | ... and take to fs/read_write.c Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* f2fs: use mnt_want_write_file() in ioctlAl Viro2013-04-091-2/+2
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* lift sb_start_write/sb_end_write out of ->aio_write()Al Viro2013-04-099-20/+14
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* hpfs: move setting hpfs-private i_dirty to ->write_end()Al Viro2013-04-091-16/+20
| | | | | | ... so that writev(2) doesn't miss it. Get rid of hpfs_file_write(). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* reiserfs: don't wank with EFBIG before calling do_sync_write()Al Viro2013-04-091-60/+1
| | | | | | look for file_capable() in there... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* fold release_mounts() into namespace_unlock()Al Viro2013-04-091-23/+30
| | | | | | | | | ... and provide namespace_lock() as a trivial wrapper; switch to those two consistently. Result is patterned after rtnl_lock/rtnl_unlock pair. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch unlock_mount() to namespace_unlock(), convert all umount_tree() callersAl Viro2013-04-093-24/+16
| | | | | | | which allows to kill the last argument of umount_tree() and make release_mounts() static. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* more conversions to namespace_unlock()Al Viro2013-04-091-14/+6
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* get rid of the second argument of shrink_submounts()Al Viro2013-04-091-4/+4
| | | | | | ... it's always &unmounted. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* saner umount_tree()/release_mounts(), part 1Al Viro2013-04-091-4/+13
| | | | | | | | | global list of release_mounts() fodder, protected by namespace_sem; eventually, all umount_tree() callers will use it as kill list. Helper picking the contents of that list, releasing namespace_sem and doing release_mounts() on what it got. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* get rid of full-hash scan on detaching vfsmountsAl Viro2013-04-094-97/+149
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* mnt: release locks on error path in do_loopbackAndrey Vagin2013-04-091-1/+1
| | | | | | | | | | | | | | | | | do_loopback calls lock_mount(path) and forget to unlock_mount if clone_mnt or copy_mnt fails. [ 77.661566] ================================================ [ 77.662939] [ BUG: lock held when returning to user space! ] [ 77.664104] 3.9.0-rc5+ #17 Not tainted [ 77.664982] ------------------------------------------------ [ 77.666488] mount/514 is leaving the kernel with locks still held! [ 77.668027] 2 locks held by mount/514: [ 77.668817] #0: (&sb->s_type->i_mutex_key#7){+.+.+.}, at: [<ffffffff811cca22>] lock_mount+0x32/0xe0 [ 77.671755] #1: (&namespace_sem){+++++.}, at: [<ffffffff811cca3a>] lock_mount+0x4a/0xe0 Signed-off-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
OpenPOWER on IntegriCloud