cfsd_kmod.cc 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
*/
// ------------------------------------------------------------
//
// cfsd_kmod.cc
//
// Source file for the cfsd_kmod class.
//
#pragma ident "%Z%%M% %I% %E% SMI"
// Copyright 2004 Sun Microsystems, Inc. All rights reserved.
// Use is subject to license terms.
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include "cfsd_kmod.h"
// -----------------------------------------------------------------
//
// cfsd_kmod::cfsd_kmod
//
// Description:
// Arguments:
// Returns:
// Preconditions:
{
dbug_enter("cfsd_kmod::cfsd_kmod");
i_fd = -1;
}
// -----------------------------------------------------------------
//
// cfsd_kmod::~cfsd_kmod
//
// Description:
// Arguments:
// Returns:
// Preconditions:
{
dbug_enter("cfsd_kmod::~cfsd_kmod");
// clean up old stuff
}
// -----------------------------------------------------------------
//
// cfsd_kmod::kmod_setup
//
// Description:
// Arguments:
// path
// Returns:
// Returns ...
// Preconditions:
// precond(path)
int
{
dbug_enter("cfsd_kmod::kmod_setup");
// clean up old stuff
// try to open the file
// return result
int xx;
int error;
if (i_fd == -1) {
} else {
xx = 0;
// tell the cachefs kmod we are here
if (xx) {
}
}
return (xx);
}
//
// kmod_shutdown
//
// Description:
// Arguments:
// Returns:
// Preconditions:
void
{
dbug_enter("kmod_shutdown");
// close down the old fd if necessary
if (i_fd >= 0)
i_fd = -1;
}
// -----------------------------------------------------------------
//
// cfsd_kmod::kmod_xwait
//
// Description:
// Arguments:
// Returns:
// Returns ...
// Preconditions:
int
{
dbug_enter("cfsd_kmod::kmod_xwait");
int xx;
int error = 0;
if (xx)
return (error);
}
// -----------------------------------------------------------------
//
// cfsd_kmod::kmod_stateget
//
// Description:
// Arguments:
// Returns:
// Returns ...
// Preconditions:
int
{
dbug_enter("cfsd_kmod::kmod_stateget");
int state;
int xx;
int error = 0;
if (xx == -1) {
// XXX do what?
dbug_assert(0);
}
return (state);
}
// -----------------------------------------------------------------
//
// cfsd_kmod::kmod_stateset
//
// Description:
// Arguments:
// state
// Returns:
// Returns ...
// Preconditions:
int
{
dbug_enter("cfsd_kmod::kmod_stateset");
int xx;
int error = 0;
if (xx)
return (error);
}
// -----------------------------------------------------------------
//
// cfsd_kmod::kmod_exists
//
// Description:
// Arguments:
// cidp
// Returns:
// Returns ...
// Preconditions:
// precond(cidp)
int
{
dbug_enter("cfsd_kmod::kmod_exists");
int xx;
int error = 0;
if (xx)
return (error);
}
// -----------------------------------------------------------------
//
// cfsd_kmod::kmod_lostfound
//
// Description:
// Arguments:
// cidp
// Returns:
// Returns ...
// Preconditions:
// precond(cidp)
int
{
dbug_enter("cfsd_kmod::kmod_lostfound");
int error = 0;
int xx;
if (xx)
if (xx == 0) {
if (newnamep)
}
return (error);
}
// -----------------------------------------------------------------
//
// cfsd_kmod::kmod_lostfoundall
//
// Description:
// Arguments:
// Returns:
// Returns ...
// Preconditions:
int
{
dbug_enter("cfsd_kmod::kmod_lostfoundall");
int error = 0;
int xx = -1;
// xx = ioctl(i_fd, CACHEFSIO_LOSTFOUNDALL, 0);
if (xx)
return (error);
}
//
// cfsd_kmod::kmod_rofs
//
// Description:
// Arguments:
// Returns:
// Returns ...
// Preconditions:
int
{
dbug_enter("cfsd_kmod::kmod_rofs");
int error = 0;
int xx = -1;
// xx = ioctl(i_fd, CACHEFSIO_ROFS, 0);
if (xx)
return (error);
}
//
// cfsd_kmod::kmod_rootfid
//
// Description:
// Fills in fidp with the fid of the root of the file system.
// Arguments:
// fidp
// Returns:
// Returns 0 for success, errno value for an error
// Preconditions:
// precond(fidp)
int
{
dbug_enter("cfsd_kmod::kmod_rootfid");
int error = 0;
int xx;
if (xx)
return (error);
}
//
// cfsd_kmod::kmod_getstats
//
// Description:
// Arguments:
// gsp
// Returns:
// Returns ...
// Preconditions:
// precond(gsp)
int
{
dbug_enter("cfsd_kmod::kmod_getstats");
int error = 0;
int xx;
if (xx)
return (error);
}
// -----------------------------------------------------------------
//
// cfsd_kmod::kmod_getinfo
//
// Description:
// Arguments:
// filep
// Returns:
// Returns ...
// Preconditions:
// precond(filep)
// precond(infop)
int
{
dbug_enter("cfsd_kmod::kmod_getinfo");
int error = 0;
int xx;
if (xx)
if (xx == 0) {
}
return (error);
}
// -----------------------------------------------------------------
//
// cfsd_kmod::kmod_cidtofid
//
// Description:
// Arguments:
// cidp
// fidp
// Returns:
// Returns ...
// Preconditions:
// precond(cidp)
// precond(fidp)
int
{
dbug_enter("cfsd_kmod::kmod_cidtofid");
int error = 0;
int xx;
if (xx)
if (xx == 0) {
}
return (error);
}
// -----------------------------------------------------------------
//
// cfsd_kmod::kmod_getattrfid
//
// Description:
// Arguments:
// fidp
// credp
// vattrp
// Returns:
// Returns ...
// Preconditions:
// precond(fidp)
// precond(credp)
// precond(vattrp)
int
{
dbug_enter("cfsd_kmod::kmod_getattrfid");
int error = 0;
int xx;
if (xx)
if (xx == 0) {
}
return (error);
}
// -----------------------------------------------------------------
//
// cfsd_kmod::kmod_getattrname
//
// Description:
// Arguments:
// dirp
// name
// credp
// vattrp
// filep
// Returns:
// Returns ...
// Preconditions:
// precond(dirp)
// precond(name)
// precond(credp)
int
{
dbug_enter("cfsd_kmod::kmod_getattrname");
int error = 0;
int xx;
if (xx)
if (xx == 0) {
if (vattrp)
if (filep)
}
return (error);
}
// -----------------------------------------------------------------
//
// cfsd_kmod::kmod_create
//
// Description:
// Arguments:
// dirp
// namep
// vattrp
// exclusive
// mode
// credp
// newfidp
// mtimep
// ctimep
// Returns:
// Returns ...
// Preconditions:
// precond(dirp)
// precond(namep)
// precond(vattrp)
// precond(credp)
int
{
dbug_enter("cfsd_kmod::kmod_create");
if (cidp)
else {
}
int error = 0;
int xx;
if (xx)
if (xx == 0) {
if (newfidp)
if (ctimep)
if (mtimep)
}
return (error);
}
// -----------------------------------------------------------------
//
// cfsd_kmod::kmod_pushback
//
// Description:
// Arguments:
// filep
// fidp
// credp
// Returns:
// Returns ...
// Preconditions:
// precond(filep)
// precond(fidp)
// precond(credp)
int
{
dbug_enter("cfsd_kmod::kmod_pushback");
// note: update is no longer used
int error = 0;
int xx;
if (xx)
if (xx == 0) {
if (ctimep)
if (mtimep)
}
return (error);
}
// -----------------------------------------------------------------
//
// cfsd_kmod::kmod_rename
//
// Description:
// Arguments:
// olddir
// oldname
// newdir
// newname
// credp
// Returns:
// Returns ...
// Preconditions:
// precond(olddir)
// precond(oldname)
// precond(newdir)
// precond(newname)
// precond(credp)
int
{
dbug_enter("cfsd_kmod::kmod_rename");
int error = 0;
int xx;
if (xx)
if (xx == 0) {
if (delctimep) {
}
}
return (error);
}
// -----------------------------------------------------------------
//
// cfsd_kmod::kmod_setattr
//
// Description:
// Arguments:
// fidp
// vattrp
// flags
// credp
// Returns:
// Returns ...
// Preconditions:
// precond(fidp)
// precond(vattrp)
// precond(credp)
int
{
dbug_enter("cfsd_kmod::kmod_setattr");
int error = 0;
int xx;
if (xx)
if (xx == 0) {
}
return (error);
}
// -----------------------------------------------------------------
//
// cfsd_kmod::kmod_setsecattr
//
// Description:
// Arguments:
// fidp
// aclcnt
// dfaclcnt
// acl
// flags
// credp
// Returns:
// Returns ...
// Preconditions:
// precond(fidp)
// precond(acl)
// precond(credp)
// precond(aclcnt + dfaclcnt <= MAX_ACL_ENTRIES)
{
dbug_enter("cfsd_kmod::kmod_setsecattr");
int error = 0;
int xx;
if (xx)
if (xx == 0) {
}
return (error);
}
// -----------------------------------------------------------------
//
// cfsd_kmod::kmod_remove
//
// Description:
// Arguments:
// fidp
// namep
// credp
// ctimep
// Returns:
// Returns ...
// Preconditions:
// precond(fidp)
// precond(namep)
// precond(credp)
int
{
dbug_enter("cfsd_kmod::kmod_remove");
if (ctimep)
else
len = 0;
int error = 0;
int xx;
if (xx)
}
return (error);
}
// -----------------------------------------------------------------
//
// cfsd_kmod::kmod_link
//
// Description:
// Arguments:
// dirfidp
// namep
// filefidp
// credp
// ctimep
// Returns:
// Returns ...
// Preconditions:
// precond(dirfidp)
// precond(namep)
// precond(filefidp)
// precond(credp)
int
{
dbug_enter("cfsd_kmod::kmod_link");
int error = 0;
int xx;
if (xx)
if (xx == 0) {
}
return (error);
}
// -----------------------------------------------------------------
//
// cfsd_kmod::kmod_mkdir
//
// Description:
// Arguments:
// dirfidp
// namep
// vattrp
// credp
// newfidp
// Returns:
// Returns ...
// Preconditions:
// precond(dirfidp)
// precond(namep)
// precond(vattrp)
// precond(credp)
// precond(newfidp)
int
{
dbug_enter("cfsd_kmod::kmod_mkdir");
int error = 0;
int xx;
if (xx)
if (xx == 0) {
}
return (error);
}
// -----------------------------------------------------------------
//
// cfsd_kmod::kmod_rmdir
//
// Description:
// Arguments:
// dirfidp
// namep
// credp
// Returns:
// Returns ...
// Preconditions:
// precond(dirfidp)
// precond(namep)
// precond(credp)
int
{
dbug_enter("cfsd_kmod::kmod_rmdir");
int error = 0;
int xx;
if (xx)
return (error);
}
// -----------------------------------------------------------------
//
// cfsd_kmod::kmod_symlink
//
// Description:
// Arguments:
// dirfidp
// namep
// linkvalp
// vattrp
// credp
// ctimep
// mtimep
// Returns:
// Returns ...
// Preconditions:
// precond(dirfidp)
// precond(namep)
// precond(linkvalp)
// precond(vattrp)
// precond(credp)
// precond(ctimep)
// precond(mtimep)
int
{
dbug_enter("cfsd_kmod::kmod_symlink");
int error = 0;
int xx;
if (xx)
if (xx == 0) {
}
return (error);
}
// -----------------------------------------------------------------
//
// cfsd_kmod::i_format_fid
//
// Description:
// Arguments:
// fidp
// Returns:
// Preconditions:
// precond(fidp)
void
{
int index;
char format[10];
i_fidbuf[0] = '\0';
}
}
// -----------------------------------------------------------------
//
// cfsd_kmod::i_print_cred
//
// Description:
// Arguments:
// credp
// Returns:
// Preconditions:
// precond(credp)
void
{
dbug_enter("cfsd_kmod::i_print_cred");
char buf[100];
buf[0] = '\0';
char format[10];
int xx;
}
}
// -----------------------------------------------------------------
//
// cfsd_kmod::i_print_attr
//
// Description:
// Arguments:
// vattrp
// Returns:
// Preconditions:
// precond(vattrp)
void
{
dbug_enter("cfsd_kmod::i_print_attr");
}
//
// cfsd_kmod::i_doioctl
//
// Description:
// Helper routine for others in this file. Just packages up
// arguments and does the ioctl operation.
// Arguments:
// cmd
// sdata
// slen
// rdata
// rlen
// Returns:
// Returns the result of the ioctl operation.
// Preconditions:
int
{
return (xx);
}