vfs.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 1988 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* File system identifier. Should be unique (at least per machine).
*/
#ifndef _sys_vfs_h
#define _sys_vfs_h
typedef struct {
} fsid_t;
/*
* File identifier. Should be unique per filesystem on a single machine.
*/
#define MAXFIDSZ 16
struct fid {
};
/*
* Structure per mounted file system.
* Each mounted file system has an array of
* operations and an instance record.
* The file systems are put on a singly linked list.
* If vfs_stats is non-NULL statistics are gathered, see vfs_stat.h
*/
struct vfs {
int vfs_flag; /* flags */
int vfs_bsize; /* native block size */
};
/*
* vfs flags.
* VFS_MLOCK lock the vfs so that name lookup cannot proceed past the vfs.
* This keeps the subtree stable during mounts and unmounts.
*/
/*
* Operations supported on virtual file system.
*/
struct vfsops {
int (*vfs_mount)(); /* mount file system */
int (*vfs_unmount)(); /* unmount file system */
int (*vfs_root)(); /* get root vnode */
int (*vfs_statfs)(); /* get fs statistics */
int (*vfs_sync)(); /* flush fs buffers */
int (*vfs_vget)(); /* get vnode from fid */
int (*vfs_mountroot)(); /* mount the root filesystem */
int (*vfs_swapvp)(); /* return vnode for swap */
};
/*
* file system statistics
*/
struct statfs {
long f_type; /* type of info, zero for now */
long f_bsize; /* fundamental file system block size */
long f_blocks; /* total blocks in file system */
long f_bfree; /* free block in fs */
long f_bavail; /* free blocks avail to non-superuser */
long f_files; /* total file nodes in file system */
long f_ffree; /* free file nodes in fs */
};
#ifdef KERNEL
/*
* Filesystem type switch table
*/
struct vfssw {
char *vsw_name; /* type name string */
};
/*
* public operations
*/
extern void vfs_mountroot(); /* mount the root */
extern int vfs_add(); /* add a new vfs to mounted vfs list */
extern void vfs_remove(); /* remove a vfs from mounted vfs list */
extern int vfs_lock(); /* lock a vfs */
extern void vfs_unlock(); /* unlock a vfs */
extern int vfs_getmajor(); /* get major device # for an fs type */
extern void vfs_putmajor(); /* free major device # for an fs type */
extern int vfs_getnum(); /* get device # for an fs type */
extern void vfs_putnum(); /* release device # for an fs type */
}
/*
* globals
*/
#endif
#endif /*!_sys_vfs_h*/