Index: /trunk/src/VBox/Additions/solaris/SharedFolders/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Additions/solaris/SharedFolders/Makefile.kmk	(revision 17210)
+++ /trunk/src/VBox/Additions/solaris/SharedFolders/Makefile.kmk	(revision 17211)
@@ -44,4 +44,26 @@
 vboxvfs_LDFLAGS      += -N drv/vboxguest
 
+
+ifndef VBOX_OSE
+#
+# vboxvfs_s10 - The Shared Folder Driver for Solaris 10
+#
+SYSMODS.solaris      += vboxvfs_s10
+vboxvfs_s10_TEMPLATE      = VBOXGUESTR0
+vboxvfs_s10_DEFS          = VBOX_WITH_HGCM VBOX_VFS_SOLARIS_10U6
+vboxvfs_s10_INCS         := \
+	solaris10/ \
+	.
+vboxvfs_s10_SOURCES       = \
+	vboxfs_vfs.c \
+	vboxfs_vnode.c \
+	vboxfs_prov.c
+vboxvfs_s10_LIBS          = \
+	$(VBOX_LIB_VBGL_R0) \
+	$(VBOX_LIB_IPRT_GUEST_R0)
+vboxvfs_s10_LDFLAGS      += -N drv/vboxguest
+endif # VBOX_OSE
+
+
 #
 # mount - Userland mount wrapper for vboxvfs
Index: unk/src/VBox/Additions/solaris/SharedFolders/vboxvfs_utils.c
===================================================================
--- /trunk/src/VBox/Additions/solaris/SharedFolders/vboxvfs_utils.c	(revision 17210)
+++ 	(revision )
@@ -1,176 +1,0 @@
-/* $Id$ */
-/** @file
- * VirtualBox File System Driver for Solaris Guests, Utility functions.
- */
-
-/*
- * Copyright (C) 2008 Sun Microsystems, Inc.
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
- * Clara, CA 95054 USA or visit http://www.sun.com if you need
- * additional information or have any questions.
- */
-
-
-/*******************************************************************************
-*   Header Files                                                               *
-*******************************************************************************/
-#include <time.h>
-#include <sys/stat.h>
-#include <sys/vnode.h>
-#include <sys/sunddi.h>
-#include "vboxvfs.h"
-
-#include <VBox/log.h>
-#include <iprt/time.h>
-#ifdef DEBUG_ramshankar
-# undef LogFlow
-# undef Log
-# define LogFlow    LogRel
-# define Log        LogRel
-#endif
-
-/**
- * Convert from RTTIMESPEC to timestruct_t.
- *
- * @param   pTime       Pointer to destination timestruct_t object.
- * @param   pRTTime     Pointer to source time RTTIMESPEC object.
- */
-static void vboxvfs_FileTimeFromTimeSpec(timestruc_t *pTime, PRTTIMESPEC pRTTime)
-{
-    int64_t t = RTTimeSpecGetNano(pRTTime);
-    int64_t nsec = t / 1000000000;
-
-    pTime->tv_sec = t;
-    pTime->tv_nsec = nsec;
-}
-
-
-/**
- * Stat for a file on the host.
- *
- * @returns errno error code.
- * @param   pszCaller               Entity calling this function (just used for logging sake)
- * @param   pVBoxVFSGlobalInfo      Pointer to the global filesystem info. struct.
- * @param   pPath                   Pointer to file path on the guest to stat.
- * @param   pResult                 Where to store the result of stat.
- * @param   fAllowFailure           Whether failure is acceptable to the caller (currently just logging).
- */
-int vboxvfs_Stat(const char *pszCaller, vboxvfs_globinfo_t *pVBoxVFSGlobalInfo, SHFLSTRING *pPath,
-            RTFSOBJINFO *pResult, boolean_t fAllowFailure)
-{
-    int rc;
-    SHFLCREATEPARMS Params;
-
-    LogFlow((DEVICE_NAME ":vboxvfs_Stat caller=%s fAllowFailure=%d\n", pszCaller, fAllowFailure));
-
-    Params.CreateFlags = SHFL_CF_LOOKUP | SHFL_CF_ACT_FAIL_IF_NEW;
-    rc = vboxCallCreate(&g_VBoxVFSClient, &pVBoxVFSGlobalInfo->Map, pPath, &Params);
-    if (RT_FAILURE(rc))
-    {
-        Log((DEVICE_NAME ":vboxCallCreate failed! caller=%s rc=%Rrc\n", pszCaller, rc));
-        return EPROTO;
-    }
-
-    if (Params.Result != SHFL_FILE_EXISTS)
-    {
-        if (fAllowFailure)
-        {
-            LogRel((DEVICE_NAME ":vboxCallCreate(%s) file does not exist. caller=%s result=%d\n",
-                    pPath->String.utf8, Params.Result, pszCaller));
-        }
-        return ENOENT;
-    }
-    *pResult = Params.Info;
-    return 0;
-}
-
-/**
- * Initializes VNode structure.
- *
- * @param   pVBoxVFSGlobalInfo      Pointer to the global filesystem info. struct.
- * @param   pVBoxVNode              Pointer to the pre-allocated vboxvfs_vnode_t object to initialize.
- * @param   pInfo                   Pointer to the RTFSOBJINFO used for initialization.
- */
-void vboxvfs_InitVNode(vboxvfs_globinfo_t *pVBoxVFSGlobalInfo, vboxvfs_vnode_t *pVBoxVNode,
-            PRTFSOBJINFO pFSInfo)
-{
-    RTFSOBJATTR *pFSAttr;
-    int fDir;
-    vfs_t *pVFS;
-
-    LogFlow((DEVICE_NAME ":vboxvfs_InitVNode pVBoxVFGSGlobalInfo=%p pVBoxVNode=%p pFSInfo=%p\n", pVBoxVFSGlobalInfo,
-            pVBoxVNode, pFSInfo));
-
-    mutex_enter(&pVBoxVNode->MtxContents);
-
-    pVFS = VBOXVFS_TO_VFS(pVBoxVFSGlobalInfo);
-    pFSAttr = &pFSInfo->Attr;
-    fDir = RTFS_IS_DIRECTORY(pFSAttr->fMode);
-    int Mode = 0;
-
-#define VBOXMODESET(r) pFSAttr->fMode & (RTFS_UNIX_##r) ? (S_##r) : 0;
-    Mode |= VBOXMODESET(ISUID);
-    Mode |= VBOXMODESET(ISGID);
-
-    Mode |= VBOXMODESET(IRUSR);
-    Mode |= VBOXMODESET(IWUSR);
-    Mode |= VBOXMODESET(IXUSR);
-
-    Mode |= VBOXMODESET(IRGRP);
-    Mode |= VBOXMODESET(IWGRP);
-    Mode |= VBOXMODESET(IXGRP);
-
-    Mode |= VBOXMODESET(IROTH);
-    Mode |= VBOXMODESET(IWOTH);
-    Mode |= VBOXMODESET(IXOTH);
-#undef VBOXMODESET
-
-    bzero(&pVBoxVNode->Attr, sizeof(vattr_t));
-    if (fDir)
-    {
-        pVBoxVNode->Attr.va_mode = (mode_t)(S_IFDIR | Mode);
-        pVBoxVNode->Attr.va_type = VDIR;
-    }
-    else
-    {
-        pVBoxVNode->Attr.va_mode = (mode_t)(S_IFREG | Mode);
-        pVBoxVNode->Attr.va_type = VREG;
-    }
-
-    pVBoxVNode->Attr.va_rdev = 0;   /* @todo Verify if setting it to zero is okay, not sure of this. */
-    pVBoxVNode->Attr.va_mask = 0;
-    pVBoxVNode->Attr.va_seq = 0;
-    pVBoxVNode->Attr.va_nlink = 1;
-    pVBoxVNode->Attr.va_uid = pVBoxVFSGlobalInfo->Uid;
-    pVBoxVNode->Attr.va_gid = pVBoxVFSGlobalInfo->Gid;
-    pVBoxVNode->Attr.va_fsid = pVFS->vfs_dev;
-    pVBoxVNode->Attr.va_size = pFSInfo->cbObject;
-    pVBoxVNode->Attr.va_nblocks = (pFSInfo->cbObject + 4095) / 4096;
-    pVBoxVNode->Attr.va_blksize = 4096;
-
-    vboxvfs_FileTimeFromTimeSpec(&pVBoxVNode->Attr.va_atime, &pFSInfo->AccessTime);
-    vboxvfs_FileTimeFromTimeSpec(&pVBoxVNode->Attr.va_ctime, &pFSInfo->ChangeTime);
-    vboxvfs_FileTimeFromTimeSpec(&pVBoxVNode->Attr.va_mtime, &pFSInfo->ModificationTime);
-
-    /* Allocate and initialize the vnode */
-    pVBoxVNode->pVNode = vn_alloc(KM_SLEEP);
-
-    vn_setops(pVBoxVNode->pVNode, g_pVBoxVFS_vnodeops);
-    pVBoxVNode->pVNode->v_data = pVBoxVNode;
-    pVBoxVNode->pVNode->v_vfsp = pVFS;
-    pVBoxVNode->pVNode->v_type = pVBoxVNode->Attr.va_type;
-    pVBoxVNode->pVNode->v_rdev = pVBoxVNode->Attr.va_rdev;
-
-    mutex_exit(&pVBoxVNode->MtxContents);
-    vn_exists(pVBoxVNode->pVNode);
-}
-
Index: unk/src/VBox/Additions/solaris/SharedFolders/vboxvfs_vfsops.c
===================================================================
--- /trunk/src/VBox/Additions/solaris/SharedFolders/vboxvfs_vfsops.c	(revision 17210)
+++ 	(revision )
@@ -1,620 +1,0 @@
-/* $Id$ */
-/** @file
- * VirtualBox File System Driver for Solaris Guests. VFS operations.
- */
-
-/*
- * Copyright (C) 2008 Sun Microsystems, Inc.
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
- * Clara, CA 95054 USA or visit http://www.sun.com if you need
- * additional information or have any questions.
- */
-
-
-/*******************************************************************************
-*   Header Files                                                               *
-*******************************************************************************/
-#include <sys/types.h>
-#include <sys/mntent.h>
-#include <sys/param.h>
-#include <sys/modctl.h>
-#include <sys/mount.h>
-#include <sys/policy.h>
-#include <sys/atomic.h>
-#include <sys/sysmacros.h>
-#include <sys/ddi.h>
-#include <sys/sunddi.h>
-#ifdef u
-#undef u
-#endif
-#include "vboxvfs.h"
-
-#if defined(DEBUG_ramshankar) && !defined(LOG_ENABLED)
-# define LOG_ENABLED
-# define LOG_TO_BACKDOOR
-#endif
-#include <VBox/log.h>
-#include <iprt/string.h>
-#include <iprt/mem.h>
-#include <iprt/err.h>
-#if defined(DEBUG_ramshankar)
-# undef LogFlow
-# define LogFlow        LogRel
-# undef Log
-# define Log            LogRel
-#endif
-
-/*******************************************************************************
-*   Defined Constants And Macros                                               *
-*******************************************************************************/
-/** Mount Options */
-#define MNTOPT_VBOXVFS_UID       "uid"
-#define MNTOPT_VBOXVFS_GID       "gid"
-
-
-/*******************************************************************************
-*   Internal Functions                                                         *
-*******************************************************************************/
-static int VBoxVFS_Init(int fType, char *pszName);
-static int VBoxVFS_Mount(vfs_t *pVFS, vnode_t *pVNode, struct mounta *pMount, cred_t *pCred);
-static int VBoxVFS_Unmount(vfs_t *pVFS, int fFlags, cred_t *pCred);
-static int VBoxVFS_Root(vfs_t *pVFS, vnode_t **ppVNode);
-static int VBoxVFS_Statfs(register vfs_t *pVFS, struct statvfs64 *pStat);
-static int VBoxVFS_VGet(vfs_t *pVFS, vnode_t **ppVNode, struct fid *pFid);
-static void VBoxVFS_FreeVFS(vfs_t *pVFS);
-
-static int vboxvfs_CheckMountPerm(vfs_t *pVFS, struct mounta *pMount, vnode_t *pVNodeSpec, cred_t *pCred);
-static int vboxvfs_GetIntOpt(vfs_t *pVFS, char *pszOpt, int *pValue);
-
-
-/*******************************************************************************
-*   Structures and Typedefs                                                    *
-*******************************************************************************/
-/**
- * mntopts_t: mount options table array
- */
-static mntopt_t g_VBoxVFSMountOptions[] =
-{
-    /* Option Name           Cancel Opt.     Default Arg       Flags           Data */
-    { MNTOPT_VBOXVFS_UID,    NULL,           NULL,             MO_HASVALUE,    NULL },
-    { MNTOPT_VBOXVFS_GID,    NULL,           NULL,             MO_HASVALUE,    NULL }
-};
-
-/**
- * mntopts_t: mount options table prototype
- */
-static mntopts_t g_VBoxVFSMountTableProt =
-{
-    sizeof(g_VBoxVFSMountOptions) / sizeof(mntopt_t),
-    g_VBoxVFSMountOptions
-};
-
-/**
- * vfsdef_t: driver specific mount options
- */
-static vfsdef_t g_VBoxVFSDef =
-{
-    VFSDEF_VERSION,
-    DEVICE_NAME,
-    VBoxVFS_Init,
-    VSW_HASPROTO,
-    &g_VBoxVFSMountTableProt
-};
-
-/**
- * modlfs: loadable file system
- */
-static struct modlfs g_VBoxVFSLoadMod =
-{
-    &mod_fsops,     /* extern from kernel */
-    DEVICE_DESC,
-    &g_VBoxVFSDef
-};
-
-/**
- * modlinkage: export install/remove/info to the kernel
- */
-static struct modlinkage g_VBoxVFSModLinkage =
-{
-    MODREV_1,               /* loadable module system revision */
-    &g_VBoxVFSLoadMod,
-    NULL                    /* terminate array of linkage structures */
-};
-
-
-/*******************************************************************************
-*   Global Variables                                                           *
-*******************************************************************************/
-/** GCC C++ hack. */
-unsigned __gxx_personality_v0 = 0xdecea5ed;
-/** Global connection to the client. */
-VBSFCLIENT g_VBoxVFSClient;
-/** Global VFS Operations pointer. */
-vfsops_t *g_pVBoxVFS_vfsops;
-/** The file system type identifier. */
-static int g_VBoxVFSType;
-/** Major number of this module */
-static major_t g_VBoxVFSMajor;
-/** Minor instance number */
-static minor_t g_VBoxVFSMinor;
-/** Minor lock mutex protection */
-static kmutex_t g_VBoxVFSMinorMtx;
-
-
-/**
- * Kernel entry points
- */
-int _init(void)
-{
-    LogFlow((DEVICE_NAME ":_init\n"));
-
-    return mod_install(&g_VBoxVFSModLinkage);;
-}
-
-
-int _fini(void)
-{
-    LogFlow((DEVICE_NAME ":_fini\n"));
-
-    int rc = mod_remove(&g_VBoxVFSModLinkage);
-    if (rc)
-        return rc;
-
-    /* Blow away the operation vectors*/
-    vfs_freevfsops_by_type(g_VBoxVFSType);
-    vn_freevnodeops(g_pVBoxVFS_vnodeops);
-}
-
-
-int _info(struct modinfo *pModInfo)
-{
-    LogFlow((DEVICE_NAME ":_info\n"));
-
-    return mod_info(&g_VBoxVFSModLinkage, pModInfo);
-}
-
-
-static int VBoxVFS_Init(int fType, char *pszName)
-{
-    int rc;
-
-    LogFlow((DEVICE_NAME ":VBoxVFS_Init\n"));
-
-    g_VBoxVFSType = fType;
-
-    /* Initialize the R0 guest library. */
-    rc = vboxInit();
-    if (RT_SUCCESS(rc))
-    {
-        /* Connect to the host service. */
-        rc = vboxConnect(&g_VBoxVFSClient);
-        if (RT_SUCCESS(rc))
-        {
-            /* Use UTF-8 encoding. */
-            rc = vboxCallSetUtf8 (&g_VBoxVFSClient);
-            if (RT_SUCCESS(rc))
-            {
-                /* Fill up VFS user entry points. */
-                static const fs_operation_def_t s_VBoxVFS_vfsops_template[] =
-                {
-                    VFSNAME_MOUNT,    { .vfs_mount =     VBoxVFS_Mount   },
-                    VFSNAME_UNMOUNT,  { .vfs_unmount =   VBoxVFS_Unmount },
-                    VFSNAME_ROOT,     { .vfs_root =      VBoxVFS_Root    },
-                    VFSNAME_STATVFS,  { .vfs_statvfs =   VBoxVFS_Statfs  },
-                    VFSNAME_VGET,     { .vfs_vget =      VBoxVFS_VGet    },
-                    VFSNAME_FREEVFS,  { .vfs_freevfs =   VBoxVFS_FreeVFS },
-                    NULL,             NULL
-                };
-
-                rc = vfs_setfsops(fType, s_VBoxVFS_vfsops_template, &g_pVBoxVFS_vfsops);
-                if (!rc)
-                {
-                    /* Set VNode operations. */
-                    rc = vn_make_ops(pszName, g_VBoxVFS_vnodeops_template, &g_pVBoxVFS_vnodeops);
-                    if (!rc)
-                    {
-                        /* Get a free major number. */
-                        g_VBoxVFSMajor = getudev();
-                        if (g_VBoxVFSMajor != (major_t)-1)
-                        {
-                            /* Initialize minor mutex here. */
-                            mutex_init(&g_VBoxVFSMinorMtx, "VBoxVFSMinorMtx", MUTEX_DEFAULT, NULL);
-                            LogFlow((DEVICE_NAME ":Successfully loaded vboxvfs.\n"));
-                            return 0;
-                        }
-                        else
-                        {
-                            LogRel((DEVICE_NAME ":getudev failed.\n"));
-                            rc = EMFILE;
-                        }
-                    }
-                    else
-                        LogRel((DEVICE_NAME ":vn_make_ops failed. rc=%d\n", rc));
-                }
-                else
-                    LogRel((DEVICE_NAME ":vfs_setfsops failed. rc=%d\n", rc));
-            }
-            else
-            {
-                LogRel((DEVICE_NAME ":vboxCallSetUtf8 failed. rc=%d\n", rc));
-                rc = EPROTO;
-            }
-            vboxDisconnect(&g_VBoxVFSClient);
-        }
-        else
-        {
-            LogRel((DEVICE_NAME ":Failed to connect to host! rc=%d\n", rc));
-            rc = ENXIO;
-        }
-        vboxUninit();
-    }
-    else
-    {
-        LogRel((DEVICE_NAME ":Failed to initialize R0 lib. rc=%d\n", rc));
-        rc = ENXIO;
-    }
-    return rc;
-}
-
-static int VBoxVFS_Mount(vfs_t *pVFS, vnode_t *pVNode, struct mounta *pMount, cred_t *pCred)
-{
-    int rc = 0;
-    int Uid = 0;
-    int Gid = 0;
-    char *pszShare = NULL;
-    size_t cbShare = NULL;
-    pathname_t PathName;
-    vboxvfs_vnode_t *pVNodeRoot = NULL;
-    vnode_t *pVNodeSpec = NULL;
-    vnode_t *pVNodeDev = NULL;
-    dev_t Dev = 0;
-    SHFLSTRING *pShflShareName = NULL;
-    RTFSOBJINFO FSInfo;
-    size_t cbShflShareName = 0;
-    vboxvfs_globinfo_t *pVBoxVFSGlobalInfo = NULL;
-    int AddrSpace = (pMount->flags & MS_SYSSPACE) ? UIO_SYSSPACE : UIO_USERSPACE;
-
-    LogFlow((DEVICE_NAME ":VBoxVFS_Mount\n"));
-
-    /* Check user credentials for mounting in the specified target. */
-    rc = secpolicy_fs_mount(pCred, pVNode, pVFS);
-    if (rc)
-    {
-        LogRel((DEVICE_NAME ":VBoxVFS_Mount: secpolicy_fs_mount failed! invalid credentials.rc=%d\n", rc));
-        return EPERM;
-    }
-
-    /* We can mount to only directories. */
-    if (pVNode->v_type != VDIR)
-        return ENOTDIR;
-
-    /* We don't support remounting. */
-    if (pMount->flags & MS_REMOUNT)
-        return ENOTSUP;
-
-    mutex_enter(&pVNode->v_lock);
-    if (   !(pMount->flags & MS_OVERLAY)
-        &&  (pVNode->v_count > 1 || (pVNode->v_flag & VROOT)))
-    {
-        LogRel((DEVICE_NAME ":VBoxVFS_Mount: device busy.\n"));
-        mutex_exit(&pVNode->v_lock);
-        return EBUSY;
-    }
-    mutex_exit(&pVNode->v_lock);
-
-    /* From what I understood the options are already parsed at a higher level */
-    if (   (pMount->flags & MS_DATA)
-        && pMount->datalen > 0)
-    {
-        LogRel((DEVICE_NAME ":VBoxVFS_Mount: unparsed options not supported.\n"));
-        return EINVAL;
-    }
-
-    /* Get UID argument (optional). */
-    rc = vboxvfs_GetIntOpt(pVFS, MNTOPT_VBOXVFS_UID, &Uid);
-    if (rc < 0)
-    {
-        LogRel((DEVICE_NAME ":VBoxVFS_Mount: invalid uid value.\n"));
-        return EINVAL;
-    }
-
-    /* Get GID argument (optional). */
-    rc = vboxvfs_GetIntOpt(pVFS, MNTOPT_VBOXVFS_GID, &Gid);
-    if (rc < 0)
-    {
-        LogRel((DEVICE_NAME ":VBoxVFS_Mount: invalid gid value.\n"));
-        return EINVAL;
-    }
-
-    /* Get special (sharename). */
-    rc = pn_get(pMount->spec, AddrSpace, &PathName);
-    if (!rc)
-    {
-        /* Get an available minor instance number for this mount. */
-        mutex_enter(&g_VBoxVFSMinorMtx);
-        do
-        {
-            atomic_add_32_nv(&g_VBoxVFSMinor, 1) & L_MAXMIN32;
-            Dev = makedevice(g_VBoxVFSMajor, g_VBoxVFSMinor);
-        } while (vfs_devismounted(Dev));
-        mutex_exit(&g_VBoxVFSMinorMtx);
-
-        cbShare = strlen(PathName.pn_path);
-        pszShare = RTMemAlloc(cbShare);
-        if (pszShare)
-            memcpy(pszShare, PathName.pn_path, cbShare);
-        else
-        {
-            LogRel((DEVICE_NAME ":VBoxVFS_Mount: failed to alloc %d bytes for sharename.\n", cbShare));
-            rc = ENOMEM;
-        }
-    }
-    else
-    {
-        LogRel((DEVICE_NAME ":VBoxVFS_Mount: failed to get sharename.rc=%d\n", rc));
-        rc = EINVAL;
-    }
-    pn_free(&PathName);
-
-    if (rc)
-    {
-        if (pszShare)
-            RTMemFree(pszShare);
-        return rc;
-    }
-
-    /* Allocate the global info. structure. */
-    pVBoxVFSGlobalInfo = RTMemAlloc(sizeof(*pVBoxVFSGlobalInfo));
-    if (pVBoxVFSGlobalInfo)
-    {
-        cbShflShareName = offsetof(SHFLSTRING, String.utf8) + cbShare + 1;
-        pShflShareName  = RTMemAllocZ(cbShflShareName);
-        if (pShflShareName)
-        {
-            pShflShareName->u16Length = cbShflShareName;
-            pShflShareName->u16Size   = cbShflShareName + 1;
-            memcpy (pShflShareName->String.utf8, pszShare, cbShare + 1);
-
-            rc = vboxCallMapFolder(&g_VBoxVFSClient, pShflShareName, &pVBoxVFSGlobalInfo->Map);
-            RTMemFree(pShflShareName);
-            if (RT_SUCCESS(rc))
-                rc = 0;
-            else
-            {
-                LogRel((DEVICE_NAME ":VBoxVFS_Mount: vboxCallMapFolder failed rc=%d\n", rc));
-                rc = EPROTO;
-            }
-        }
-        else
-        {
-            LogRel((DEVICE_NAME ":VBoxVFS_Mount: RTMemAllocZ failed to alloc %d bytes for ShFlShareName.\n", cbShflShareName));
-            rc = ENOMEM;
-        }
-        RTMemFree(pVBoxVFSGlobalInfo);
-    }
-    else
-    {
-        LogRel((DEVICE_NAME ":VBoxVFS_Mount: RTMemAlloc failed to alloc %d bytes for global struct.\n", sizeof(*pVBoxVFSGlobalInfo)));
-        rc = ENOMEM;
-    }
-
-    /* Undo work on failure. */
-    if (rc)
-        goto mntError1;
-
-    /* Initialize the per-filesystem mutex */
-    mutex_init(&pVBoxVFSGlobalInfo->MtxFS, "VBoxVFS_FSMtx", MUTEX_DEFAULT, NULL);
-
-    pVBoxVFSGlobalInfo->Uid = Uid;
-    pVBoxVFSGlobalInfo->Gid = Gid;
-    pVBoxVFSGlobalInfo->pVFS = pVFS;
-    pVFS->vfs_data = pVBoxVFSGlobalInfo;
-    pVFS->vfs_fstype = g_VBoxVFSType;
-    pVFS->vfs_dev = Dev;
-    vfs_make_fsid(&pVFS->vfs_fsid, Dev, g_VBoxVFSType);
-
-    /* Allocate root vboxvfs_vnode_t object */
-    pVNodeRoot = RTMemAlloc(sizeof(*pVNodeRoot));
-    if (pVNodeRoot)
-    {
-        /* Initialize vnode protection mutex */
-        mutex_init(&pVNodeRoot->MtxContents, "VBoxVFS_VNodeMtx", MUTEX_DEFAULT, NULL);
-
-        pVBoxVFSGlobalInfo->pVNodeRoot = pVNodeRoot;
-
-        /* Allocate root path */
-        pVNodeRoot->pPath = RTMemAllocZ(sizeof(SHFLSTRING) + 1);
-        if (pVNodeRoot->pPath)
-        {
-            /* Initialize root path */
-            pVNodeRoot->pPath->u16Length = 1;
-            pVNodeRoot->pPath->u16Size = 2;
-            pVNodeRoot->pPath->String.utf8[0] = '/';
-            pVNodeRoot->pPath->String.utf8[1] = '\0';
-
-            /* Stat root node info from host */
-            rc = vboxvfs_Stat(__func__, pVBoxVFSGlobalInfo, pVNodeRoot->pPath, &FSInfo, B_FALSE);
-            if (!rc)
-            {
-                /* Initialize the root vboxvfs_node_t object */
-                vboxvfs_InitVNode(pVBoxVFSGlobalInfo, pVNodeRoot, &FSInfo);
-
-                /* Success! */
-                LogFlow((DEVICE_NAME ":VBoxVFS_Mount: success!\n", rc));
-                return 0;
-            }
-            else
-                LogRel((DEVICE_NAME ":VBoxVFS_Mount: vboxvfs_Stat failed rc(errno)=%d\n", rc));
-            RTMemFree(pVNodeRoot->pPath);
-        }
-        else
-        {
-            LogRel((DEVICE_NAME ":VBoxVFS_Mount: failed to alloc memory for root node path.\n"));
-            rc = ENOMEM;
-        }
-        RTMemFree(pVNodeRoot);
-    }
-    else
-    {
-        LogRel((DEVICE_NAME ":VBoxVFS_Mount: failed to alloc memory for root node.\n"));
-        rc = ENOMEM;
-    }
-
-    /* Undo work in reverse. */
-mntError1:
-    RTMemFree(pszShare);
-    return rc;
-}
-
-static int VBoxVFS_Unmount(vfs_t *pVFS, int fUnmount, cred_t *pCred)
-{
-    int rc;
-    vboxvfs_globinfo_t *pVBoxVFSGlobalInfo;
-
-    LogFlow((DEVICE_NAME ":VBoxVFS_Unmount.\n"));
-
-    /* Check if user can unmount. */
-    rc = secpolicy_fs_unmount(pCred, pVFS);
-    if (rc)
-    {
-        LogRel((DEVICE_NAME ":VBoxVFS_Unmount: insufficient privileges to unmount.rc=%d\n", rc));
-        return EPERM;
-    }
-
-    /* @todo -XXX - Not sure of supporting force unmounts. What this means is that a failed force mount could bring down
-     * the entire system as hanging about vnode releases would no longer be valid after unloading ourselves...
-     */
-    if (fUnmount & MS_FORCE)
-        pVFS->vfs_flag |= VFS_UNMOUNTED;
-
-    /* @todo implement ref-counting of active vnodes & check for busy state here. */
-    /* @todo mutex protection needed here */
-    pVBoxVFSGlobalInfo = VFS_TO_VBOXVFS(pVFS);
-
-    rc = vboxCallUnmapFolder(&g_VBoxVFSClient, &pVBoxVFSGlobalInfo->Map);
-    if (RT_FAILURE(rc))
-        LogRel((DEVICE_NAME ":VBoxVFS_Unmount: failed to unmap shared folder. rc=%d\n", rc));
-
-    VN_RELE(VBOXVN_TO_VN(pVBoxVFSGlobalInfo->pVNodeRoot));
-
-    RTMemFree(pVBoxVFSGlobalInfo->pVNodeRoot->pPath);
-    RTMemFree(pVBoxVFSGlobalInfo->pVNodeRoot);
-    RTMemFree(pVBoxVFSGlobalInfo);
-    pVBoxVFSGlobalInfo = NULL;
-    pVFS->vfs_data = NULL;
-
-    return 0;
-}
-
-static int VBoxVFS_Root(vfs_t *pVFS, vnode_t **ppVNode)
-{
-    vboxvfs_globinfo_t *pVBoxVFSGlobalInfo = VFS_TO_VBOXVFS(pVFS);
-    *ppVNode = VBOXVN_TO_VN(pVBoxVFSGlobalInfo->pVNodeRoot);
-    VN_HOLD(*ppVNode);
-
-    return 0;
-}
-
-static int VBoxVFS_Statfs(register vfs_t *pVFS, struct statvfs64 *pStat)
-{
-    SHFLVOLINFO         VolumeInfo;
-    uint32_t            cbBuffer;
-    vboxvfs_globinfo_t *pVBoxVFSGlobalInfo;
-    dev32_t             Dev32;
-    int                 rc;
-
-    pVBoxVFSGlobalInfo = VFS_TO_VBOXVFS(pVFS);
-    cbBuffer = sizeof(VolumeInfo);
-    rc = vboxCallFSInfo(&g_VBoxVFSClient, &pVBoxVFSGlobalInfo->Map, 0, SHFL_INFO_GET | SHFL_INFO_VOLUME, &cbBuffer,
-                    (PSHFLDIRINFO)&VolumeInfo);
-    if (RT_FAILURE(rc))
-        return RTErrConvertToErrno(rc);
-
-    bzero(pStat, sizeof(*pStat));
-    cmpldev(&Dev32, pVFS->vfs_dev);
-    pStat->f_fsid        = Dev32;
-    pStat->f_flag        = vf_to_stf(pVFS->vfs_flag);
-    pStat->f_bsize       = VolumeInfo.ulBytesPerAllocationUnit;
-    pStat->f_frsize      = VolumeInfo.ulBytesPerAllocationUnit;
-    pStat->f_bfree       = VolumeInfo.ullAvailableAllocationBytes / VolumeInfo.ulBytesPerAllocationUnit;
-    pStat->f_bavail      = VolumeInfo.ullAvailableAllocationBytes / VolumeInfo.ulBytesPerAllocationUnit;
-    pStat->f_blocks      = VolumeInfo.ullTotalAllocationBytes / VolumeInfo.ulBytesPerAllocationUnit;
-    pStat->f_files       = 1000;
-    pStat->f_ffree       = 1000; /* don't return 0 here since the guest may think that it is not possible to create any more files */
-    pStat->f_namemax     = 255;  /* @todo is this correct?? */
-
-    strlcpy(pStat->f_basetype, vfssw[pVFS->vfs_fstype].vsw_name, sizeof(pStat->f_basetype));
-    strlcpy(pStat->f_fstr, DEVICE_NAME, sizeof(pStat->f_fstr));
-
-    return 0;
-}
-
-static int VBoxVFS_VGet(vfs_t *pVFS, vnode_t **ppVNode, struct fid *pFid)
-{
-    /* -- TODO -- */
-    return 0;
-}
-
-static void VBoxVFS_FreeVFS(vfs_t *pVFS)
-{
-    vboxDisconnect(&g_VBoxVFSClient);
-    vboxUninit();
-}
-
-static int vboxvfs_CheckMountPerm(vfs_t *pVFS, struct mounta *pMount, vnode_t *pVNodeSpec, cred_t *pCred)
-{
-    /* Check if user has the rights to mount the special file. */
-    int fOpen = FREAD | FWRITE;
-    int fAccess = VREAD | VWRITE;
-    int rc;
-
-    if (pVNodeSpec->v_type != VBLK)
-        return ENOTBLK;
-
-    if (   (pVFS->vfs_flag & VFS_RDONLY)
-        || (pMount->flags  & MS_RDONLY))
-    {
-        fOpen = FREAD;
-        fAccess = VREAD;
-    }
-
-    rc = VOP_ACCESS(pVNodeSpec, fAccess, 0, pCred, NULL /* caller_context */);
-    if (!rc)
-        rc = secpolicy_spec_open(pCred, pVNodeSpec, fOpen);
-
-    return rc;
-}
-
-static int vboxvfs_GetIntOpt(vfs_t *pVFS, char *pszOpt, int *pValue)
-{
-    int rc;
-    long Val;
-    char *pchOpt = NULL;
-    char *pchEnd = NULL;
-
-    rc = vfs_optionisset(pVFS, pszOpt, &pchOpt);
-    if (rc)
-    {
-        rc = ddi_strtol(pchOpt, &pchEnd, 10 /* base */, &Val);
-        if (   !rc
-            && Val > INT_MIN
-            && Val < INT_MAX
-            && pchEnd == pchOpt + strlen(pchOpt))
-        {
-            *pValue = (int)Val;
-            return 0;
-        }
-        return -1;
-    }
-    return 1;
-}
-
Index: unk/src/VBox/Additions/solaris/SharedFolders/vboxvfs_vnops.c
===================================================================
--- /trunk/src/VBox/Additions/solaris/SharedFolders/vboxvfs_vnops.c	(revision 17210)
+++ 	(revision )
@@ -1,229 +1,0 @@
-/* $Id$ */
-/** @file
- * VirtualBox File System Driver for Solaris Guests, VNode Operations.
- */
-
-/*
- * Copyright (C) 2008 Sun Microsystems, Inc.
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
- * Clara, CA 95054 USA or visit http://www.sun.com if you need
- * additional information or have any questions.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/errno.h>
-#include <sys/uio.h>
-#include <sys/cred.h>
-#include <sys/vnode.h>
-#include "vboxvfs.h"
-
-static int VBoxVFS_Open(vnode_t **vpp, int flag, struct cred *cr, caller_context_t *ct)
-{
-}
-
-static int VBoxVFS_Close(vnode_t *vp, int flag, int count, offset_t offset, struct cred *cr, caller_context_t *ct)
-{
-}
-
-static int VBoxVFS_Read(vnode_t *vp, struct uio *uiop, int ioflag, struct cred *cr, caller_context_t *ct)
-{
-}
-
-static int VBoxVFS_Write(vnode_t *vp, struct uio *uiop, int ioflag, struct cred *cr, caller_context_t *ct)
-{
-}
-
-static int VBoxVFS_IOCtl(vnode_t *vp, int cmd, intptr_t arg, int flag, struct cred *cr, int *rvalp, caller_context_t *ct)
-{
-}
-
-static int VBoxVFS_Setfl(vnode_t *vp, int oflags, int nflags, cred_t *cr, caller_context_t *ct)
-{
-}
-
-static int VBoxVFS_Getattr(vnode_t *vp, struct vattr *vap, int flags, struct cred *cr, caller_context_t *ct)
-{
-}
-
-static int VBoxVFS_Setattr(vnode_t *vp, struct vattr *vap, int flags, struct cred *cr, caller_context_t *ct)
-{
-}
-
-static int VBoxVFS_Access(vnode_t *vp, int mode, int flags, struct cred *cr, caller_context_t *ct)
-{
-}
-
-static int VBoxVFS_Fsync(vnode_t *vp, int syncflag, struct cred *cr, caller_context_t *ct)
-{
-}
-
-static void VBoxVFS_Inactive(vnode_t *vp, struct cred *cr, caller_context_t *ct)
-{
-}
-
-static int VBoxVFS_Fid(vnode_t *vp, struct fid *fidp, caller_context_t *ct)
-{
-}
-
-static int VBoxVFS_Lookup(vnode_t *dvp, char *nm, vnode_t **vpp, struct pathname *pnp, int flags, vnode_t *rdir,
-                struct cred *cr, caller_context_t *ct, int *direntflags, pathname_t *realpnp)
-{
-}
-
-static int VBoxVFS_Create(vnode_t *dvp, char *nm, struct vattr *va, enum vcexcl exclusive, int mode, vnode_t **vpp,
-                struct cred *cr, int flag, caller_context_t *ct, vsecattr_t *vsecp)
-{
-}
-
-static int VBoxVFS_Remove(vnode_t *dvp, char *nm, struct cred *cr, caller_context_t *ct, int flags)
-{
-}
-
-static int VBoxVFS_Link(vnode_t *tdvp, vnode_t *vp, char *tnm, struct cred *cr, caller_context_t *ct, int flags)
-{
-}
-
-static int VBoxVFS_Rename(vnode_t *odvp, char *onm, vnode_t *ndvp, char *nnm, struct cred *cr, caller_context_t *ct, int flags)
-{
-}
-
-static int VBoxVFS_Mkdir(vnode_t *dvp, char *nm, struct vattr *va, vnode_t **vpp, struct cred *cr, caller_context_t *ct,
-                int flags, vsecattr_t *vsecp)
-{
-}
-
-static int VBoxVFS_Realvp(vnode_t *vp, vnode_t **vpp, caller_context_t *ct)
-{
-}
-
-static int VBoxVFS_Rmdir(vnode_t *dvp, char *nm, vnode_t *cdir, struct cred *cr, caller_context_t *ct, int flags)
-{
-}
-
-static int VBoxVFS_Symlink(vnode_t *dvp, char *lnm, struct vattr *tva, char *tnm, struct cred *cr,
-                caller_context_t *ct, int flags)
-{
-}
-
-static int VBoxVFS_Readlink(vnode_t *vp, struct uio *uiop, struct cred *cr, caller_context_t *ct)
-{
-}
-
-static int VBoxVFS_Readdir(vnode_t *vp, struct uio *uiop, struct cred *cr, int *eofp, caller_context_t *ct, int flags)
-{
-}
-
-static int VBoxVFS_Rwlock(vnode_t *vp, int write_lock, caller_context_t *ct)
-{
-}
-
-static void VBoxVFS_Rwunlock(vnode_t *vp, int write_lock, caller_context_t *ct)
-{
-}
-
-static int VBoxVFS_Seek(vnode_t *vp, offset_t ooff, offset_t *noffp, caller_context_t *ct)
-{
-}
-
-static int VBoxVFS_Cmp(vnode_t *vp1, vnode_t *vp2, caller_context_t *ct)
-{
-}
-
-static int VBoxVFS_Frlock(vnode_t *vp, int cmd, struct flock64 *bfp, int flag, offset_t offset, struct flk_callback *flk_cbp,
-                cred_t *cr, caller_context_t *ct)
-{
-}
-
-static int VBoxVFS_Space(vnode_t *vp, int cmd, struct flock64 *bfp, int flag, offset_t offset, struct cred *cr,
-                caller_context_t *ct)
-{
-}
-
-static int VBoxVFS_Getpage(vnode_t *vp, offset_t off, size_t len, uint_t *prot, struct page *parr[], size_t psz,
-                struct seg *seg, caddr_t addr, enum seg_rw rw, struct cred *cr, caller_context_t *ct)
-{
-}
-
-static int VBoxVFS_Putpage(vnode_t *vp, offset_t off, size_t len, int flags, struct cred *cr, caller_context_t *ct)
-{
-}
-
-static int VBoxVFS_Map(vnode_t *vp, offset_t off, struct as *as, caddr_t *addrp, size_t len, uchar_t prot,
-                uchar_t maxprot, uint_t flags, struct cred *cr, caller_context_t *ct)
-{
-}
-
-static int VBoxVFS_Addmap(vnode_t *vp, offset_t off, struct as *as, caddr_t addr, size_t len, uchar_t prot,
-                uchar_t maxprot, uint_t flags, struct cred *cr, caller_context_t *ct)
-{
-}
-
-static int VBoxVFS_Delmap(vnode_t *vp, offset_t off, struct as *as, caddr_t addr, size_t len, uint_t prot, uint_t maxprot,
-            uint_t flags, struct cred *cr, caller_context_t *ct)
-{
-}
-
-static int VBoxVFS_Pathconf(vnode_t *vp, int cmd, ulong_t *valp, struct cred *cr, caller_context_t *ct)
-{
-}
-
-static int VBoxVFS_Shrlock(vnode_t *vp, int cmd, struct shrlock *shr, int flag, cred_t *cr, caller_context_t *ct)
-{
-}
-
-/**
- * VBoxVFS: vnode operations vector.
- */
-struct vnodeops *g_pVBoxVFS_vnodeops;
-
-const fs_operation_def_t g_VBoxVFS_vnodeops_template[] =
-{
-    VOPNAME_OPEN,        { .vop_open = VBoxVFS_Open },
-    VOPNAME_CLOSE,       { .vop_close = VBoxVFS_Close },
-    VOPNAME_READ,        { .vop_read = VBoxVFS_Read },
-    VOPNAME_WRITE,       { .vop_write = VBoxVFS_Write },
-    VOPNAME_IOCTL,       { .vop_ioctl = VBoxVFS_IOCtl },
-    VOPNAME_SETFL,       { .vop_setfl = VBoxVFS_Setfl },
-    VOPNAME_GETATTR,     { .vop_getattr = VBoxVFS_Getattr },
-    VOPNAME_SETATTR,     { .vop_setattr = VBoxVFS_Setattr },
-    VOPNAME_ACCESS,      { .vop_access = VBoxVFS_Access },
-    VOPNAME_LOOKUP,      { .vop_lookup = VBoxVFS_Lookup },
-    VOPNAME_CREATE,      { .vop_create = VBoxVFS_Create },
-    VOPNAME_REMOVE,      { .vop_remove = VBoxVFS_Remove },
-    VOPNAME_LINK,        { .vop_link = VBoxVFS_Link },
-    VOPNAME_RENAME,      { .vop_rename = VBoxVFS_Rename },
-    VOPNAME_MKDIR,       { .vop_mkdir = VBoxVFS_Mkdir },
-    VOPNAME_RMDIR,       { .vop_rmdir = VBoxVFS_Rmdir },
-    VOPNAME_READDIR,     { .vop_readdir = VBoxVFS_Readdir },
-    VOPNAME_SYMLINK,     { .vop_symlink = VBoxVFS_Symlink },
-    VOPNAME_READLINK,    { .vop_readlink = VBoxVFS_Readlink },
-    VOPNAME_FSYNC,       { .vop_fsync = VBoxVFS_Fsync },
-    VOPNAME_INACTIVE,    { .vop_inactive = VBoxVFS_Inactive },
-    VOPNAME_FID,         { .vop_fid = VBoxVFS_Fid },
-    VOPNAME_RWLOCK,      { .vop_rwlock = VBoxVFS_Rwlock },
-    VOPNAME_RWUNLOCK,    { .vop_rwunlock = VBoxVFS_Rwunlock },
-    VOPNAME_SEEK,        { .vop_seek = VBoxVFS_Seek },
-    VOPNAME_CMP,         { .vop_cmp = VBoxVFS_Cmp },
-    VOPNAME_FRLOCK,      { .vop_frlock = VBoxVFS_Frlock },
-    VOPNAME_SPACE,       { .vop_space = VBoxVFS_Space },
-    VOPNAME_REALVP,      { .vop_realvp = VBoxVFS_Realvp },
-    VOPNAME_GETPAGE,     { .vop_getpage = VBoxVFS_Getpage },
-    VOPNAME_PUTPAGE,     { .vop_putpage = VBoxVFS_Putpage },
-    VOPNAME_MAP,         { .vop_map = VBoxVFS_Map },
-    VOPNAME_ADDMAP,      { .vop_addmap = VBoxVFS_Addmap },
-    VOPNAME_DELMAP,      { .vop_delmap = VBoxVFS_Delmap },
-    VOPNAME_PATHCONF,    { .vop_pathconf = VBoxVFS_Pathconf },
-    VOPNAME_SHRLOCK,     { .vop_shrlock = VBoxVFS_Shrlock },
-    NULL,                NULL
-};
-
