sharefs_vnops.c revision a3175730a459223fb8f26a2915aa0a31f6b36f98
/*
* 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
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/sysmacros.h>
#include <sys/vfs_opreg.h>
/*
* sharefs_snap_create: create a large character buffer with
* the shares enumerated.
*/
static int
{
int iCount = 0;
char *buf;
if (sft->sharefs_snap) {
/*
* Nothing has changed, so no need to grab a new copy!
*/
return (0);
}
}
if (sft->sharefs_size == 0) {
return (0);
}
/*
* Walk the Sharetab, dumping each entry.
*/
int i;
for (i = 0; i < SHARETAB_HASHES; i++) {
int n;
sft->sharefs_size) {
goto error_fault;
}
/*
* Note that sh->sh_size accounts
* for the field seperators.
* We need to add one for the EOL
* marker. And we should note that
* the space is accounted for in
* each share by the EOS marker.
*/
"%s\t%s\t%s\t%s\t%s\n",
goto error_fault;
}
sWritten += n;
iCount++;
}
}
}
/*
* We want to record the generation number and
* mtime inside this snapshot.
*/
return (0);
sft->sharefs_size = 0;
sft->sharefs_count = 0;
return (EFAULT);
}
/* ARGSUSED */
static int
{
/*
* If we get asked about a snapped vnode, then
* we must report the data in that vnode.
*
* Else we report what is currently in the
* sharetab.
*/
if (sft->sharefs_real_vp) {
} else {
}
gethrestime(&now);
return (0);
}
/* ARGSUSED */
static int
{
return (EROFS);
return (0);
}
/* ARGSUSED */
int
{
int error = 0;
return (EINVAL);
/*
* Create a new sharefs vnode for each operation. In order to
* avoid locks, we create a snapshot which can not change during
* reads.
*/
/*
* Hold the parent!
*/
/*
* No need for the lock, no other thread can be accessing
* this data structure.
*/
sft->sharefs_real_vp = 0;
/*
* Since the sharetab could easily change on us whilst we
* are dumping an extremely huge sharetab, we make a copy
* of it here and use it to dump instead.
*/
return (error);
}
/* ARGSUSED */
int
{
if (count > 1)
return (0);
sft->sharefs_size = 0;
sft->sharefs_generation = 0;
}
}
return (0);
}
/* ARGSUSED */
static int
{
int error = 0;
/*
* First check to see if we need to grab a new snapshot.
*/
if (error) {
return (EFAULT);
}
}
/* LINTED */
return (error);
}
return (EFAULT);
}
if (len != 0) {
}
return (error);
}
/* ARGSUSED */
static void
{
if (sft) {
}
}
}
vnode_t *
{
return (vp);
}
const fs_operation_def_t sharefs_tops_data[] = {
{ NULL }
};