make vfree() safe to call from interrupt contexts

A bunch of RCU callbacks want to be able to do vfree() and end up with
rather kludgy schemes.  Just let vfree() do the right thing - put the
victim on llist and schedule actual __vunmap() via schedule_work(), so
that it runs from non-interrupt context.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
get rid of full-hash scan on detaching vfsmounts

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
saner umount_tree()/release_mounts(), part 1

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 the second argument of shrink_submounts()

... it's always &unmounted.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
more conversions to namespace_unlock()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
switch unlock_mount() to namespace_unlock(), convert all umount_tree() callers

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>
fold release_mounts() into namespace_unlock()

... 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>
reiserfs: don't wank with EFBIG before calling do_sync_write()

look for file_capable() in there...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
hpfs: move setting hpfs-private i_dirty to ->write_end()

... so that writev(2) doesn't miss it.  Get rid of hpfs_file_write().

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
lift sb_start_write/sb_end_write out of ->aio_write()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
f2fs: use mnt_want_write_file() in ioctl

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
switch compat readv/writev variants to COMPAT_SYSCALL_DEFINE

... and take to fs/read_write.c

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
lift sb_start_write() out of ->write()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
lift sb_start_write into default_file_splice_write()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
lift sb_start_write out of ->splice_write()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fold fifo.c into pipe.c

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
pipe: fold file_operations instances in one

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
pipe: switch wait_for_partner() and wake_up_partner() to pipe_inode_info

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
pipe: preparation to new locking rules

* 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: take allocation and freeing of pipe_inode_info out of ->i_mutex

* 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>