iscsi_utils.c revision fcf3ce441efd61da9bb2884968af01cb7c1452cc
/*
* 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.
*/
#include "iscsi.h"
#include <iscsi_if.h>
/*
* Very specific set of file type function calls which are ONLY used by the
* iSCSI driver.
*/
#define ISCSID_GETF 16
static kmutex_t iscsid_getf_lock;
/*
* util_locks_init -- initialize what ever locks local file will use
*/
/* ARGSUSED */
{
return (B_TRUE);
}
/*
* iscsid_getf -- given a file descriptor returns a file pointer
*/
static file_t *
iscsid_getf(int fdes)
{
}
return (fp);
}
/*
* iscsid_releasef -- release lock on file pointer
*/
static void
iscsid_releasef(int fdes)
{
}
}
/*
* iscsid_setf -- stores the file pointer in an empty slot returning index
*/
static int
{
int i = -1;
for (i = 0; i < ISCSID_GETF; i++) {
if (iscsid_fd[i] == 0) {
break;
}
}
return (i);
}
int iscsid_errno;
/*
* iscsid_freef -- gets the file pointer based on index and releases memory.
*/
static void
iscsid_freef(int fdes)
{
}
}
/*
* iscsid_open -- acts like syscall open, but works for kernel
*
* Note: This works for regular files only. No umask is provided to
* vn_open which means whatever mode is passed in will be used to
* create a file.
*/
int
{
int fdes = -1,
/*
* Need to convert from user mode flags to file system flags.
* It's unfortunate that the kernel doesn't define a mask for
* counterparts. If one was provided something like
* fflags = ((flags & mask) + 1) | (flags & ~mask)
* would work. But, that would only be true if the relationship
* be O_XXX and FXXX was defined and it's not. So we have the
* following.
*/
else
/*
* look at the other flags and OR them in.
*/
return (-1);
}
return (-1);
}
/* ---- falloc returns with f_tlock held on success ---- */
}
return (fdes);
}
/*
* iscsid_close -- closes down the file by releasing locks and memory.
*/
int
iscsid_close(int fdes)
{
return (-1);
/*
* unfalloc which is called from here will do a mutex_exit
* on t_lock in the fp. So don't call iscsid_releasef() here.
*/
return (0);
}
/*
* iscsid_remove -- remove file from filesystem
*/
int
iscsid_remove(char *filename)
{
}
/*
* iscsid_rename -- rename file from one name to another
*/
int
{
}
/*
*/
static ssize_t
{
return (-1);
return (-1);
}
}
/*
* iscsid_write -- kernel write function
*/
{
}
/*
* iscsid_read -- kernel read function
*/
{
}
/*
* iscsid_sendto -- kernel callable sendto function
*/
{
int error;
return (-1);
}
auio.uio_loffset = 0;
if (error != 0)
return (-1);
}
/*
* iscsid_recvfrom -- kernel callable recvfrom routine
*/
{
int error;
auio.uio_loffset = 0;
lmsg.msg_namelen = 0;
lmsg.msg_controllen = 0;
if (error) {
return (-1);
}
}
/*
* iscsi_discovery_event -- send event associated with discovery operations
*
* Each discovery event has a start and end event. Which is sent is based
* on the boolean argument start with the obvious results.
*/
void
{
switch (m) {
else {
}
break;
else {
}
break;
case iSCSIDiscoveryMethodSLP:
else {
}
break;
case iSCSIDiscoveryMethodISNS:
else {
}
break;
}
}
/*
* iscsi_send_sysevent -- send sysevent using iscsi class
*/
void
{
}