1 | /* $Id: vboxfs.h 31691 2010-08-16 12:59:23Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VirtualBox File System Driver for Solaris Guests, Internal Header.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2009-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 | * The contents of this file may alternatively be used under the terms
|
---|
18 | * of the Common Development and Distribution License Version 1.0
|
---|
19 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
20 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
21 | * CDDL are applicable instead of those of the GPL.
|
---|
22 | *
|
---|
23 | * You may elect to license modified versions of this file under the
|
---|
24 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
25 | */
|
---|
26 |
|
---|
27 | #ifndef ___VBoxVFS_Solaris_h
|
---|
28 | #define ___VBoxVFS_Solaris_h
|
---|
29 |
|
---|
30 | #ifdef __cplusplus
|
---|
31 | extern "C" {
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | #define MAX_HOST_NAME 256
|
---|
35 | #define MAX_NLS_NAME 32
|
---|
36 | /** Default stat cache ttl (in ms) */
|
---|
37 | #define DEF_STAT_TTL_MS 200
|
---|
38 |
|
---|
39 | /** The module name. */
|
---|
40 | #define DEVICE_NAME "vboxfs"
|
---|
41 |
|
---|
42 | #ifdef _KERNEL
|
---|
43 |
|
---|
44 | #include "../../common/VBoxGuestLib/VBoxGuestR0LibSharedFolders.h"
|
---|
45 | #include <sys/vfs.h>
|
---|
46 |
|
---|
47 | /** VNode for VBoxVFS */
|
---|
48 | typedef struct vboxvfs_vnode
|
---|
49 | {
|
---|
50 | vnode_t *pVNode;
|
---|
51 | vattr_t Attr;
|
---|
52 | SHFLSTRING *pPath;
|
---|
53 | kmutex_t MtxContents;
|
---|
54 | } vboxvfs_vnode_t;
|
---|
55 |
|
---|
56 |
|
---|
57 | /** Per-file system mount instance data. */
|
---|
58 | typedef struct vboxvfs_globinfo
|
---|
59 | {
|
---|
60 | VBSFMAP Map;
|
---|
61 | int Ttl;
|
---|
62 | int Uid;
|
---|
63 | int Gid;
|
---|
64 | vfs_t *pVFS;
|
---|
65 | vboxvfs_vnode_t *pVNodeRoot;
|
---|
66 | kmutex_t MtxFS;
|
---|
67 | } vboxvfs_globinfo_t;
|
---|
68 |
|
---|
69 | extern struct vnodeops *g_pVBoxVFS_vnodeops;
|
---|
70 | extern const fs_operation_def_t g_VBoxVFS_vnodeops_template[];
|
---|
71 | extern VBSFCLIENT g_VBoxVFSClient;
|
---|
72 |
|
---|
73 | /** Helper functions */
|
---|
74 | extern int vboxvfs_Stat(const char *pszCaller, vboxvfs_globinfo_t *pVBoxVFSGlobalInfo, SHFLSTRING *pPath,
|
---|
75 | RTFSOBJINFO *pResult, boolean_t fAllowFailure);
|
---|
76 | extern void vboxvfs_InitVNode(vboxvfs_globinfo_t *pVBoxVFSGlobalInfo, vboxvfs_vnode_t *pVBoxVNode,
|
---|
77 | RTFSOBJINFO *pFSInfo);
|
---|
78 |
|
---|
79 |
|
---|
80 | /** Helper macros */
|
---|
81 | #define VFS_TO_VBOXVFS(vfs) ((vboxvfs_globinfo_t *)((vfs)->vfs_data))
|
---|
82 | #define VBOXVFS_TO_VFS(vboxvfs) ((vboxvfs)->pVFS)
|
---|
83 | #define VN_TO_VBOXVN(vnode) ((vboxvfs_vnode_t *)((vnode)->v_data))
|
---|
84 | #define VBOXVN_TO_VN(vboxvnode) ((vboxvnode)->pVNode)
|
---|
85 |
|
---|
86 | #endif /* _KERNEL */
|
---|
87 |
|
---|
88 | #ifdef __cplusplus
|
---|
89 | }
|
---|
90 | #endif
|
---|
91 |
|
---|
92 | #endif /* !___VBoxVFS_Solaris_h */
|
---|
93 |
|
---|