cfsd_svc.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 1994-2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* RPC service routines.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <string.h> /* strcmp */
#include <signal.h>
#include <unistd.h> /* setsid */
#include <time.h>
#include <memory.h>
#include <stropts.h>
#include <netconfig.h>
#include <thread.h>
#include <synch.h>
#include <common/cachefsd.h>
#include "cfsd.h"
#include "cfsd_kmod.h"
#include "cfsd_maptbl.h"
#include "cfsd_logfile.h"
#include "cfsd_fscache.h"
#include "cfsd_cache.h"
#include "cfsd_all.h"
#include "cfsd_subr.h"
/* declared in cfsd_main.c */
extern cfsd_all_object_t *all_object_p;
/*
* cachefsd_null_1_svc
*
* Description:
* Arguments:
* inp should be NULL
* outp should be NULL
* reqp svc_req info
* Returns:
* Always returns 1, e.g. returns success result.
* Preconditions:
* precond(reqp)
*/
{
dbug_enter("cachefsd_null_1_svc");
dbug_leave("cachefsd_null_1_svc");
return (1);
}
/*
* cachefsd_caches_1_svc
*
* Description:
* Returns list of caches on the system.
* Arguments:
* inp should be NULL
* outp should point to return object
* reqp svc_req info
* Returns:
* Returns 1 for success 0 if an error occurs.
* Preconditions:
* precond(reqp)
*/
cachefsd_caches_1_svc(void *inp,
{
dbug_enter("cachefsd_caches_1_svc");
dbug_leave("cachefsd_caches_1_svc");
return (0);
}
/* if there are any caches */
if (cnt) {
/* allocate space for each cache information */
/* for each cache */
/* get the cache */
/* get the cache id and name */
}
}
/* fill in the return object */
dbug_leave("cachefsd_caches_1_svc");
return (1);
}
/*
* cachefsd_cache_status_1_svc
*
* Description:
* Returns status about a particular cache.
* Arguments:
* inp should be ptr to cache id
* outp should be ptr to place to put cache status
* reqp svc_req info
* Returns:
* Returns 1 for success 0 if an error occurs.
* Preconditions:
* precond(reqp)
*/
{
int xx;
dbug_enter("cachefsd_cache_status_1_svc");
dbug_leave("cachefsd_cache_status_1_svc");
return (0);
}
/* find the requested cache */
/* get the cache */
/* if a match */
break;
}
}
/* if no match */
dbug_leave("cachefsd_cache_status_1_svc");
return (1);
}
/* find a mounted file system in the cache */
/* get the fscache */
/* mounted */
if (fscache_object_p->i_mounted) {
break;
}
}
outp->ccs_lrusize = 0;
outp->ccs_packsize = 0;
outp->ccs_freesize = 0;
outp->ccs_lrutime = 0;
if (fscache_object_p) {
if (xx != 0) {
dbug_print(("err",
"setup of kmod interface failed %d", xx));
} else {
}
}
dbug_leave("cachefsd_cache_status_1_svc");
return (1);
}
/*
* cachefsd_mounts_1_svc
*
* Description:
* Returns the list of file systems that are in the cache.
* Arguments:
* inp should be ptr to cache id
* outp should be ptr to place to put mounts
* reqp svc_req info
* Returns:
* Returns 1 for success 0 if an internal error occurs.
* Preconditions:
* precond(reqp)
*/
{
dbug_enter("cachefsd_mounts_1_svc");
dbug_leave("cachefsd_mounts_1_svc");
return (0);
}
/* find the requested cache */
/* get the cache */
/* if a match */
break;
}
}
/* if no match was found */
dbug_leave("cachefsd_mounts_1_svc");
return (1);
}
/* if there are any fscaches */
if (cnt) {
/* allocate space for each fscache information */
/* for each fscache */
/* get the fscache */
/* get the fscache id and name */
}
}
/* fill in the return object */
dbug_leave("cachefsd_mounts_1_svc");
return (1);
}
/*
* cachefsd_mount_stat_1_svc
*
* Description:
* Returns status information about a single file system
* in the cache.
* Arguments:
* inp should be which file system to get info for
* outp should be place to put mount info
* reqp svc_req info
* Returns:
* Returns 1 for success 0 if an error occurs.
* Preconditions:
* precond(reqp)
*/
{
char namebuf[MAXPATHLEN];
dbug_enter("cachefsd_mount_stat_1_svc");
dbug_leave("cachefsd_mount_stat_1_svc");
return (0);
}
/* find the requested cache */
/* get the cache */
/* if a match */
break;
}
}
/* if no match was found */
dbug_leave("cachefsd_mount_stat_1_svc");
return (1);
}
/* find the requested fscache */
/* get the fscache */
/* if a match */
break;
}
}
/* if no match was found */
dbug_leave("cachefsd_mount_stat_1_svc");
return (1);
}
/* see if there are changes to roll to the server */
if ((fscache_object_p->i_connected == 0) &&
(fscache_object_p->i_changes == 0)) {
}
}
/* fill in the return object */
dbug_leave("cachefsd_mount_stat_1_svc");
return (1);
}
/*
* cachefsd_fs_mounted_1_svc
*
* Description:
* Sent by the mount command to indicate a new file system
* has been mounted
* Arguments:
* inp ptr to mount information
* outp should be null
* reqp svc_req info
* Returns:
* Returns 1 for success 0 if an internal error occurs.
* Preconditions:
* precond(inp)
*/
{
int error = 0;
dbug_enter("cachefsd_fs_mounted_1_svc");
dbug_leave("cachefsd_fs_mounted_1_svc");
return (0);
}
error = 1;
}
error = 1;
}
if (error == 0) {
}
dbug_leave("cachefsd_fs_mounted_1_svc");
return (1);
}
/*
* cachefsd_fs_unmounted_1_svc
*
* Description:
* Arguments:
* inp
* outp
* reqp
* Returns:
* Returns 1 for success 0 if an internal error occurs.
* Preconditions:
* precond(inp)
* precond(outp == NULL)
* precond(reqp)
*/
{
int found = 0;
int flag = 0;
dbug_enter("cachefsd_fs_unmounted_1_svc");
dbug_leave("cachefsd_fs_unmounted_1_svc");
return (0);
}
dbug_leave("cachefsd_fs_unmounted_1_svc");
return (1);
}
/* for each cache */
/* get the cache */
/* for each file system in this cache */
/* get the fscache */
/* skip if not mounted */
if (fscache_object_p->i_mounted == 0)
continue;
/* if a match */
found = 1;
break;
}
}
if (found)
break;
}
/* if no match */
if (fscache_object_p == NULL) {
} else {
}
dbug_leave("cachefsd_fs_unmounted_1_svc");
return (1);
}
/*
* cachefsd_disconnection_1_svc
*
* Description:
* Arguments:
* inp
* outp
* reqp
* Returns:
* Returns 1 for success 0 if an internal error occurs.
* Preconditions:
* precond(inp)
* precond(outp)
* precond(reqp)
*/
{
int found = 0;
dbug_enter("cachefsd_disconnection_1_svc");
dbug_leave("cachefsd_disconnection_1_svc");
return (0);
}
/* for each cache */
/* get the cache */
/* for each file system in this cache */
/* get the fscache */
/* if a match */
== 0) {
found = 1;
break;
}
}
if (found)
break;
}
/* if no match */
if (fscache_object_p == NULL) {
*outp = 3;
} else {
}
dbug_leave("cachefsd_disconnection_1_svc");
return (1);
}
/*
* cachefsdprog_1_freeresult
*
* Description:
* Arguments:
* transp
* xdr_result
* resultp
* Returns:
* Returns ...
* Preconditions:
* precond(transp)
*/
int
{
dbug_enter("cachefsdprog_1_freeresult");
dbug_leave("cachefsdprog_1_freeresult");
return (1);
}