OSDN Git Service

fs: Add helper functions for permanently empty directories.
authorEric W. Biederman <ebiederm@xmission.com>
Sat, 9 May 2015 20:54:49 +0000 (15:54 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Jul 2015 17:10:10 +0000 (10:10 -0700)
commitbb9fcac1598aeecc9079c467850b01e1c2515124
tree39f8cc29375ae4c67e41ac7a4d5508f2862bdf1d
parent8864dd19952114bae75f59e4322e85e2faedcc94
fs: Add helper functions for permanently empty directories.

commit fbabfd0f4ee2e8847bf56edf481249ad1bb8c44d upstream.

To ensure it is safe to mount proc and sysfs I need to check if
filesystems that are mounted on top of them are mounted on truly empty
directories.  Given that some directories can gain entries over time,
knowing that a directory is empty right now is insufficient.

Therefore add supporting infrastructure for permantently empty
directories that proc and sysfs can use when they create mount points
for filesystems and fs_fully_visible can use to test for permanently
empty directories to ensure that nothing will be gained by mounting a
fresh copy of proc or sysfs.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/libfs.c
include/linux/fs.h