cfsd_cache.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 (c) 1994-2001 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Methods of the cfsd_cache class.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <thread.h>
#include <synch.h>
#include <locale.h>
#include "cfsd.h"
#include "cfsd_kmod.h"
#include "cfsd_maptbl.h"
#include "cfsd_logfile.h"
#include "cfsd_fscache.h"
#include "cfsd_cache.h"
/*
* -----------------------------------------------------------------
* cfsd_cache_create
*
* Description:
* Arguments:
* Returns:
* Preconditions:
*/
cfsd_cache_create(void)
{
int xx;
dbug_enter("cfsd_cache_create");
sizeof (cache_object_p->i_cachedir));
cache_object_p->i_refcnt = 0;
cache_object_p->i_cacheid = 0;
cache_object_p->i_fscachecount = 0;
/* initialize the locking mutex */
dbug_assert(xx == 0);
dbug_leave("cfsd_cache_create");
return (cache_object_p);
}
/*
* -----------------------------------------------------------------
* cfsd_cache_destroy
*
* Description:
* Arguments:
* Returns:
* Preconditions:
*/
void
{
int xx;
dbug_enter("cfsd_cache_destroy");
/* get rid of any fscache objects */
while (fscache_object_p != NULL) {
}
/* destroy the locking mutex */
dbug_assert(xx == 0);
dbug_leave("cfsd_cache_destroy");
}
/*
* -----------------------------------------------------------------
* cache_setup
*
* Description:
* Performs setup for the cache.
* Arguments:
* cachedirp
* cacheid
* Returns:
* Preconditions:
* precond(cachedirp)
*/
int
int cacheid)
{
/* XXX either need to prevent multiple calls to this or */
/* clean up here. */
int ret;
dbug_enter("cache_setup");
(*cachedirp != '/')) {
ret = 0;
} else {
sizeof (cache_object_p->i_cachedir));
ret = 1;
}
dbug_leave("cache_setup");
/* return result */
return (ret);
}
/*
* -----------------------------------------------------------------
* cache_lock
*
* Description:
* Arguments:
* Returns:
* Preconditions:
*/
void
{
dbug_enter("cache_lock");
dbug_leave("cache_lock");
}
/*
* -----------------------------------------------------------------
* cache_unlock
*
* Description:
* Arguments:
* Returns:
* Preconditions:
*/
void
{
dbug_enter("cache_unlock");
dbug_leave("cache_unlock");
}
/*
* -----------------------------------------------------------------
* cache_fscachelist_at
*
* Description:
* Arguments:
* index
* Returns:
* Returns ...
* Preconditions:
*/
{
int i = 0;
dbug_enter("cache_fscachelist_at");
/* find the correct cache object */
}
dbug_leave("cache_fscachelist_at");
return (fscache_object_p);
}
/*
* -----------------------------------------------------------------
* cache_fscachelist_add
*
* Description:
* Arguments:
* cachep
* Returns:
* Preconditions:
* precond(fscachep)
*/
void
{
dbug_enter("cache_fscachelist_add");
dbug_leave("cache_fscachelist_add");
}
/*
* -----------------------------------------------------------------
* cache_fscachelist_find
*
* Description:
* Arguments:
* namep
* Returns:
* Returns ...
* Preconditions:
* precond(namep)
*/
const char *namep)
{
dbug_enter("cache_fscachelist_find");
/* see if the fscache exists */
while ((fscache_object_p != NULL) &&
}
dbug_leave("cache_fscachelist_find");
return (fscache_object_p);
}