Commit 307f68e4 authored by Chuck Lever's avatar Chuck Lever Committed by Greg Kroah-Hartman
Browse files

libfs: Add simple_offset_empty()



[ Upstream commit ecba88a3 ]

For simple filesystems that use directory offset mapping, rely
strictly on the directory offset map to tell when a directory has
no children.

After this patch is applied, the emptiness test holds only the RCU
read lock when the directory being tested has no children.

In addition, this adds another layer of confirmation that
simple_offset_add/remove() are working as expected.

Reviewed-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Link: https://lore.kernel.org/r/170820143463.6328.7872919188371286951.stgit@91.116.238.104.host.secureserver.net


Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
Stable-dep-of: 5a1a25be ("libfs: Add simple_offset_rename() API")
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fc90bbcc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment