From d259328b0f41056adb67cdef1913368c5c10b705 Mon Sep 17 00:00:00 2001 From: tjr Date: Wed, 5 Mar 2003 10:23:51 +0000 Subject: [PATCH] Add a minimal implementation of VOP_PATHCONF to silence warning messages from ls(1). --- sys/coda/coda_vnops.c | 30 +++++++++++++++++++++++++++++- sys/fs/coda/coda_vnops.c | 30 +++++++++++++++++++++++++++++- 2 files changed, 58 insertions(+), 2 deletions(-) diff --git a/sys/coda/coda_vnops.c b/sys/coda/coda_vnops.c index caa4738956fc..2ae8965c1328 100644 --- a/sys/coda/coda_vnops.c +++ b/sys/coda/coda_vnops.c @@ -59,6 +59,7 @@ #include #include #include +#include #include #include @@ -138,7 +139,7 @@ struct vnodeopv_entry_desc coda_vnodeop_entries[] = { { &vop_strategy_desc, coda_strategy }, /* strategy */ { &vop_print_desc, coda_vop_error }, /* print */ { &vop_islocked_desc, coda_islocked }, /* islocked */ - { &vop_pathconf_desc, coda_vop_error }, /* pathconf */ + { &vop_pathconf_desc, coda_pathconf }, /* pathconf */ { &vop_advlock_desc, coda_vop_nop }, /* advlock */ { &vop_lease_desc, coda_vop_nop }, /* lease */ { &vop_poll_desc, (vop_t *) vop_stdpoll }, @@ -1977,3 +1978,30 @@ make_coda_node(fid, vfsp, type) return cp; } + +int +coda_pathconf(v) + void *v; +{ + struct vop_pathconf_args *ap; + int error; + int *retval; + + ap = v; + retval = ap->a_retval; + error = 0; + + switch (ap->a_name) { + case _PC_NAME_MAX: + *retval = CODA_MAXNAMLEN; + break; + case _PC_PATH_MAX: + *retval = CODA_MAXPATHLEN; + break; + default: + error = vop_stdpathconf(ap); + break; + } + + return (error); +} diff --git a/sys/fs/coda/coda_vnops.c b/sys/fs/coda/coda_vnops.c index caa4738956fc..2ae8965c1328 100644 --- a/sys/fs/coda/coda_vnops.c +++ b/sys/fs/coda/coda_vnops.c @@ -59,6 +59,7 @@ #include #include #include +#include #include #include @@ -138,7 +139,7 @@ struct vnodeopv_entry_desc coda_vnodeop_entries[] = { { &vop_strategy_desc, coda_strategy }, /* strategy */ { &vop_print_desc, coda_vop_error }, /* print */ { &vop_islocked_desc, coda_islocked }, /* islocked */ - { &vop_pathconf_desc, coda_vop_error }, /* pathconf */ + { &vop_pathconf_desc, coda_pathconf }, /* pathconf */ { &vop_advlock_desc, coda_vop_nop }, /* advlock */ { &vop_lease_desc, coda_vop_nop }, /* lease */ { &vop_poll_desc, (vop_t *) vop_stdpoll }, @@ -1977,3 +1978,30 @@ make_coda_node(fid, vfsp, type) return cp; } + +int +coda_pathconf(v) + void *v; +{ + struct vop_pathconf_args *ap; + int error; + int *retval; + + ap = v; + retval = ap->a_retval; + error = 0; + + switch (ap->a_name) { + case _PC_NAME_MAX: + *retval = CODA_MAXNAMLEN; + break; + case _PC_PATH_MAX: + *retval = CODA_MAXPATHLEN; + break; + default: + error = vop_stdpathconf(ap); + break; + } + + return (error); +}