1 | /* $Id: vboxfs.h 31012 2010-07-22 15:55:04Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VirtualBox File System Driver for Solaris Guests, Internal Header.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2010 Oracle Corporation
|
---|
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 |
|
---|
18 | #ifndef ___VBoxVFS_Solaris_h
|
---|
19 | #define ___VBoxVFS_Solaris_h
|
---|
20 |
|
---|
21 | #ifdef __cplusplus
|
---|
22 | extern "C" {
|
---|
23 | #endif
|
---|
24 |
|
---|
25 | #define MAX_HOST_NAME 256
|
---|
26 | #define MAX_NLS_NAME 32
|
---|
27 | /** Default stat cache ttl (in ms) */
|
---|
28 | #define DEF_STAT_TTL_MS 200
|
---|
29 |
|
---|
30 | /** The module name. */
|
---|
31 | #define DEVICE_NAME "vboxfs"
|
---|
32 |
|
---|
33 | #ifdef _KERNEL
|
---|
34 |
|
---|
35 | #include "../../common/VBoxGuestLib/VBoxGuestR0LibSharedFolders.h"
|
---|
36 | #include <sys/vfs.h>
|
---|
37 |
|
---|
38 | /** VNode for VBoxVFS */
|
---|
39 | typedef struct vboxvfs_vnode
|
---|
40 | {
|
---|
41 | vnode_t *pVNode;
|
---|
42 | vattr_t Attr;
|
---|
43 | SHFLSTRING *pPath;
|
---|
44 | kmutex_t MtxContents;
|
---|
45 | } vboxvfs_vnode_t;
|
---|
46 |
|
---|
47 |
|
---|
48 | /** Per-file system mount instance data. */
|
---|
49 | typedef struct vboxvfs_globinfo
|
---|
50 | {
|
---|
51 | VBSFMAP Map;
|
---|
52 | int Ttl;
|
---|
53 | int Uid;
|
---|
54 | int Gid;
|
---|
55 | vfs_t *pVFS;
|
---|
56 | vboxvfs_vnode_t *pVNodeRoot;
|
---|
57 | kmutex_t MtxFS;
|
---|
58 | } vboxvfs_globinfo_t;
|
---|
59 |
|
---|
60 | extern struct vnodeops *g_pVBoxVFS_vnodeops;
|
---|
61 | extern const fs_operation_def_t g_VBoxVFS_vnodeops_template[];
|
---|
62 | extern VBSFCLIENT g_VBoxVFSClient;
|
---|
63 |
|
---|
64 | /** Helper functions */
|
---|
65 | extern int vboxvfs_Stat(const char *pszCaller, vboxvfs_globinfo_t *pVBoxVFSGlobalInfo, SHFLSTRING *pPath,
|
---|
66 | RTFSOBJINFO *pResult, boolean_t fAllowFailure);
|
---|
67 | extern void vboxvfs_InitVNode(vboxvfs_globinfo_t *pVBoxVFSGlobalInfo, vboxvfs_vnode_t *pVBoxVNode,
|
---|
68 | RTFSOBJINFO *pFSInfo);
|
---|
69 |
|
---|
70 |
|
---|
71 | /** Helper macros */
|
---|
72 | #define VFS_TO_VBOXVFS(vfs) ((vboxvfs_globinfo_t *)((vfs)->vfs_data))
|
---|
73 | #define VBOXVFS_TO_VFS(vboxvfs) ((vboxvfs)->pVFS)
|
---|
74 | #define VN_TO_VBOXVN(vnode) ((vboxvfs_vnode_t *)((vnode)->v_data))
|
---|
75 | #define VBOXVN_TO_VN(vboxvnode) ((vboxvnode)->pVNode)
|
---|
76 |
|
---|
77 | #endif /* _KERNEL */
|
---|
78 |
|
---|
79 | #ifdef __cplusplus
|
---|
80 | }
|
---|
81 | #endif
|
---|
82 |
|
---|
83 | #endif /* !___VBoxVFS_Solaris_h */
|
---|
84 |
|
---|