linux/drivers/staging
Linus Torvalds 7f427d3a60 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull parallel filesystem directory handling update from Al Viro.

This is the main parallel directory work by Al that makes the vfs layer
able to do lookup and readdir in parallel within a single directory.
That's a big change, since this used to be all protected by the
directory inode mutex.

The inode mutex is replaced by an rwsem, and serialization of lookups of
a single name is done by a "in-progress" dentry marker.

The series begins with xattr cleanups, and then ends with switching
filesystems over to actually doing the readdir in parallel (switching to
the "iterate_shared()" that only takes the read lock).

A more detailed explanation of the process from Al Viro:
 "The xattr work starts with some acl fixes, then switches ->getxattr to
  passing inode and dentry separately.  This is the point where the
  things start to get tricky - that got merged into the very beginning
  of the -rc3-based #work.lookups, to allow untangling the
  security_d_instantiate() mess.  The xattr work itself proceeds to
  switch a lot of filesystems to generic_...xattr(); no complications
  there.

  After that initial xattr work, the series then does the following:

   - untangle security_d_instantiate()

   - convert a bunch of open-coded lookup_one_len_unlocked() to calls of
     that thing; one such place (in overlayfs) actually yields a trivial
     conflict with overlayfs fixes later in the cycle - overlayfs ended
     up switching to a variant of lookup_one_len_unlocked() sans the
     permission checks.  I would've dropped that commit (it gets
     overridden on merge from #ovl-fixes in #for-next; proper resolution
     is to use the variant in mainline fs/overlayfs/super.c), but I
     didn't want to rebase the damn thing - it was fairly late in the
     cycle...

   - some filesystems had managed to depend on lookup/lookup exclusion
     for *fs-internal* data structures in a way that would break if we
     relaxed the VFS exclusion.  Fixing hadn't been hard, fortunately.

   - core of that series - parallel lookup machinery, replacing
     ->i_mutex with rwsem, making lookup_slow() take it only shared.  At
     that point lookups happen in parallel; lookups on the same name
     wait for the in-progress one to be done with that dentry.

     Surprisingly little code, at that - almost all of it is in
     fs/dcache.c, with fs/namei.c changes limited to lookup_slow() -
     making it use the new primitive and actually switching to locking
     shared.

   - parallel readdir stuff - first of all, we provide the exclusion on
     per-struct file basis, same as we do for read() vs lseek() for
     regular files.  That takes care of most of the needed exclusion in
     readdir/readdir; however, these guys are trickier than lookups, so
     I went for switching them one-by-one.  To do that, a new method
     '->iterate_shared()' is added and filesystems are switched to it
     as they are either confirmed to be OK with shared lock on directory
     or fixed to be OK with that.  I hope to kill the original method
     come next cycle (almost all in-tree filesystems are switched
     already), but it's still not quite finished.

   - several filesystems get switched to parallel readdir.  The
     interesting part here is dealing with dcache preseeding by readdir;
     that needs minor adjustment to be safe with directory locked only
     shared.

     Most of the filesystems doing that got switched to in those
     commits.  Important exception: NFS.  Turns out that NFS folks, with
     their, er, insistence on VFS getting the fuck out of the way of the
     Smart Filesystem Code That Knows How And What To Lock(tm) have
     grown the locking of their own.  They had their own homegrown
     rwsem, with lookup/readdir/atomic_open being *writers* (sillyunlink
     is the reader there).  Of course, with VFS getting the fuck out of
     the way, as requested, the actual smarts of the smart filesystem
     code etc. had become exposed...

   - do_last/lookup_open/atomic_open cleanups.  As the result, open()
     without O_CREAT locks the directory only shared.  Including the
     ->atomic_open() case.  Backmerge from #for-linus in the middle of
     that - atomic_open() fix got brought in.

   - then comes NFS switch to saner (VFS-based ;-) locking, killing the
     homegrown "lookup and readdir are writers" kinda-sorta rwsem.  All
     exclusion for sillyunlink/lookup is done by the parallel lookups
     mechanism.  Exclusion between sillyunlink and rmdir is a real rwsem
     now - rmdir being the writer.

     Result: NFS lookups/readdirs/O_CREAT-less opens happen in parallel
     now.

   - the rest of the series consists of switching a lot of filesystems
     to parallel readdir; in a lot of cases ->llseek() gets simplified
     as well.  One backmerge in there (again, #for-linus - rockridge
     fix)"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (74 commits)
  ext4: switch to ->iterate_shared()
  hfs: switch to ->iterate_shared()
  hfsplus: switch to ->iterate_shared()
  hostfs: switch to ->iterate_shared()
  hpfs: switch to ->iterate_shared()
  hpfs: handle allocation failures in hpfs_add_pos()
  gfs2: switch to ->iterate_shared()
  f2fs: switch to ->iterate_shared()
  afs: switch to ->iterate_shared()
  befs: switch to ->iterate_shared()
  befs: constify stuff a bit
  isofs: switch to ->iterate_shared()
  get_acorn_filename(): deobfuscate a bit
  btrfs: switch to ->iterate_shared()
  logfs: no need to lock directory in lseek
  switch ecryptfs to ->iterate_shared
  9p: switch to ->iterate_shared()
  fat: switch to ->iterate_shared()
  romfs, squashfs: switch to ->iterate_shared()
  more trivial ->iterate_shared conversions
  ...
2016-05-17 11:01:31 -07:00
..
android Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2016-03-25 08:48:31 -07:00
board
clocking-wizard
comedi staging: comedi: ni_mio_common: fix the ni_write[blw]() functions 2016-03-22 22:22:13 -04:00
dgnc Staging driver patches for 4.6-rc1 2016-03-17 22:13:41 -07:00
emxx_udc Staging: emxx_udc: Return NULL instead of 0. 2016-03-11 22:09:09 -08:00
fbtft staging: fbtft: fb_uc1611.c: Drop void pointer cast 2016-03-11 22:09:09 -08:00
fsl-mc staging: fsl-mc: fix incorrect type passed to dev_err macros 2016-03-22 22:22:13 -04:00
fwserial
gdm724x Staging: gdm724x: Replace random_ether_addr with eth_random_addr 2016-03-05 14:48:04 -08:00
goldfish staging: goldfish: audio: fix compiliation on arm 2016-03-11 22:09:09 -08:00
gs_fpgaboot staging: gs_fpgaboot: drop wrapper function 'finish_driver' 2016-03-11 22:09:09 -08:00
i4l isdn: i4l: move active-isdn drivers to staging 2016-03-05 15:00:38 -08:00
iio staging: iio: addac: Remove unnecessary else after return 2016-03-11 22:09:09 -08:00
lustre lustre: don't need to lock inode in directory lseek 2016-05-09 11:41:14 -04:00
media [media] davinci_vpfe: Revert "staging: media: davinci_vpfe: remove,unnecessary ret variable" 2016-04-20 16:00:59 -03:00
most staging: most: hdm-dim2: Remove possible dereference error 2016-03-22 22:22:13 -04:00
mt29f_spinand MTD updates for v4.6 2016-03-24 19:57:15 -07:00
netlogic staging: netlogic: Replacing pr_err with dev_err after the call to devm_kzalloc 2016-03-11 22:14:06 -08:00
nvec Staging: nvec: removes an unnecessary cast on a void pointer 2016-03-11 22:09:09 -08:00
octeon staging: octeon: Fix braces in condition statement 2016-03-11 22:09:09 -08:00
octeon-usb staging: octeon-usb: update TODO 2016-02-25 22:38:16 -08:00
olpc_dcon Revert "Staging: olpc_dcon: Remove obsolete driver" 2016-04-04 13:52:35 -07:00
rdma Final set of -rc fixes for 4.6 2016-04-29 17:07:54 -07:00
rtl8188eu Staging: rtl8188eu: Remove function rtw_freq2ch 2016-03-11 22:09:09 -08:00
rtl8192e Staging driver patches for 4.6-rc1 2016-03-17 22:13:41 -07:00
rtl8192u Staging driver patches for 4.6-rc1 2016-03-17 22:13:41 -07:00
rtl8712 staging: refresh TODO for rtl8712 2016-03-22 22:22:13 -04:00
rtl8723au staging: refresh TODO for rtl8723au 2016-03-22 22:22:13 -04:00
rts5208 staging: rts5208: Replace pci_enable_device with pcim_enable_device 2016-03-11 22:09:09 -08:00
skein staging: skein: threefish_block: Use rol64 2016-03-11 22:09:09 -08:00
slicoss Staging: slicoss: changes comparisons to NULL in slicoss.c 2016-03-11 22:09:09 -08:00
sm750fb Staging: sm750fb: Remove unused functions 2016-03-11 22:09:09 -08:00
speakup staging: speakup: Replace del_timer with del_timer_sync 2016-03-11 22:09:09 -08:00
unisys x86/cpufeature: Remove cpu_has_hypervisor 2016-03-31 13:35:07 +02:00
vme staging: vme: devices: Replace kzalloc with devm_kzalloc 2016-03-11 22:09:09 -08:00
vt6655 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-03-19 10:05:34 -07:00
vt6656 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-03-19 10:05:34 -07:00
wilc1000 staging: wilc1000: fix a couple of memory leaks 2016-03-22 22:27:36 -04:00
wlan-ng Staging: wlan-ng: Do not print message if kzalloc() failed. 2016-03-11 22:09:09 -08:00
xgifb Staging: xgifb: remove useless blank lines 2016-03-11 22:09:09 -08:00
Kconfig Revert "Staging: olpc_dcon: Remove obsolete driver" 2016-04-04 13:52:35 -07:00
Makefile Revert "Staging: olpc_dcon: Remove obsolete driver" 2016-04-04 13:52:35 -07:00