Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/sys/mount.h,v rcsdiff: /ftp/cvs/cvsroot/src/sys/sys/mount.h,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.165.4.1 retrieving revision 1.165.4.2 diff -u -p -r1.165.4.1 -r1.165.4.2 --- src/sys/sys/mount.h 2007/11/06 23:34:50 1.165.4.1 +++ src/sys/sys/mount.h 2008/01/09 01:58:12 1.165.4.2 @@ -1,4 +1,4 @@ -/* $NetBSD: mount.h,v 1.165.4.1 2007/11/06 23:34:50 matt Exp $ */ +/* $NetBSD: mount.h,v 1.165.4.2 2008/01/09 01:58:12 matt Exp $ */ /* * Copyright (c) 1989, 1991, 1993 @@ -40,13 +40,16 @@ #include #endif /* _NETBSD_SOURCE */ #endif + +#ifndef _STANDALONE #include #include #include #include #include +#include #include -#include +#endif /* !_STANDALONE */ /* * file system statistics @@ -87,14 +90,15 @@ #define MOUNT_PUFFS "puffs" /* Pass-to-Userspace filesystem */ #define MOUNT_HFS "hfs" /* Apple HFS+ Filesystem */ #define MOUNT_EFS "efs" /* SGI's Extent Filesystem */ +#define MOUNT_ZFS "zfs" /* Sun ZFS */ + +#ifndef _STANDALONE /* * 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 doubly linked list. */ -TAILQ_HEAD(vnodelst, vnode); - struct mount { CIRCLEQ_ENTRY(mount) mnt_list; /* mount list */ struct vfsops *mnt_op; /* operations on fs */ @@ -110,7 +114,8 @@ struct mount { void *mnt_data; /* private data */ int mnt_wcnt; /* count of vfs_busy waiters */ struct lwp *mnt_unmounter; /* who is unmounting */ - struct simplelock mnt_slock; /* mutex for wcnt */ + kmutex_t mnt_mutex; /* mutex for wcnt */ + void *mnt_transinfo; /* for FS-internal use */ specificdata_reference mnt_specdataref; /* subsystem specific data */ }; @@ -132,7 +137,6 @@ struct mount { #define VFS_MAGICLINKS 4 /* expand 'magic' symlinks */ #define VFSGEN_MAXID 5 /* number of valid vfs.generic ids */ -#ifndef _STANDALONE /* * USE THE SAME NAMES AS MOUNT_*! * @@ -186,16 +190,13 @@ struct vfsops { const char *vfs_name; size_t vfs_min_mount_data; int (*vfs_mount) (struct mount *, const char *, void *, - size_t *, struct lwp *); - int (*vfs_start) (struct mount *, int, struct lwp *); - int (*vfs_unmount) (struct mount *, int, struct lwp *); + size_t *); + int (*vfs_start) (struct mount *, int); + int (*vfs_unmount) (struct mount *, int); int (*vfs_root) (struct mount *, struct vnode **); - int (*vfs_quotactl) (struct mount *, int, uid_t, void *, - struct lwp *); - int (*vfs_statvfs) (struct mount *, struct statvfs *, - struct lwp *); - int (*vfs_sync) (struct mount *, int, struct kauth_cred *, - struct lwp *); + int (*vfs_quotactl) (struct mount *, int, uid_t, void *); + int (*vfs_statvfs) (struct mount *, struct statvfs *); + int (*vfs_sync) (struct mount *, int, struct kauth_cred *); int (*vfs_vget) (struct mount *, ino_t, struct vnode **); int (*vfs_fhtovp) (struct mount *, struct fid *, struct vnode **); @@ -207,29 +208,32 @@ struct vfsops { int (*vfs_snapshot) (struct mount *, struct vnode *, struct timespec *); int (*vfs_extattrctl) (struct mount *, int, - struct vnode *, int, const char *, - struct lwp *); + struct vnode *, int, const char *); int (*vfs_suspendctl) (struct mount *, int); const struct vnodeopv_desc * const *vfs_opv_descs; int vfs_refcount; LIST_ENTRY(vfsops) vfs_list; }; -#define VFS_MOUNT(MP, PATH, DATA, DATA_LEN, L) \ - (*(MP)->mnt_op->vfs_mount)(MP, PATH, DATA, DATA_LEN, L) -#define VFS_START(MP, FLAGS, L) (*(MP)->mnt_op->vfs_start)(MP, FLAGS, L) -#define VFS_UNMOUNT(MP, FORCE, L) (*(MP)->mnt_op->vfs_unmount)(MP, FORCE, L) -#define VFS_ROOT(MP, VPP) (*(MP)->mnt_op->vfs_root)(MP, VPP) -#define VFS_QUOTACTL(MP,C,U,A,L) (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A, L) -#define VFS_STATVFS(MP, SBP, L) (*(MP)->mnt_op->vfs_statvfs)(MP, SBP, L) -#define VFS_SYNC(MP, WAIT, C, L) (*(MP)->mnt_op->vfs_sync)(MP, WAIT, C, L) +/* XXX Actually file system internal. */ #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_VPTOFH(VP, FIDP, FIDSZP) (*(VP)->v_mount->mnt_op->vfs_vptofh)(VP, FIDP, FIDSZP) -#define VFS_SNAPSHOT(MP, VP, TS) (*(MP)->mnt_op->vfs_snapshot)(MP, VP, TS) -#define VFS_EXTATTRCTL(MP, C, VP, AS, AN, L) \ - (*(MP)->mnt_op->vfs_extattrctl)(MP, C, VP, AS, AN, L) -#define VFS_SUSPENDCTL(MP, C) (*(MP)->mnt_op->vfs_suspendctl)(MP, C) + +int VFS_MOUNT(struct mount *, const char *, void *, size_t *); +int VFS_START(struct mount *, int); +int VFS_UNMOUNT(struct mount *, int); +int VFS_ROOT(struct mount *, struct vnode **); +int VFS_QUOTACTL(struct mount *, int, uid_t, void *); +int VFS_STATVFS(struct mount *, struct statvfs *); +int VFS_SYNC(struct mount *, int, struct kauth_cred *); +int VFS_FHTOVP(struct mount *, struct fid *, struct vnode **); +int VFS_VPTOFH(struct vnode *, struct fid *, size_t *); +void VFS_INIT(void); +void VFS_REINIT(void); +void VFS_DONE(void); +int VFS_MOUNTROOT(void); +int VFS_SNAPSHOT(struct mount *, struct vnode *, struct timespec *); +int VFS_EXTATTRCTL(struct mount *, int, struct vnode *, int, const char *); +int VFS_SUSPENDCTL(struct mount *, int); #endif /* _KERNEL || __VFSOPS_EXPOSE */ @@ -244,16 +248,13 @@ struct kauth_cred; #define VFS_PROTOS(fsname) \ int fsname##_mount(struct mount *, const char *, void *, \ - size_t *, struct lwp *); \ -int fsname##_start(struct mount *, int, struct lwp *); \ -int fsname##_unmount(struct mount *, int, struct lwp *); \ + size_t *); \ +int fsname##_start(struct mount *, int); \ +int fsname##_unmount(struct mount *, int); \ int fsname##_root(struct mount *, struct vnode **); \ -int fsname##_quotactl(struct mount *, int, uid_t, void *, \ - struct lwp *); \ -int fsname##_statvfs(struct mount *, struct statvfs *, \ - struct lwp *); \ -int fsname##_sync(struct mount *, int, struct kauth_cred *, \ - struct lwp *); \ +int fsname##_quotactl(struct mount *, int, uid_t, void *); \ +int fsname##_statvfs(struct mount *, struct statvfs *); \ +int fsname##_sync(struct mount *, int, struct kauth_cred *); \ int fsname##_vget(struct mount *, ino_t, struct vnode **); \ int fsname##_fhtovp(struct mount *, struct fid *, struct vnode **); \ int fsname##_vptofh(struct vnode *, struct fid *, size_t *); \ @@ -264,7 +265,7 @@ int fsname##_mountroot(void); \ int fsname##_snapshot(struct mount *, struct vnode *, \ struct timespec *); \ int fsname##_extattrctl(struct mount *, int, struct vnode *, int, \ - const char *, struct lwp *); \ + const char *); \ int fsname##_suspendctl(struct mount *, int) #define VFS_ATTACH(vfs) __link_set_add_data(vfsops, vfs) @@ -335,14 +336,14 @@ void vfs_destroy(struct mount *); void vfs_scrubvnlist(struct mount *); int vfs_stdextattrctl(struct mount *, int, struct vnode *, - int, const char *, struct lwp *); + int, const char *); extern CIRCLEQ_HEAD(mntlist, mount) mountlist; /* mounted filesystem list */ extern struct vfsops *vfssw[]; /* filesystem type table */ extern int nvfssw; -extern kmutex_t mountlist_lock; -extern struct simplelock spechash_slock; -extern kmutex_t vfs_list_lock; +extern kmutex_t mountlist_lock; +extern kmutex_t spechash_lock; +extern kmutex_t vfs_list_lock; long makefstype(const char *); int dounmount(struct mount *, int, struct lwp *);