]> git.baikalelectronics.ru Git - kernel.git/commit
superblock: move pin_sb_for_writeback() to fs/super.c
authorDave Chinner <dchinner@redhat.com>
Fri, 8 Jul 2011 04:14:41 +0000 (14:14 +1000)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 20 Jul 2011 05:44:38 +0000 (01:44 -0400)
commit7bf0561f34a261e4017dd9eeaa2f0776102928fb
tree52d1ecd11d48faa7e6f8d6600c8e76807b0985a5
parent07fc29e1163b05da0ab5e378806d208e4ec52952
superblock: move pin_sb_for_writeback() to fs/super.c

The per-sb shrinker has the same requirement as the writeback
threads of ensuring that the superblock is usable and pinned for the
time it takes to run the work. Both need to take a passive reference
to the sb, take a read lock on the s_umount lock and then only
continue if an unmount is not in progress.

pin_sb_for_writeback() does this exactly, so move it to fs/super.c
and rename it to grab_super_passive() and exporting it via
fs/internal.h for all the VFS code to be able to use.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/fs-writeback.c
fs/internal.h
fs/super.c