VirtualBox

Changeset 38811 in vbox for trunk/src/VBox/Additions/linux


Ignore:
Timestamp:
Sep 21, 2011 6:50:36 AM (13 years ago)
Author:
vboxsync
Message:

Additions/linux/sharedfolders: use a unique identifier rather than the share name when creating the backing device

Location:
trunk/src/VBox/Additions/linux/sharedfolders
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/sharedfolders/utils.c

    r33994 r38811  
    1919
    2020#include "vfsmod.h"
     21#include <iprt/asm.h>
    2122#include <linux/nfs_fs.h>
    2223#include <linux/vfs.h>
     
    828829};
    829830
    830 int sf_init_backing_dev(struct sf_glob_info *sf_g, const char *name)
     831int sf_init_backing_dev(struct sf_glob_info *sf_g)
    831832{
    832833    int rc = 0;
     834    /* Each new shared folder map gets a new uint64_t identifier,
     835     * allocated in sequence.  We ASSUME the sequence will not wrap. */
     836    static uint64_t s_u64Sequence = 0;
     837    uint64_t u64CurrentSequence = ASMAtomicIncU64(&s_u64Sequence);
    833838
    834839#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
     
    845850#  if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
    846851    if (!rc)
    847         rc = bdi_register(&sf_g->bdi, NULL, "vboxsf-%s", name);
     852        rc = bdi_register(&sf_g->bdi, NULL, "vboxsf-%llu",
     853                          (unsigned long long)u64CurrentSequence);
    848854#  endif /* >= 2.6.26 */
    849855# endif /* >= 2.6.24 */
  • trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.c

    r38806 r38811  
    278278    }
    279279
    280     if (sf_init_backing_dev(sf_g, info->name))
     280    if (sf_init_backing_dev(sf_g))
    281281    {
    282282        err = -EINVAL;
  • trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.h

    r38736 r38811  
    118118extern int  sf_dir_read_all(struct sf_glob_info *sf_g, struct sf_inode_info *sf_i,
    119119                            struct sf_dir_info *sf_d, SHFLHANDLE handle);
    120 extern int  sf_init_backing_dev(struct sf_glob_info *sf_g, const char *name);
     120extern int  sf_init_backing_dev(struct sf_glob_info *sf_g);
    121121extern void sf_done_backing_dev(struct sf_glob_info *sf_g);
    122122
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette