linux/include
Krzysztof Opasiak d79d75b5c5 fs: configfs: Add unlocked version of configfs_depend_item()
This change is necessary for the SCSI target usb gadget composed with
configfs. In this case configfs will be used for two different purposes:
to compose a usb gadget and to configure the target part. If an instance
of tcm function is created in $CONFIGFS_ROOT/usb_gadget/<gadget>/functions
a tpg can be created in $CONFIGFS_ROOT/target/usb_gadget/<wwn>/, but after
a tpg is created the tcm function must not be removed until its
corresponding tpg is gone. While the configfs_depend/undepend_item() are
meant exactly for creating this kind of dependencies, they are not suitable
if the other kernel subsystem happens to be another subsystem in configfs,
so this patch adds unlocked versions meant for configfs callbacks.

Above description has been provided by:
Andrzej Pietrasiewicz <andrzej.p@samsung.com>

In configfs_depend_item() we have to consider two possible cases:

1) When we are called to depend another item in the same subsystem
   as caller
	In this case we should skip locking configfs root as we know
	that configfs is in valid state and our subsystem will not
	be unregistered during this call.

2) When we are called to depend item in different subsystem than
   our caller
	In this case we are also sure that configfs is in valid state
	but we have to lock root of configfs to avoid unregistration
	of target's subsystem. As it is other than caller's subsystem,
	there may be nothing what protects us against unregistration
	of that subsystem.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2015-12-20 18:04:03 -08:00
..
acpi Merge branch 'acpi-pci' 2015-11-07 01:30:10 +01:00
asm-generic h8300 update for v4.4 2015-11-12 15:26:39 -08:00
clocksource
crypto Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2015-11-05 15:32:38 -08:00
drm drm/atomic: add a drm_atomic_clean_old_fb helper. 2015-11-17 13:02:14 +02:00
dt-bindings ARM: DT updates for v4.4 2015-11-10 15:06:26 -08:00
keys
kvm s390: A bunch of fixes and optimizations for interrupt and time 2015-11-05 16:26:26 -08:00
linux fs: configfs: Add unlocked version of configfs_depend_item() 2015-12-20 18:04:03 -08:00
math-emu
media
memory
misc
net net: switchdev: fix return code of fdb_dump stub 2015-11-16 15:24:37 -05:00
pcmcia
ras
rdma IB/core, cma: Make __attribute_const__ declarations sparse-friendly 2015-10-30 17:57:49 -04:00
rxrpc
scsi scsi: use host wide tags by default 2015-11-09 17:11:57 -08:00
soc ARM: SoC driver updates for v4.4 2015-11-10 15:00:03 -08:00
sound ALSA: Constify ratden/ratnum constraints 2015-10-28 11:42:22 +01:00
target Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2015-11-13 20:04:17 -08:00
trace Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux 2015-11-11 09:03:01 -08:00
uapi VFIO updates for v4.4-rc1 2015-11-13 17:05:32 -08:00
video drm/exynos/decon5433: add support for DECON-TV 2015-11-03 11:46:37 +09:00
xen
Kbuild