📄 mount.h
字号:
{ MOUNT_MFS, CTLTYPE_NODE }, \ { MOUNT_MSDOS, CTLTYPE_NODE }, \ { MOUNT_LFS, CTLTYPE_NODE }, \ { 0, 0 }, /* MOUNT_LOFS */ \ { MOUNT_FDESC, CTLTYPE_NODE }, \ { MOUNT_PORTAL, CTLTYPE_NODE }, \ { MOUNT_NULL, CTLTYPE_NODE }, \ { MOUNT_UMAP, CTLTYPE_NODE }, \ { MOUNT_KERNFS, CTLTYPE_NODE }, \ { MOUNT_PROCFS, CTLTYPE_NODE }, \ { MOUNT_AFS, CTLTYPE_NODE }, \ { MOUNT_CD9660, CTLTYPE_NODE }, \ { MOUNT_UNION, CTLTYPE_NODE }, \ { MOUNT_ADOSFS, CTLTYPE_NODE }, \ { MOUNT_EXT2FS, CTLTYPE_NODE }, \ { MOUNT_CODA, CTLTYPE_NODE }, \ { MOUNT_FILECORE, CTLTYPE_NODE }, \ { MOUNT_NTFS, CTLTYPE_NODE }, \}#define VFS_MAXID 20 /* number of valid vfs ids */#define CTL_VFSGENCTL_NAMES { \ { 0, 0 }, \ { "maxtypenum", CTLTYPE_INT }, \ { "conf", CTLTYPE_NODE }, /* Special */ \ { "usermount", CTLTYPE_INT }, \}/* * Operations supported on mounted file system. */#ifdef _KERNEL#if defined(COMPAT_09) || defined(COMPAT_43) || defined(COMPAT_44)/* * Filesystem configuration information. Not used by NetBSD, but * defined here to provide a compatible sysctl interface to Lite2. */struct vfsconf { struct vfsops *vfc_vfsops; /* filesystem operations vector */ char vfc_name[MFSNAMELEN]; /* filesystem type name */ int vfc_typenum; /* historic filesystem type number */ int vfc_refcount; /* number mounted of this type */ int vfc_flags; /* permanent flags */ int (*vfc_mountroot)(void); /* if != NULL, routine to mount root */ struct vfsconf *vfc_next; /* next in list */};#endif#ifdef __STDC__struct nameidata;struct mbuf;struct vnodeopv_desc;#endifstruct vfsops { const char *vfs_name; int (*vfs_mount) __P((struct mount *mp, const char *path, void *data, struct nameidata *ndp, struct proc *p)); int (*vfs_start) __P((struct mount *mp, int flags, struct proc *p)); int (*vfs_unmount) __P((struct mount *mp, int mntflags, struct proc *p)); int (*vfs_root) __P((struct mount *mp, struct vnode **vpp)); int (*vfs_quotactl) __P((struct mount *mp, int cmds, uid_t uid, caddr_t arg, struct proc *p)); int (*vfs_statfs) __P((struct mount *mp, struct statfs *sbp, struct proc *p)); int (*vfs_sync) __P((struct mount *mp, int waitfor, struct ucred *cred, struct proc *p)); int (*vfs_vget) __P((struct mount *mp, ino_t ino, struct vnode **vpp)); int (*vfs_fhtovp) __P((struct mount *mp, struct fid *fhp, struct vnode **vpp)); int (*vfs_vptofh) __P((struct vnode *vp, struct fid *fhp)); void (*vfs_init) __P((void)); void (*vfs_done) __P((void)); int (*vfs_sysctl) __P((int *, u_int, void *, size_t *, void *, size_t, struct proc *)); int (*vfs_mountroot) __P((void)); int (*vfs_checkexp) __P((struct mount *mp, struct mbuf *nam, int *extflagsp, struct ucred **credanonp)); struct vnodeopv_desc **vfs_opv_descs; int vfs_refcount; LIST_ENTRY(vfsops) vfs_list;};#define VFS_MOUNT(MP, PATH, DATA, NDP, P) \ (*(MP)->mnt_op->vfs_mount)(MP, PATH, DATA, NDP, P)#define VFS_START(MP, FLAGS, P) (*(MP)->mnt_op->vfs_start)(MP, FLAGS, P)#define VFS_UNMOUNT(MP, FORCE, P) (*(MP)->mnt_op->vfs_unmount)(MP, FORCE, P)#define VFS_ROOT(MP, VPP) (*(MP)->mnt_op->vfs_root)(MP, VPP)#define VFS_QUOTACTL(MP,C,U,A,P) (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A, P)#define VFS_STATFS(MP, SBP, P) (*(MP)->mnt_op->vfs_statfs)(MP, SBP, P)#define VFS_SYNC(MP, WAIT, C, P) (*(MP)->mnt_op->vfs_sync)(MP, WAIT, C, P)#define VFS_VGET(MP, INO, VPP) (*(MP)->mnt_op->vfs_vget)(MP, INO, VPP)#define VFS_FHTOVP(MP, FIDP, VPP) (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, VPP)#define VFS_CHECKEXP(MP, NAM, EXFLG, CRED) \ (*(MP)->mnt_op->vfs_checkexp)(MP, NAM, EXFLG, CRED)#define VFS_VPTOFH(VP, FIDP) (*(VP)->v_mount->mnt_op->vfs_vptofh)(VP, FIDP)#endif /* _KERNEL *//* * Flags for various system call interfaces. * * waitfor flags to vfs_sync() and getfsstat() */#define MNT_WAIT 1 /* synchronously wait for I/O to complete */#define MNT_NOWAIT 2 /* start all I/O, but do not wait for it */#define MNT_LAZY 3 /* push data not written by filesystem syncer *//* * Generic file handle */struct fhandle { fsid_t fh_fsid; /* File system id of mount point */ struct fid fh_fid; /* File sys specific id */};typedef struct fhandle fhandle_t;#ifdef _KERNEL#include <net/radix.h>#include <sys/socket.h> /* XXX for AF_MAX *//* * Network address lookup element */struct netcred { struct radix_node netc_rnodes[2]; int netc_exflags; struct ucred netc_anon;};/* * Network export information */struct netexport { struct netcred ne_defexported; /* Default export */ struct radix_node_head *ne_rtable[AF_MAX+1]; /* Individual exports */};#endif /* _KERNEL *//* * Export arguments for local filesystem mount calls. */struct export_args { int ex_flags; /* export related flags */ uid_t ex_root; /* mapping for root uid */ struct ucred ex_anon; /* mapping for anonymous user */ struct sockaddr *ex_addr; /* net address to which exported */ int ex_addrlen; /* and the net address length */ struct sockaddr *ex_mask; /* mask of valid bits in saddr */ int ex_masklen; /* and the smask length */ char *ex_indexfile; /* index file for WebNFS URLs */};/* * Structure holding information for a publicly exported filesystem * (WebNFS). Currently the specs allow just for one such filesystem. */struct nfs_public { int np_valid; /* Do we hold valid information */ fhandle_t np_handle; /* Filehandle for pub fs (internal) */ struct mount *np_mount; /* Mountpoint of exported fs */ char *np_index; /* Index file */};#ifdef _KERNEL/* * exported vnode operations */struct mount *vfs_getvfs __P((fsid_t *)); /* return vfs given fsid */int vfs_export /* process mount export info */ __P((struct mount *, struct netexport *, struct export_args *));struct netcred *vfs_export_lookup /* lookup host in fs export list */ __P((struct mount *, struct netexport *, struct mbuf *));int vfs_setpublicfs /* set publicly exported fs */ __P((struct mount *, struct netexport *, struct export_args *));int vfs_lock __P((struct mount *)); /* lock a vfs */int vfs_mountedon __P((struct vnode *));/* is a vfs mounted on vp */int vfs_mountroot __P((void));void vfs_shutdown __P((void)); /* unmount and sync file systems */void vfs_unlock __P((struct mount *)); /* unlock a vfs */void vfs_unmountall __P((struct proc *)); /* unmount file systems */int vfs_busy __P((struct mount *, int, struct simplelock *));int vfs_rootmountalloc __P((char *, char *, struct mount **));void vfs_unbusy __P((struct mount *));int vfs_attach __P((struct vfsops *));int vfs_detach __P((struct vfsops *));struct vfsops *vfs_getopsbyname __P((const char *));int vfs_sysctl __P((int *, u_int, void *, size_t *, void *, size_t, struct proc *));extern CIRCLEQ_HEAD(mntlist, mount) mountlist; /* mounted filesystem list */extern struct vfsops *vfssw[]; /* filesystem type table */extern int nvfssw;extern struct nfs_public nfs_pub;extern struct simplelock mountlist_slock;extern struct simplelock spechash_slock;long makefstype __P((const char *));int dounmount __P((struct mount *, int, struct proc *));void vfsinit __P((void));void vfs_opv_init __P((struct vnodeopv_desc **));void vfs_opv_free __P((struct vnodeopv_desc **));#ifdef DEBUGvoid vfs_bufstats __P((void));#endifLIST_HEAD(vfs_list_head, vfsops);extern struct vfs_list_head vfs_list;#else /* _KERNEL */#include <sys/cdefs.h>__BEGIN_DECLSint fstatfs __P((int, struct statfs *));int getfh __P((const char *, fhandle_t *));int getfsstat __P((struct statfs *, long, int));int getmntinfo __P((struct statfs **, int));int mount __P((const char *, const char *, int, void *));int statfs __P((const char *, struct statfs *));int unmount __P((const char *, int));#if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)int fhopen __P((const fhandle_t *, int));int fhstat __P((const fhandle_t *, struct stat *));int fhstatfs __P((const fhandle_t *, struct statfs *));#endif /* !_POSIX_C_SOURCE */__END_DECLS#endif /* _KERNEL */#endif /* !_SYS_MOUNT_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -