cachefs_fscache.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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_FS_CACHEFS_FSCACHE_H
#define _SYS_FS_CACHEFS_FSCACHE_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#define CFS_FS_MAXIDLE 100
enum cachefs_connected {
CFS_CD_DISCONNECTED, /* disconnected from back fs */
CFS_CD_RECONNECTING /* rolling log to back fs */
};
typedef struct cachefs_stats {
/* file system persistant state */
struct cachefs_fsinfo {
int fi_popsize; /* cache population size */
int fi_fgsize; /* filegrp size, default 256 */
};
typedef struct cachefs_fsinfo cachefs_fsinfo_t;
/*
* used to translate the server's idea of inode numbers into the
* client's idea, after a reconnect, in a directory entry a la
* readdir()
*/
typedef struct cachefs_inum_trans {
extern int cachefs_hash_sizes[];
/*
* fscache structure contains per-filesystem information, both filesystem
* cache directory information and mount-specific information.
*/
struct fscache {
int fs_flags;
int fs_ref; /* ref count on fscache */
int fs_cnodecnt; /* cnt of cnodes on fscache */
int fs_consttype; /* type of consistency check */
int fs_idlecnt; /* number of idle cnodes */
int fs_idleclean; /* cleaning idle list */
/* related to connected or disconnected (cd) */
int fs_cdtransition; /* 1 transitioning, 0 not */
int fs_cdrefcnt; /* # threads in cachefs */
int fs_inum_size; /* # fs_inum_trans alloced */
/* list of fgps */
int fs_kstat_id;
char *fs_mntpt;
char *fs_hostname;
char *fs_backfsname;
};
extern struct kmem_cache *cachefs_fscache_cache;
/* valid fscache flags */
/* types of consistency checking */
#define CFS_ISFS_SNR(FSCP) \
#define CFS_ISFS_SOFT(FSCP) \
#define CFS_ISFS_WRITE_AROUND(FSCP) \
#define CFS_ISFS_NONSHARED(FSCP) \
#define CFS_ISFS_STRICT(FSCP) \
(CFS_NOCONST_MODE | CFS_CODCONST_MODE)) == 0))
#define CFS_ISFS_NOCONST(FSCP) \
#define CFS_ISFS_CODCONST(FSCP) \
#define CFS_ISFS_LLOCK(FSCP) \
#define CFS_ISFS_BACKFS_NFSV4(FSCP) \
#ifdef __cplusplus
}
#endif
#endif /* _SYS_FS_CACHEFS_FSCACHE_H */