smbfs_client.c revision 4bff34e37def8a90f9194d81bc345c52ba20086a
/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Copyright (c) 1983,1984,1985,1986,1987,1988,1989 AT&T.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/sysmacros.h>
#include <netsmb/smb_conn.h>
#include <smbfs/smbfs_node.h>
#include <smbfs/smbfs_subr.h>
/*
* The following code provide zone support in order to perform an action
* for each smbfs mount in a zone. This is also where we would add
* per-zone globals and kernel threads for the smbfs module (since
* they must be terminated by the shutdown callback).
*/
struct smi_globals {
};
typedef struct smi_globals smi_globals_t;
static zone_key_t smi_list_key;
/* ARGSUSED */
static void *
{
return (smg);
}
/*
* Callback routine to tell all SMBFS mounts in the zone to stop creating new
* threads. Existing threads should exit.
*/
/* ARGSUSED */
static void
{
/*
* If we've done the shutdown work for this FS, skip.
* Once we go off the end of the list, we're done.
*/
continue;
/*
* We will do work, so not done. Get a hold on the FS.
*/
/*
* purge the DNLC for this filesystem
*/
/*
* Drop lock and release FS, which may change list, then repeat.
* We're done when every mi has been done or the list is empty.
*/
goto again;
}
}
static void
{
}
/* ARGSUSED */
static void
{
/* Still waiting for VFS_FREEVFS() */
return;
}
}
/*
* Add an SMBFS mount to the per-zone list of SMBFS mounts.
*/
void
{
}
/*
* Remove an SMBFS mount from the per-zone list of SMBFS mounts.
*/
void
{
/*
* We can be called asynchronously by VFS_FREEVFS() after the zone
* smi_globals.
*/
return;
}
}
#ifdef NEED_SMBFS_CALLBACKS
/*
* Call-back hooks for netsmb, in case we want them.
* Apple's VFS wants them. We may not need them.
*
* I thought I could use the "dead" callback from netsmb
* to set the SMI_DEAD flag, but that looks like it will
* interfere with the zone shutdown mechanisms.
*/
{
#if 0 /* see above */
if (smi) {
}
#endif
}
{
/* no-op */
}
{
/* no-op */
}
smb_fscb_t smbfs_cb = {
.fscb_dead = smbfs_dead,
.fscb_down = smbfs_down,
#endif /* NEED_SMBFS_CALLBACKS */
/*
* SMBFS Client initialization routine. This routine should only be called
* once. It performs the following tasks:
* - Initalize all global locks
* - Call sub-initialization routines (localize access to variables)
*/
int
smbfs_clntinit(void)
{
int error;
error = smbfs_subrinit();
if (error)
return (error);
#ifdef NEED_SMBFS_CALLBACKS
#endif /* NEED_SMBFS_CALLBACKS */
return (0);
}
/*
* This routine is called when the modunload is called. This will cleanup
* the previously allocated/initialized nodes.
*/
void
smbfs_clntfini(void)
{
#ifdef NEED_SMBFS_CALLBACKS
#endif /* NEED_SMBFS_CALLBACKS */
(void) zone_key_delete(smi_list_key);
}