1 | /* $Id: vboxfs.h 76563 2019-01-01 03:53:56Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VirtualBox File System Driver for Solaris Guests, Internal Header.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2009-2019 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 GA_INCLUDED_SRC_solaris_SharedFolders_vboxfs_h
|
---|
28 | #define GA_INCLUDED_SRC_solaris_SharedFolders_vboxfs_h
|
---|
29 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
30 | # pragma once
|
---|
31 | #endif
|
---|
32 |
|
---|
33 | #ifdef __cplusplus
|
---|
34 | extern "C" {
|
---|
35 | #endif
|
---|
36 |
|
---|
37 | #define MAX_HOST_NAME 256
|
---|
38 | #define MAX_NLS_NAME 32
|
---|
39 | /** Default stat cache ttl (in ms) */
|
---|
40 | #define DEF_STAT_TTL_MS 200
|
---|
41 |
|
---|
42 | /** The module name. */
|
---|
43 | #define DEVICE_NAME "vboxfs"
|
---|
44 |
|
---|
45 | #ifdef _KERNEL
|
---|
46 |
|
---|
47 | #include <VBox/VBoxGuestLibSharedFolders.h>
|
---|
48 | #include <sys/vfs.h>
|
---|
49 |
|
---|
50 | /** VNode for VBoxVFS */
|
---|
51 | typedef struct vboxvfs_vnode
|
---|
52 | {
|
---|
53 | vnode_t *pVNode;
|
---|
54 | vattr_t Attr;
|
---|
55 | SHFLSTRING *pPath;
|
---|
56 | kmutex_t MtxContents;
|
---|
57 | } vboxvfs_vnode_t;
|
---|
58 |
|
---|
59 |
|
---|
60 | /** Per-file system mount instance data. */
|
---|
61 | typedef struct vboxvfs_globinfo
|
---|
62 | {
|
---|
63 | VBGLSFMAP Map;
|
---|
64 | int Ttl;
|
---|
65 | int Uid;
|
---|
66 | int Gid;
|
---|
67 | vfs_t *pVFS;
|
---|
68 | vboxvfs_vnode_t *pVNodeRoot;
|
---|
69 | kmutex_t MtxFS;
|
---|
70 | } vboxvfs_globinfo_t;
|
---|
71 |
|
---|
72 | extern struct vnodeops *g_pVBoxVFS_vnodeops;
|
---|
73 | extern const fs_operation_def_t g_VBoxVFS_vnodeops_template[];
|
---|
74 | extern VBGLSFCLIENT g_VBoxVFSClient;
|
---|
75 |
|
---|
76 | /** Helper functions */
|
---|
77 | extern int vboxvfs_Stat(const char *pszCaller, vboxvfs_globinfo_t *pVBoxVFSGlobalInfo, SHFLSTRING *pPath,
|
---|
78 | PSHFLFSOBJINFO pResult, boolean_t fAllowFailure);
|
---|
79 | extern void vboxvfs_InitVNode(vboxvfs_globinfo_t *pVBoxVFSGlobalInfo, vboxvfs_vnode_t *pVBoxVNode,
|
---|
80 | PSHFLFSOBJINFO pFSInfo);
|
---|
81 |
|
---|
82 |
|
---|
83 | /** Helper macros */
|
---|
84 | #define VFS_TO_VBOXVFS(vfs) ((vboxvfs_globinfo_t *)((vfs)->vfs_data))
|
---|
85 | #define VBOXVFS_TO_VFS(vboxvfs) ((vboxvfs)->pVFS)
|
---|
86 | #define VN_TO_VBOXVN(vnode) ((vboxvfs_vnode_t *)((vnode)->v_data))
|
---|
87 | #define VBOXVN_TO_VN(vboxvnode) ((vboxvnode)->pVNode)
|
---|
88 |
|
---|
89 | #endif /* _KERNEL */
|
---|
90 |
|
---|
91 | #ifdef __cplusplus
|
---|
92 | }
|
---|
93 | #endif
|
---|
94 |
|
---|
95 | #endif /* !GA_INCLUDED_SRC_solaris_SharedFolders_vboxfs_h */
|
---|
96 |
|
---|