1 | /* $Id: vboxvfs.h 10067 2008-07-01 11:07:51Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VirtualBox File System Driver for Solaris Guests, Internal Header.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2008 Sun Microsystems, Inc.
|
---|
8 | *
|
---|
9 | * Sun Microsystems, Inc. confidential
|
---|
10 | * All rights reserved
|
---|
11 | */
|
---|
12 |
|
---|
13 | #ifndef ___VBoxVFS_Solaris_h
|
---|
14 | #define ___VBoxVFS_Solaris_h
|
---|
15 |
|
---|
16 | #ifdef __cplusplus
|
---|
17 | extern "C" {
|
---|
18 | #endif
|
---|
19 |
|
---|
20 | #define MAX_HOST_NAME 256
|
---|
21 | #define MAX_NLS_NAME 32
|
---|
22 |
|
---|
23 | /** The module name. */
|
---|
24 | #define DEVICE_NAME "vboxvfs"
|
---|
25 | /** The module description as seen in 'modinfo'. */
|
---|
26 | #define DEVICE_DESC "filesystem for VirtualBox Shared Folders"
|
---|
27 |
|
---|
28 | /* Not sure if we need this; it seems only necessary for kernel mounts. */
|
---|
29 | #if 0
|
---|
30 | typedef struct vboxvfs_mountinfo
|
---|
31 | {
|
---|
32 | char name[MAX_HOST_NAME];
|
---|
33 | char nls_name[MAX_NLS_NAME];
|
---|
34 | int uid;
|
---|
35 | int gid;
|
---|
36 | int ttl;
|
---|
37 | } vboxvfs_mountinfo_t;
|
---|
38 | #endif
|
---|
39 |
|
---|
40 | #ifdef _KERNEL
|
---|
41 |
|
---|
42 | #include "../../common/VBoxGuestLib/VBoxCalls.h"
|
---|
43 | #include <sys/vfs.h>
|
---|
44 | #include <sys/vfs_opreg.h>
|
---|
45 |
|
---|
46 | /** VNode for VBoxVFS */
|
---|
47 | typedef struct vboxvfs_vnode
|
---|
48 | {
|
---|
49 | vnode_t *pVNode;
|
---|
50 | vattr_t Attr;
|
---|
51 | SHFLSTRING *pPath;
|
---|
52 | kmutex_t MtxContents;
|
---|
53 | } vboxvfs_vnode_t;
|
---|
54 |
|
---|
55 |
|
---|
56 | /** Per-file system mount instance data. */
|
---|
57 | typedef struct vboxvfs_globinfo
|
---|
58 | {
|
---|
59 | VBSFMAP Map;
|
---|
60 | int Ttl;
|
---|
61 | int Uid;
|
---|
62 | int Gid;
|
---|
63 | vfs_t *pVFS;
|
---|
64 | vnode_t *pVNodeDev;
|
---|
65 | vboxvfs_vnode_t *pVNodeRoot;
|
---|
66 | } vboxvfs_globinfo_t;
|
---|
67 |
|
---|
68 | extern struct vnodeops *g_pVBoxVFS_vnodeops;
|
---|
69 | extern const fs_operation_def_t g_VBoxVFS_vnodeops_template[];
|
---|
70 | extern VBSFCLIENT g_VBoxVFSClient;
|
---|
71 |
|
---|
72 | /** Helper functions */
|
---|
73 | extern int vboxvfs_Stat(const char *pszCaller, vboxvfs_globinfo_t *pVBoxVFSGlobalInfo, SHFLSTRING *pPath,
|
---|
74 | RTFSOBJINFO *pResult, boolean_t fAllowFailure);
|
---|
75 | extern void vboxvfs_InitVNode(vboxvfs_globinfo_t *pVBoxVFSGlobalInfo, vboxvfs_vnode_t *pVBoxVNode,
|
---|
76 | RTFSOBJINFO *pFSInfo);
|
---|
77 |
|
---|
78 |
|
---|
79 | /** Helper macros */
|
---|
80 | #define VFS_TO_VBOXVFS(vfs) ((vboxvfs_globinfo_t *)((vfs)->vfs_data))
|
---|
81 | #define VBOXVFS_TO_VFS(vboxvfs) ((vboxvfs)->pVFS)
|
---|
82 | #define VN_TO_VBOXVN(vnode) ((vboxvfs_vnode_t *)((vnode)->v_data))
|
---|
83 | #define VBOXVN_TO_VN(vboxvnode) ((vboxvnode)->pVNode)
|
---|
84 |
|
---|
85 | #endif /* _KERNEL */
|
---|
86 |
|
---|
87 | #ifdef __cplusplus
|
---|
88 | }
|
---|
89 | #endif
|
---|
90 |
|
---|
91 | #endif /* ___VBoxVFS_Solaris_h */
|
---|
92 |
|
---|