Add overlay(-O) mount option support
authorSuman Chakravartula <suman@gogrid.com>
Thu, 12 Jan 2012 00:48:02 +0000 (16:48 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 12 Jan 2012 23:49:38 +0000 (15:49 -0800)
commite18be9a637088911d2b618788cd45982986e63cb
tree611485fc0e3b37bea63a1e48ccff9f55be9b38a6
parent96b91ef0d6b289037c4d54357901e4b694e08f02
Add overlay(-O) mount option support

Linux supports mounting over non-empty directories by default.
In Solaris this is not the case and -O option is required for
zfs mount to mount a zfs filesystem over a non-empty directory.

For compatibility, I've added support for -O option to mount
zfs filesystems over non-empty directories if the user wants
to, just like in Solaris.

I've defined MS_OVERLAY to record it in the flags variable if
the -O option is supplied.  The flags variable passes through
a few functions and its checked before performing the empty
directory check in zfs_mount function.  If -O is given, the
check is not performed.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #473
cmd/zfs/zfs_main.c
lib/libspl/include/sys/mount.h
lib/libzfs/libzfs_mount.c