/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#include <sys/pathname.h>
/*
* A macro to avoid cut-and-paste errors on getting a string field
* from user-land.
*/
buf, \
&len)) { \
goto cleanup; \
} \
/* \
* Need to remove 1 because copyinstr() counts the NUL. \
*/ \
len--; \
}
/*
* Take care of cleaning up a share.
* If passed in a length array, use it to determine how much
* space to clean up. Else, figure that out.
*/
static void
{
if (!sh)
return;
}
/*
* If there is no error, then this function is responsible for
* cleaning up the memory associated with the share argument.
*/
static int
{
int iHash;
share_t *s, *p;
int iPath;
if (!sh)
return (ENOENT);
break;
}
}
/*
* There does not exist a fstype in memory which
* matches the share passed in.
*/
if (!sht) {
return (ENOENT);
}
/*
* Now walk down the hash table and find the entry to free!
*/
/*
* We need exact matches.
*/
if (p) {
} else {
}
sharetab_size -= s->sh_size;
break;
}
p = s;
}
if (!s) {
return (ENOENT);
}
/*
* We need to free the share for the caller.
*/
return (0);
}
/*
* The caller must have allocated memory for us to use.
*/
static int
{
int iHash;
share_t *s, *p;
int iPath;
int n;
if (!sh) {
return (ENOENT);
}
/*
* We need to find the hash buckets for the fstype.
*/
break;
}
}
/*
* Did not exist, so allocate one and add it to the
* sharetab.
*/
if (!sht) {
}
/*
* Now we need to find where we have to add the entry.
*/
if (shl) {
} else {
}
/*
* We need to account for field seperators and
* the EOL.
*/
/*
* Now walk down the hash table and add the new entry!
*/
/*
* We need exact matches.
*
* We found a matching path. Either we have a
* duplicate path in a share command or we are
* being asked to replace an existing entry.
*/
if (p) {
} else {
}
sharetab_size -= s->sh_size;
/*
* Get rid of the old node.
*/
return (0);
}
p = s;
}
/*
* Okay, we have gone through the entire hash chain and not
* found a match. We just need to add this node.
*/
return (0);
}
void
sharefs_sharetab_init(void)
{
sharetab_size = 0;
sharetab_count = 0;
sharetab_generation = 1;
}
int
{
int error = 0;
/*
* Before we do anything, lets make sure we have
* a sharetab in memory if we need one.
*/
switch (opcode) {
case (SHAREFS_REMOVE) :
case (SHAREFS_REPLACE) :
if (!sharefs_sharetab) {
}
break;
case (SHAREFS_ADD) :
default :
break;
}
model = get_udatamodel();
/*
* Initialize the data pointers.
*/
}
/*
* Get the share.
*/
/*
* Get some storage for copying in the strings.
*/
/*
* Only grab these two until we know what we want.
*/
switch (opcode) {
case (SHAREFS_ADD) :
case (SHAREFS_REPLACE) :
break;
case (SHAREFS_REMOVE) :
break;
default:
break;
}
/*
* If there is no error, then we have stashed the structure
* away in the sharetab hash table or have deleted it.
*
* Either way, the only reason to blow away the data is if
* there was an error.
*/
if (error != 0) {
}
if (buf) {
}
}
int
{
}