/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_FS_TMPNODE_H
#define _SYS_FS_TMPNODE_H
#include <sys/vfs_opreg.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* tmpnode is the file system dependent node for tmpfs.
*
* tn_rwlock protects access of the directory list at tn_dir
* as well as syncronizing read and writes to the tmpnode
*
* tn_contents protects growing, shrinking, reading and writing
* the file along with tn_rwlock (see below).
*
* tn_tlock protects updates to tn_mode and tn_nlink
*
* tm_contents in the tmount filesystem data structure protects
* tn_forw and tn_back which are used to maintain a linked
* list of all tmpfs files associated with that file system
*
* The anon array represents the secondary store for tmpfs.
* To grow or shrink the file or fill in holes requires
* manipulation of the anon array. These operations are protected
* by a combination of tn_rwlock and tn_contents. Growing or shrinking
* the array requires the write lock on tn_rwlock and tn_contents.
* Filling in a slot in the array requires the write lock on tn_contents.
* Reading the array requires the read lock on tn_contents.
*
* The ordering of the locking is:
* tn_rwlock -> tn_contents -> page locks on pages in file
*
* tn_tlock doesn't require any tmpnode locks
*/
struct tmpnode {
union {
struct {
} un_dirstruct;
struct {
} un_tmpnode;
/* mods and directory updates */
};
/*
* tmnode flag values.
*/
/*
* Attributes
*/
/*
* tmpfs directories are made up of a linked list of tdirent structures
* hanging off directory tmpnodes. File names are not fixed length,
* but are null terminated.
*/
struct tdirent {
/* max length is MAXNAMELEN */
};
/*
* tfid overlays the fid structure (for VFS_VGET)
*/
struct tfid {
};
extern struct vnodeops *tmp_vnodeops;
extern const struct fs_operation_def tmp_vnodeops_template[];
#ifdef __cplusplus
}
#endif
#endif /* _SYS_FS_TMPNODE_H */