fhtab.h 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) 1999 by Sun Microsystems, Inc.
* All rights reserved.
*/
#ifndef _FHTAB_H
#define _FHTAB_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Support for the fh mapping file for nfslog.
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* RPC dispatch table for file handles
* Indexed by program, version, proc
* Based on NFS dispatch table.
*/
struct nfsl_fh_proc_disp {
void (*nfsl_dis_args)(); /* dispatch routine for proc */
int args_size; /* size of arguments struct */
int res_size; /* size of results struct */
};
struct nfsl_fh_vers_disp {
int nfsl_dis_nprocs; /* number of procs */
};
struct nfsl_fh_prog_disp {
int nfsl_dis_prog; /* program number */
int nfsl_dis_versmin; /* minimum version number */
int nfsl_dis_nvers; /* number of version values */
};
#define PRIMARY_KEY_LEN_MAX 16
typedef char fh_primary_key[PRIMARY_KEY_LEN_MAX];
/* link key - directory primary key plus name (upto 2 components) */
typedef char fh_secondary_key[SECONDARY_KEY_LEN_MAX];
/*
* This is the runtime filehandle table entry. Because an fhandle_t is
* used for both Version 2 and Version 3, we don't need two different types
* of entries in the table.
*/
typedef struct fhlist_ent {
short reclen; /* length of record */
} fhlist_ent;
/* flags values */
/*
* Information maintained for the secondary key
* Note that this is a variable length record with 4 variable size fields:
* fhkey - primary key (must be there)
* name - component name (must be there)
* next - next link in list (could be null)
* prev - previous link in list (could be null)
*/
typedef struct linkinfo_ent {
short reclen; /* Actual record length */
short fhkey_offset; /* offset of fhkey, from head of record */
short name_offset; /* offset of name */
short next_offset; /* offset of next link key */
short prev_offset; /* offset of prev link key */
} linkinfo_ent;
/* Macros for lengths of the various fields */
/* Macros for address of the various fields */
/* Which record can reside in database */
typedef union {
} db_record;
int *errorp);
/*
* Macro to determine which fhandle to use - input or public fh
*/
#define NFSLOG_GET_FHANDLE2(fh) \
/*
* Macro to determine which fhandle to use - input or public fh
*/
#define NFSLOG_GET_FHANDLE3(fh3) \
#ifdef __cplusplus
}
#endif
#endif /* _FHTAB_H */