1 | /* $Id: vboxfs.h 17626 2009-03-10 13:17:19Z 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 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | *
|
---|
17 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
18 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
19 | * additional information or have any questions.
|
---|
20 | */
|
---|
21 |
|
---|
22 | #ifndef ___VBoxVFS_Solaris_h
|
---|
23 | #define ___VBoxVFS_Solaris_h
|
---|
24 |
|
---|
25 | #ifdef __cplusplus
|
---|
26 | extern "C" {
|
---|
27 | #endif
|
---|
28 |
|
---|
29 | #define MAX_HOST_NAME 256
|
---|
30 | #define MAX_NLS_NAME 32
|
---|
31 |
|
---|
32 | /** The module name. */
|
---|
33 | #define DEVICE_NAME "vboxfs"
|
---|
34 |
|
---|
35 | #ifdef _KERNEL
|
---|
36 |
|
---|
37 | #include "../../common/VBoxGuestLib/VBoxCalls.h"
|
---|
38 | #include <sys/vfs.h>
|
---|
39 | #include <sys/vfs_opreg.h>
|
---|
40 |
|
---|
41 | /** VNode for VBoxVFS */
|
---|
42 | typedef struct vboxvfs_vnode
|
---|
43 | {
|
---|
44 | vnode_t *pVNode;
|
---|
45 | vattr_t Attr;
|
---|
46 | SHFLSTRING *pPath;
|
---|
47 | kmutex_t MtxContents;
|
---|
48 | } vboxvfs_vnode_t;
|
---|
49 |
|
---|
50 |
|
---|
51 | /** Per-file system mount instance data. */
|
---|
52 | typedef struct vboxvfs_globinfo
|
---|
53 | {
|
---|
54 | VBSFMAP Map;
|
---|
55 | int Ttl;
|
---|
56 | int Uid;
|
---|
57 | int Gid;
|
---|
58 | vfs_t *pVFS;
|
---|
59 | vboxvfs_vnode_t *pVNodeRoot;
|
---|
60 | kmutex_t MtxFS;
|
---|
61 | } vboxvfs_globinfo_t;
|
---|
62 |
|
---|
63 | extern struct vnodeops *g_pVBoxVFS_vnodeops;
|
---|
64 | extern const fs_operation_def_t g_VBoxVFS_vnodeops_template[];
|
---|
65 | extern VBSFCLIENT g_VBoxVFSClient;
|
---|
66 |
|
---|
67 | /** Helper functions */
|
---|
68 | extern int vboxvfs_Stat(const char *pszCaller, vboxvfs_globinfo_t *pVBoxVFSGlobalInfo, SHFLSTRING *pPath,
|
---|
69 | RTFSOBJINFO *pResult, boolean_t fAllowFailure);
|
---|
70 | extern void vboxvfs_InitVNode(vboxvfs_globinfo_t *pVBoxVFSGlobalInfo, vboxvfs_vnode_t *pVBoxVNode,
|
---|
71 | RTFSOBJINFO *pFSInfo);
|
---|
72 |
|
---|
73 |
|
---|
74 | /** Helper macros */
|
---|
75 | #define VFS_TO_VBOXVFS(vfs) ((vboxvfs_globinfo_t *)((vfs)->vfs_data))
|
---|
76 | #define VBOXVFS_TO_VFS(vboxvfs) ((vboxvfs)->pVFS)
|
---|
77 | #define VN_TO_VBOXVN(vnode) ((vboxvfs_vnode_t *)((vnode)->v_data))
|
---|
78 | #define VBOXVN_TO_VN(vboxvnode) ((vboxvnode)->pVNode)
|
---|
79 |
|
---|
80 | #endif /* _KERNEL */
|
---|
81 |
|
---|
82 | #ifdef __cplusplus
|
---|
83 | }
|
---|
84 | #endif
|
---|
85 |
|
---|
86 | #endif /* ___VBoxVFS_Solaris_h */
|
---|
87 |
|
---|