diff options
author | wollman <wollman@FreeBSD.org> | 2002-10-27 18:09:49 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 2002-10-27 18:09:49 +0000 |
commit | ce3867deda6bbe015d316b90e0119549fd5e9520 (patch) | |
tree | 224520c2cbe7d5818194f543c7572277d0126baa /sys/ufs | |
parent | 7e9d4df21f95c33c9f6ee36ceffeb83ea7bcbe61 (diff) | |
download | FreeBSD-src-ce3867deda6bbe015d316b90e0119549fd5e9520.zip FreeBSD-src-ce3867deda6bbe015d316b90e0119549fd5e9520.tar.gz |
Implement the new 1003.1-2001 pathconf() keys, including the Advisory
Information option. Other filesystem implementations should do something
similar.
With advice from: mckusick, phk
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ufs/ufs_vnops.c | 58 |
1 files changed, 47 insertions, 11 deletions
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index f8867e1..932fe45 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -2171,26 +2171,28 @@ ufs_pathconf(ap) int *a_retval; } */ *ap; { + int error; + error = 0; switch (ap->a_name) { case _PC_LINK_MAX: *ap->a_retval = LINK_MAX; - return (0); + break; case _PC_NAME_MAX: *ap->a_retval = NAME_MAX; - return (0); + break; case _PC_PATH_MAX: *ap->a_retval = PATH_MAX; - return (0); + break; case _PC_PIPE_BUF: *ap->a_retval = PIPE_BUF; - return (0); + break; case _PC_CHOWN_RESTRICTED: *ap->a_retval = 1; - return (0); + break; case _PC_NO_TRUNC: *ap->a_retval = 1; - return (0); + break; case _PC_ACL_EXTENDED: #ifdef UFS_ACL if (ap->a_vp->v_mount->mnt_flag & MNT_ACLS) @@ -2200,7 +2202,7 @@ ufs_pathconf(ap) #else *ap->a_retval = 0; #endif - return (0); + break; case _PC_ACL_PATH_MAX: #ifdef UFS_ACL if (ap->a_vp->v_mount->mnt_flag & MNT_ACLS) @@ -2210,7 +2212,7 @@ ufs_pathconf(ap) #else *ap->a_retval = 3; #endif - return (0); + break; case _PC_MAC_PRESENT: #ifdef MAC if (ap->a_vp->v_mount->mnt_flag & MNT_MULTILABEL) @@ -2220,11 +2222,45 @@ ufs_pathconf(ap) #else *ap->a_retval = 0; #endif - return (0); + break; + case _PC_ASYNC_IO: + /* _PC_ASYNC_IO should have been handled by upper layers. */ + KASSERT(0, ("_PC_ASYNC_IO should not get here")); + error = EINVAL; + break; + case _PC_PRIO_IO: + *ap->a_retval = 0; + break; + case _PC_SYNC_IO: + *ap->a_retval = 0; + break; + case _PC_ALLOC_SIZE_MIN: + *ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_bsize; + break; + case _PC_FILESIZEBITS: + *ap->a_retval = 64; + break; + case _PC_REC_INCR_XFER_SIZE: + *ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize; + break; + case _PC_REC_MAX_XFER_SIZE: + *ap->a_retval = -1; /* means ``unlimited'' */ + break; + case _PC_REC_MIN_XFER_SIZE: + *ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize; + break; + case _PC_REC_XFER_ALIGN: + *ap->a_retval = PAGE_SIZE; + break; + case _PC_SYMLINK_MAX: + *ap->a_retval = MAXPATHLEN; + break; + default: - return (EINVAL); + error = EINVAL; + break; } - /* NOTREACHED */ + return (error); } /* |