vfs: fix flags conversion on open()

The vfs converts the read/write flags from 0/1/2 (read-only/write-only/rw) to
bit fields which are more easily testable.  But in doing so it corrupts the
other flags.

Fix FFLAGS and OFLAGS to preserve those other flags.  The test for a file
that is not readable or writable is dropped, since it is impossible to fail.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
vfs: fix fcntl() GETFL/SETFL

We store the flags in a different format than fcntl() expects; perform the
needed conversions.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
vfs: define FEXCL

For zfs.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
vfs: const correctness for vget()

Make vget() accept a const char*, and adjust various other functions that
it calls in the same way.  This makes it easier to convert vfs_mount.c to
C++.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
vfs: fix open() definition

open()'s prototype is traditionally open(const char*, int, ...) since
the third mode_t parameter is optional, and only needed if O_CREAT is
specified.

Change the definition to conform.

This allows the LFS64() macro to be used to define open64() with a
similar prototype.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
vfs: declare some vfs64 entry points

Needed by libzfs.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Merge branch 'mkfs.vfs'

Some vfs fixes needed for mkfs; already posted as part of the mkfs patchset.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>