xfs_io: Allow -P and -L to be given to open for O_PATH and O_NOFOLLOW
Allow "open -P" to specify O_PATH so that paths which would otherwise be
unopenable might be opened for stat()'ing. Such things include files that
would incur an access error or device files for which no corresponding
driver is available.
Allow "-L" to be given in conjunction with O_PATH to specify O_NOFOLLOW
also.
We also have to avoid calling xfsctl() if O_PATH is given as ioctls are
forbidden on such fds. This means we cannot retrieve the geometry
information on an XFS filesystem, so the record gets cleared instead. For
the moment, only the xfsctl() calls in the 'open' command are
conditionalised.
Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>