Changeset 75678 in vbox for trunk/src/VBox/Additions/darwin
- Timestamp:
- Nov 22, 2018 9:39:48 PM (6 years ago)
- Location:
- trunk/src/VBox/Additions/darwin/VBoxSF
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/darwin/VBoxSF/Makefile.kmk
r75677 r75678 59 59 60 60 # 61 # mount.vbox vfs - The Shared Folders mouning tool.61 # mount.vboxsf - The Shared Folders mounting tool. 62 62 # 63 63 PROGRAMS += mount.vboxsf -
trunk/src/VBox/Additions/darwin/VBoxSF/VBoxSF-VNodeOps.cpp
r75677 r75678 742 742 VnParms.vnfs_dvp = pParent; 743 743 VnParms.vnfs_fsnode = pVnData; 744 VnParms.vnfs_vops = g_papfnVBox VFSVnodeDirOpsVector;744 VnParms.vnfs_vops = g_papfnVBoxSfDwnVnDirOpsVector; 745 745 VnParms.vnfs_markroot = pParent == NULL; 746 746 VnParms.vnfs_marksystem = 0; … … 821 821 822 822 /** ??? */ 823 int (**g_papfnVBox VFSVnodeDirOpsVector)(void *);823 int (**g_papfnVBoxSfDwnVnDirOpsVector)(void *); 824 824 825 825 /** … … 828 828 struct vnodeopv_desc g_VBoxSfVnodeOpvDesc = 829 829 { 830 &g_papfnVBox VFSVnodeDirOpsVector,830 &g_papfnVBoxSfDwnVnDirOpsVector, 831 831 g_VBoxSfDirOpsDescList 832 832 }; -
trunk/src/VBox/Additions/darwin/VBoxSF/VBoxSF-VfsOps.cpp
r75677 r75678 28 28 #include <iprt/string.h> 29 29 #include <VBox/log.h> 30 31 32 /* States of VBoxVFS object used in atomic variables33 * in order to reach sync between several concurrently running threads. */34 #define VBOXVFS_OBJECT_UNINITIALIZED (0)35 #define VBOXVFS_OBJECT_INITIALIZING (1)36 #define VBOXVFS_OBJECT_INITIALIZED (2)37 #define VBOXVFS_OBJECT_INVALID (3)38 30 39 31 … … 84 76 pReq->Parms.pInfo.u.Embedded.fFlags = VBOX_HGCM_F_PARM_DIRECTION_FROM_HOST; 85 77 86 78 int vrc = VbglR0HGCMFastCall(g_SfClientDarwin.handle, &pReq->Hdr, sizeof(*pReq)); 87 79 if (RT_SUCCESS(vrc)) 88 80 vrc = pReq->Call.header.result; -
trunk/src/VBox/Additions/darwin/VBoxSF/VBoxSF.cpp
r75677 r75678 47 47 uint32_t volatile g_cVBoxSfMounts = 0; 48 48 49 /* VBoxVFS filesystem handle. Needed for FS unregistering. */49 /** VFS table entry for our file system (for vfs_fsremove). */ 50 50 static vfstable_t g_pVBoxSfVfsTableEntry; 51 51 /** For vfs_fsentry. */ … … 78 78 extern kern_return_t _stop(struct kmod_info *pKModInfo, void *pvData); 79 79 80 KMOD_EXPLICIT_DECL(VBox VFS, VBOX_VERSION_STRING, _start, _stop)80 KMOD_EXPLICIT_DECL(VBoxSF, VBOX_VERSION_STRING, _start, _stop) 81 81 DECLHIDDEN(kmod_start_func_t *) _realmain = vboxSfDwnModuleLoad; 82 82 DECLHIDDEN(kmod_stop_func_t *) _antimain = vboxSfDwnModuleUnload; … … 212 212 213 213 /* 214 * Are we busy? If so fail. 214 * Are we busy? If so fail. Otherwise try deregister the file system. 215 215 */ 216 216 if (g_cVBoxSfMounts > 0) … … 220 220 } 221 221 222 if (g_pVBoxSfVfsTableEntry) 223 { 224 int rc = vfs_fsremove(g_pVBoxSfVfsTableEntry); 225 if (rc != 0) 226 { 227 LogRel(("VBoxSF: vfs_fsremove failed: %d\n", rc)); 228 return KERN_NO_ACCESS; 229 } 230 } 231 222 232 /* 223 233 * Disconnect and terminate libraries we're using. 224 234 */ 225 226 235 if (g_SfClientDarwin.handle != NULL) 227 236 { -
trunk/src/VBox/Additions/darwin/VBoxSF/VBoxSFInternal.h
r75677 r75678 48 48 49 49 /********************************************************************************************************************************* 50 * Defined Constants And Macros *51 *********************************************************************************************************************************/52 53 54 /*********************************************************************************************************************************55 50 * Structures and Typedefs * 56 51 *********************************************************************************************************************************/ … … 77 72 typedef struct VBOXSFDWNVNDATA 78 73 { 79 SHFLHANDLE hHandle; /** VBoxVFS object handle. */ 74 /** The handle to the host object. */ 75 SHFLHANDLE hHandle; 80 76 ///PSHFLSTRING pPath; /** Path within shared folder */ 81 77 ///lck_attr_t *pLockAttr; /** BSD locking stuff */ … … 94 90 extern struct vfsops g_VBoxSfVfsOps; 95 91 extern struct vnodeopv_desc g_VBoxSfVnodeOpvDesc; 96 extern int (**g_papfnVBox VFSVnodeDirOpsVector)(void *);92 extern int (**g_papfnVBoxSfDwnVnDirOpsVector)(void *); 97 93 98 94 … … 105 101 106 102 107 #if 0 /* old code, rewriting. */108 109 /**110 * Helper function to create XNU VFS vnode object.111 *112 * @param mp Mount data structure113 * @param type vnode type (directory, regular file, etc)114 * @param pParent Parent vnode object (NULL for VBoxVFS root vnode)115 * @param fIsRoot Flag that indicates if created vnode object is116 * VBoxVFS root vnode (TRUE for VBoxVFS root vnode, FALSE117 * for all aother vnodes)118 * @param Path within Shared Folder119 * @param ret Returned newly created vnode120 *121 * @return 0 on success, error code otherwise122 */123 extern int vboxvfs_create_vnode_internal(struct mount *mp, enum vtype type, vnode_t pParent, int fIsRoot, PSHFLSTRING Path, vnode_t *ret);124 125 /**126 * Convert guest absolute VFS path (starting from VFS root) to a host path127 * within mounted shared folder (returning it as a char *).128 *129 * @param mp Mount data structure130 * @param pszGuestPath Guest absolute VFS path (starting from VFS root)131 * @param cbGuestPath Size of pszGuestPath132 * @param pszHostPath Returned char * wich contains host path133 * @param cbHostPath Returned pszHostPath size134 *135 * @return 0 on success, error code otherwise136 */137 extern int vboxvfs_guest_path_to_char_path_internal(mount_t mp, char *pszGuestPath, int cbGuestPath, char **pszHostPath, int *cbHostPath);138 139 /**140 * Convert guest absolute VFS path (starting from VFS root) to a host path141 * within mounted shared folder.142 *143 * @param mp Mount data structure144 * @param pszGuestPath Guest absolute VFS path (starting from VFS root)145 * @param cbGuestPath Size of pszGuestPath146 * @param ppResult Returned PSHFLSTRING object wich contains host path147 *148 * @return 0 on success, error code otherwise149 */150 extern int vboxvfs_guest_path_to_shflstring_path_internal(mount_t mp, char *pszGuestPath, int cbGuestPath, PSHFLSTRING *ppResult);151 152 /**153 * Wrapper function for vboxvfs_guest_path_to_char_path_internal() which154 * converts guest path to host path using vnode object information.155 *156 * @param vnode Guest's VFS object157 * @param ppPath Allocated char * which contain a path158 * @param pcbPath Size of ppPath159 *160 * @return 0 on success, error code otherwise.161 */162 extern int vboxvfs_guest_vnode_to_char_path_internal(vnode_t vnode, char **ppHostPath, int *pcbHostPath);163 164 /**165 * Wrapper function for vboxvfs_guest_path_to_shflstring_path_internal() which166 * converts guest path to host path using vnode object information.167 *168 * @param vnode Guest's VFS object169 * @param ppResult Allocated PSHFLSTRING object which contain a path170 *171 * @return 0 on success, error code otherwise.172 */173 extern int vboxvfs_guest_vnode_to_shflstring_path_internal(vnode_t vnode, PSHFLSTRING *ppResult);174 175 /**176 * Free resources allocated by vboxvfs_path_internal() and vboxvfs_guest_vnode_to_shflstring_path_internal().177 *178 * @param ppHandle Reference to object to be freed.179 */180 extern void vboxvfs_put_path_internal(void **ppHandle);181 182 /**183 * Open existing VBoxVFS object and return its handle.184 *185 * @param pMount Mount session data.186 * @param pPath VFS path to the object relative to mount point.187 * @param fFlags For directory object it should be188 * SHFL_CF_DIRECTORY and 0 for any other object.189 * @param pHandle Returned handle.190 *191 * @return 0 on success, error code otherwise.192 */193 extern int vboxvfs_open_internal(vboxvfs_mount_t *pMount, PSHFLSTRING pPath, uint32_t fFlags, SHFLHANDLE *pHandle);194 195 /**196 * Release VBoxVFS object handle openned by vboxvfs_open_internal().197 *198 * @param pMount Mount session data.199 * @param pHandle Handle to close.200 *201 * @return 0 on success, IPRT error code otherwise.202 */203 extern int vboxvfs_close_internal(vboxvfs_mount_t *pMount, SHFLHANDLE pHandle);204 205 /**206 * Get information about host VFS object.207 *208 * @param mp Mount point data209 * @param pSHFLDPath Path to VFS object within mounted shared folder210 * @param Info Returned info211 *212 * @return 0 on success, error code otherwise.213 */214 extern int vboxvfs_get_info_internal(mount_t mp, PSHFLSTRING pSHFLDPath, PSHFLFSOBJINFO Info);215 216 /**217 * Check if VFS object exists on a host side.218 *219 * @param vnode Guest VFS vnode that corresponds to host VFS object220 *221 * @return 1 if exists, 0 otherwise.222 */223 extern int vboxvfs_exist_internal(vnode_t vnode);224 225 /**226 * Convert host VFS object mode flags into guest ones.227 *228 * @param fHostMode Host flags229 *230 * @return Guest flags231 */232 extern mode_t vboxvfs_h2g_mode_inernal(RTFMODE fHostMode);233 234 /**235 * Convert guest VFS object mode flags into host ones.236 *237 * @param fGuestMode Host flags238 *239 * @return Host flags240 */241 extern uint32_t vboxvfs_g2h_mode_inernal(mode_t fGuestMode);242 243 extern SHFLSTRING *vboxvfs_construct_shflstring(const char *pszName, size_t cchName);244 103 #endif 245 104 246 #endif247 248 -
trunk/src/VBox/Additions/darwin/VBoxSF/VBoxSFMount.h
r75293 r75678 27 27 * Mount information that gets passed from userland on mount. 28 28 */ 29 typedef struct vboxvfs_mount_info29 typedef struct VBOXSFDRWNMOUNTINFO 30 30 { 31 /** Magic value (VBOX VFS_MOUNTINFO_MAGIC). */31 /** Magic value (VBOXSFDRWNMOUNTINFO_MAGIC). */ 32 32 uint32_t u32Magic; 33 33 /** The shared folder name. */
Note:
See TracChangeset
for help on using the changeset viewer.