VirtualBox

Changeset 77524 in vbox for trunk/src


Ignore:
Timestamp:
Mar 1, 2019 11:58:24 AM (6 years ago)
Author:
vboxsync
Message:

linux/vboxsf: Code cleanups in the super block info area. bugref:9172

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

Legend:

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

    r77502 r77524  
    3939 *       reading in the whole directory on open.
    4040 */
    41 static int sf_dir_open_worker(struct sf_glob_info *sf_g, struct sf_dir_info *sf_d,
     41static int sf_dir_open_worker(struct vbsf_super_info *sf_g, struct sf_dir_info *sf_d,
    4242                              struct sf_inode_info *sf_i, const char *pszCaller)
    4343{
     
    113113static int sf_dir_open(struct inode *inode, struct file *file)
    114114{
     115        struct vbsf_super_info *sf_g = VBSF_GET_SUPER_INFO(inode->i_sb);
     116        struct sf_inode_info *sf_i = GET_INODE_INFO(inode);
     117        struct sf_dir_info *sf_d;
    115118        int err;
    116         struct sf_glob_info *sf_g = GET_GLOB_INFO(inode->i_sb);
    117         struct sf_dir_info *sf_d;
    118         struct sf_inode_info *sf_i = GET_INODE_INFO(inode);
    119119
    120120        TRACE();
     
    209209{
    210210        loff_t cur;
    211         struct sf_glob_info *sf_g;
     211        struct vbsf_super_info *sf_g;
    212212        struct sf_dir_info *sf_d;
    213213        struct sf_inode_info *sf_i;
     
    219219        inode = GET_F_DENTRY(dir)->d_inode;
    220220        sf_i = GET_INODE_INFO(inode);
    221         sf_g = GET_GLOB_INFO(inode->i_sb);
     221        sf_g = VBSF_GET_SUPER_INFO(inode->i_sb);
    222222        sf_d = dir->private_data;
    223223
     
    382382 */
    383383static struct inode *sf_create_inode(struct inode *parent, struct dentry *dentry, PSHFLSTRING path,
    384                                      PSHFLFSOBJINFO pObjInfo, struct sf_glob_info *sf_g, bool fInstantiate)
     384                                     PSHFLFSOBJINFO pObjInfo, struct vbsf_super_info *sf_g, bool fInstantiate)
    385385{
    386386        /*
     
    447447    )
    448448{
    449         struct sf_glob_info  *sf_g = GET_GLOB_INFO(parent->i_sb);
    450         struct sf_inode_info *sf_i = GET_INODE_INFO(parent);
    451         SHFLSTRING           *path;
    452         struct dentry        *dret;
    453         int                   rc;
     449        struct vbsf_super_info *sf_g = VBSF_GET_SUPER_INFO(parent->i_sb);
     450        struct sf_inode_info     *sf_i = GET_INODE_INFO(parent);
     451        SHFLSTRING               *path;
     452        struct dentry            *dret;
     453        int                       rc;
    454454
    455455#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
     
    551551                          SHFLHANDLE handle)
    552552{
    553         struct sf_glob_info *sf_g   = GET_GLOB_INFO(parent->i_sb);
    554         struct inode        *pInode = sf_create_inode(parent, dentry, path, info, sf_g, true /*fInstantiate*/);
     553        struct vbsf_super_info *sf_g   = VBSF_GET_SUPER_INFO(parent->i_sb);
     554        struct inode             *pInode = sf_create_inode(parent, dentry, path, info, sf_g, true /*fInstantiate*/);
    555555        if (pInode) {
    556556                /* Store this handle if we leave the handle open. */
     
    576576        int rc, err;
    577577        struct sf_inode_info *sf_parent_i = GET_INODE_INFO(parent);
    578         struct sf_glob_info *sf_g = GET_GLOB_INFO(parent->i_sb);
     578        struct vbsf_super_info *sf_g = VBSF_GET_SUPER_INFO(parent->i_sb);
    579579        SHFLSTRING *path;
    580580        union CreateAuxReq
     
    730730{
    731731        int rc, err;
    732         struct sf_glob_info *sf_g = GET_GLOB_INFO(parent->i_sb);
     732        struct vbsf_super_info *sf_g = VBSF_GET_SUPER_INFO(parent->i_sb);
    733733        struct sf_inode_info *sf_parent_i = GET_INODE_INFO(parent);
    734734        SHFLSTRING *path;
     
    822822{
    823823        int err = 0, rc = VINF_SUCCESS;
    824         struct sf_glob_info *sf_g = GET_GLOB_INFO(old_parent->i_sb);
     824        struct vbsf_super_info *sf_g = VBSF_GET_SUPER_INFO(old_parent->i_sb);
    825825
    826826        TRACE();
     
    833833#endif
    834834
    835         if (sf_g != GET_GLOB_INFO(new_parent->i_sb)) {
     835        if (sf_g != VBSF_GET_SUPER_INFO(new_parent->i_sb)) {
    836836                LogFunc(("rename with different roots\n"));
    837837                err = -EINVAL;
     
    895895        int rc;
    896896        struct sf_inode_info *sf_i;
    897         struct sf_glob_info *sf_g;
     897        struct vbsf_super_info *sf_g;
    898898        SHFLSTRING *path, *ssymname;
    899899        SHFLFSOBJINFO info;
     
    901901
    902902        TRACE();
    903         sf_g = GET_GLOB_INFO(parent->i_sb);
     903        sf_g = VBSF_GET_SUPER_INFO(parent->i_sb);
    904904        sf_i = GET_INODE_INFO(parent);
    905905
  • trunk/src/VBox/Additions/linux/sharedfolders/lnkops.c

    r77424 r77524  
    4343{
    4444        struct inode *inode = dentry->d_inode;
    45         struct sf_glob_info *sf_g = GET_GLOB_INFO(inode->i_sb);
     45        struct vbsf_super_info *sf_g = VBSF_GET_SUPER_INFO(inode->i_sb);
    4646        struct sf_inode_info *sf_i = GET_INODE_INFO(inode);
    4747        int error = -ENOMEM;
     
    8989                               struct delayed_call *done)
    9090{
    91         struct sf_glob_info *sf_g = GET_GLOB_INFO(inode->i_sb);
     91        struct vbsf_super_info *sf_g = VBSF_GET_SUPER_INFO(inode->i_sb);
    9292        struct sf_inode_info *sf_i = GET_INODE_INFO(inode);
    9393        char *path;
  • trunk/src/VBox/Additions/linux/sharedfolders/regops.c

    r77515 r77524  
    121121 * @param   pszCaller       The caller name (for logging failures).
    122122 */
    123 uint32_t sf_handle_release_slow(struct sf_handle *pHandle, struct sf_glob_info *sf_g, const char *pszCaller)
     123uint32_t sf_handle_release_slow(struct sf_handle *pHandle, struct vbsf_super_info *sf_g, const char *pszCaller)
    124124{
    125125        int rc;
     
    247247};
    248248
    249 static int sf_reg_read_aux(const char *caller, struct sf_glob_info *sf_g,
     249static int sf_reg_read_aux(const char *caller, struct vbsf_super_info *sf_g,
    250250                           struct sf_reg_info *sf_r, void *buf,
    251251                           uint32_t * nread, uint64_t pos)
     
    272272        loff_t offset = orig_offset;
    273273        struct inode *inode = GET_F_DENTRY(in)->d_inode;
    274         struct sf_glob_info *sf_g = GET_GLOB_INFO(inode->i_sb);
     274        struct vbsf_super_info *sf_g = VBSF_GET_SUPER_INFO(inode->i_sb);
    275275        struct sf_reg_info *sf_r = in->private_data;
    276276        ssize_t retval;
     
    456456 */
    457457static ssize_t sf_reg_read_fallback(struct file *file, char /*__user*/ *buf, size_t size, loff_t *off,
    458                                     struct sf_glob_info *sf_g, struct sf_reg_info *sf_r)
     458                                    struct vbsf_super_info *sf_g, struct sf_reg_info *sf_r)
    459459{
    460460        /*
     
    573573{
    574574        struct inode *inode = GET_F_DENTRY(file)->d_inode;
    575         struct sf_glob_info *sf_g = GET_GLOB_INFO(inode->i_sb);
     575        struct vbsf_super_info *sf_g = VBSF_GET_SUPER_INFO(inode->i_sb);
    576576        struct sf_reg_info *sf_r = file->private_data;
    577577        struct address_space *mapping = inode->i_mapping;
     
    697697static ssize_t sf_reg_write_fallback(struct file *file, const char /*__user*/ *buf, size_t size, loff_t *off, loff_t offFile,
    698698                                     struct inode *inode, struct sf_inode_info *sf_i,
    699                                      struct sf_glob_info *sf_g, struct sf_reg_info *sf_r)
     699                                     struct vbsf_super_info *sf_g, struct sf_reg_info *sf_r)
    700700{
    701701        /*
     
    816816                            loff_t * off)
    817817{
    818         struct inode         *inode = GET_F_DENTRY(file)->d_inode;
    819         struct sf_inode_info *sf_i = GET_INODE_INFO(inode);
    820         struct sf_glob_info  *sf_g = GET_GLOB_INFO(inode->i_sb);
    821         struct sf_reg_info   *sf_r = file->private_data;
    822         struct address_space *mapping = inode->i_mapping;
    823         loff_t                pos;
     818        struct inode           *inode  = GET_F_DENTRY(file)->d_inode;
     819        struct sf_inode_info   *sf_i    = GET_INODE_INFO(inode);
     820        struct vbsf_super_info *sf_g    = VBSF_GET_SUPER_INFO(inode->i_sb);
     821        struct sf_reg_info     *sf_r    = file->private_data;
     822        struct address_space   *mapping = inode->i_mapping;
     823        loff_t                  pos;
    824824
    825825        SFLOGFLOW(("sf_reg_write: inode=%p file=%p buf=%p size=%#zx off=%#llx\n", inode, file, buf, size, *off));
     
    948948{
    949949        int rc, rc_linux = 0;
    950         struct sf_glob_info *sf_g = GET_GLOB_INFO(inode->i_sb);
     950        struct vbsf_super_info *sf_g = VBSF_GET_SUPER_INFO(inode->i_sb);
    951951        struct sf_inode_info *sf_i = GET_INODE_INFO(inode);
    952952        struct sf_reg_info *sf_r;
     
    11101110{
    11111111        struct sf_reg_info *sf_r;
    1112         struct sf_glob_info *sf_g;
     1112        struct vbsf_super_info *sf_g;
    11131113        struct sf_inode_info *sf_i = GET_INODE_INFO(inode);
    11141114
    11151115        SFLOGFLOW(("sf_reg_release: inode=%p file=%p\n", inode, file));
    1116         sf_g = GET_GLOB_INFO(inode->i_sb);
     1116        sf_g = VBSF_GET_SUPER_INFO(inode->i_sb);
    11171117        sf_r = file->private_data;
    11181118
     
    12831283            VBOXSFREADPGLSTREQ *pReq = (VBOXSFREADPGLSTREQ *)VbglR0PhysHeapAlloc(sizeof(*pReq));
    12841284            if (pReq) {
    1285                     struct sf_glob_info *sf_g     = GET_GLOB_INFO(inode->i_sb);
    1286                     struct sf_reg_info  *sf_r    = file->private_data;
    1287                     uint32_t             cbRead;
    1288                     int                  vrc;
     1285                    struct vbsf_super_info *sf_g = VBSF_GET_SUPER_INFO(inode->i_sb);
     1286                    struct sf_reg_info     *sf_r = file->private_data;
     1287                    uint32_t                cbRead;
     1288                    int                     vrc;
    12891289
    12901290                    pReq->PgLst.offFirstPage = 0;
     
    13431343
    13441344        if (pHandle) {
    1345                 struct sf_glob_info  *sf_g = GET_GLOB_INFO(inode->i_sb);
    1346                 VBOXSFWRITEPGLSTREQ  *pReq = (VBOXSFWRITEPGLSTREQ *)VbglR0PhysHeapAlloc(sizeof(*pReq));
     1345                struct vbsf_super_info *sf_g = VBSF_GET_SUPER_INFO(inode->i_sb);
     1346                VBOXSFWRITEPGLSTREQ    *pReq = (VBOXSFWRITEPGLSTREQ *)VbglR0PhysHeapAlloc(sizeof(*pReq));
    13471347                if (pReq) {
    13481348                        uint64_t const cbFile    = i_size_read(inode);
  • trunk/src/VBox/Additions/linux/sharedfolders/utils.c

    r77523 r77524  
    120120 * Initializes the @a inode attributes based on @a pObjInfo and @a sf_g options.
    121121 */
    122 void sf_init_inode(struct inode *inode, struct sf_inode_info *sf_i, PSHFLFSOBJINFO pObjInfo, struct sf_glob_info *sf_g)
     122void sf_init_inode(struct inode *inode, struct sf_inode_info *sf_i, PSHFLFSOBJINFO pObjInfo, struct vbsf_super_info *sf_g)
    123123{
    124124        PCSHFLFSOBJATTR pAttr = &pObjInfo->Attr;
     
    193193 */
    194194static void sf_update_inode(struct inode *pInode, struct sf_inode_info *pInodeInfo, PSHFLFSOBJINFO pObjInfo,
    195                             struct sf_glob_info *sf_g, bool fInodeLocked)
     195                            struct vbsf_super_info *sf_g, bool fInodeLocked)
    196196{
    197197        PCSHFLFSOBJATTR pAttr = &pObjInfo->Attr;
     
    267267
    268268/** @note Currently only used for the root directory during (re-)mount.  */
    269 int sf_stat(const char *caller, struct sf_glob_info *sf_g,
     269int sf_stat(const char *caller, struct vbsf_super_info *sf_g,
    270270            SHFLSTRING *path, PSHFLFSOBJINFO result, int ok_to_fail)
    271271{
     
    318318        struct inode *pInode = dentry ? dentry->d_inode : NULL;
    319319        if (pInode) {
    320                 struct sf_inode_info *sf_i = GET_INODE_INFO(pInode);
    321                 struct sf_glob_info  *sf_g = GET_GLOB_INFO(pInode->i_sb);
     320                struct sf_inode_info   *sf_i = GET_INODE_INFO(pInode);
     321                struct vbsf_super_info *sf_g = VBSF_GET_SUPER_INFO(pInode->i_sb);
    322322                AssertReturn(sf_i, -EINVAL);
    323323                AssertReturn(sf_g, -EINVAL);
     
    427427                err = -EINVAL;
    428428        } else {
    429                 struct sf_inode_info *sf_i = GET_INODE_INFO(pInode);
    430                 struct sf_glob_info  *sf_g = GET_GLOB_INFO(pInode->i_sb);
     429                struct sf_inode_info   *sf_i = GET_INODE_INFO(pInode);
     430                struct vbsf_super_info *sf_g = VBSF_GET_SUPER_INFO(pInode->i_sb);
    431431                AssertReturn(sf_i, -EINVAL);
    432432                AssertReturn(sf_g, -EINVAL);
     
    554554int sf_setattr(struct dentry *dentry, struct iattr *iattr)
    555555{
    556         struct sf_glob_info *sf_g;
     556        struct vbsf_super_info *sf_g;
    557557        struct sf_inode_info *sf_i;
    558558        union SetAttrReqs
     
    572572        TRACE();
    573573
    574         sf_g = GET_GLOB_INFO(dentry->d_inode->i_sb);
     574        sf_g = VBSF_GET_SUPER_INFO(dentry->d_inode->i_sb);
    575575        sf_i = GET_INODE_INFO(dentry->d_inode);
    576576        cbReq = RT_MAX(sizeof(pReq->Info), sizeof(pReq->Create) + SHFLSTRING_HEADER_SIZE + sf_i->path->u16Size);
     
    741741 * [sf_make_path] which will allocate SHFLSTRING and fill it in
    742742 */
    743 int sf_path_from_dentry(const char *caller, struct sf_glob_info *sf_g,
     743int sf_path_from_dentry(const char *caller, struct vbsf_super_info *sf_g,
    744744                        struct sf_inode_info *sf_i, struct dentry *dentry,
    745745                        SHFLSTRING ** result)
     
    821821}
    822822
    823 int sf_nlscpy(struct sf_glob_info *sf_g,
     823int sf_nlscpy(struct vbsf_super_info *sf_g,
    824824              char *name, size_t name_bound_len,
    825825              const unsigned char *utf8_name, size_t utf8_len)
     
    992992/** @todo r=bird: Why on earth do we read in the entire directory???  This
    993993 *        cannot be healthy for like big directory and such... */
    994 int sf_dir_read_all(struct sf_glob_info *sf_g, struct sf_inode_info *sf_i,
     994int sf_dir_read_all(struct vbsf_super_info *sf_g, struct sf_inode_info *sf_i,
    995995                    struct sf_dir_info *sf_d, SHFLHANDLE handle)
    996996{
     
    11001100                         */
    11011101                        //struct sf_inode_info *sf_i = GET_INODE_INFO(pInode);
    1102                         unsigned long const  cJiffiesAge = sf_dentry_get_update_jiffies(dentry) - jiffies;
    1103                         struct sf_glob_info *sf_g        = GET_GLOB_INFO(dentry->d_sb);
     1102                        unsigned long const     cJiffiesAge = sf_dentry_get_update_jiffies(dentry) - jiffies;
     1103                        struct vbsf_super_info *sf_g        = VBSF_GET_SUPER_INFO(dentry->d_sb);
    11041104                        if (cJiffiesAge < sf_g->ttl) {
    11051105                                SFLOGFLOW(("sf_dentry_revalidate: age: %lu vs. TTL %lu -> 1\n", cJiffiesAge, sf_g->ttl));
     
    11341134                        } else {
    11351135                                /* Can we skip revalidation based on TTL? */
    1136                                 unsigned long const  cJiffiesAge = sf_dentry_get_update_jiffies(dentry) - jiffies;
    1137                                 struct sf_glob_info *sf_g        = GET_GLOB_INFO(dentry->d_sb);
     1136                                unsigned long const     cJiffiesAge = sf_dentry_get_update_jiffies(dentry) - jiffies;
     1137                                struct vbsf_super_info *sf_g        = VBSF_GET_SUPER_INFO(dentry->d_sb);
    11381138                                if (cJiffiesAge < sf_g->ttl) {
    11391139                                        SFLOGFLOW(("sf_dentry_revalidate: negative: age: %lu vs. TTL %lu -> 1\n", cJiffiesAge, sf_g->ttl));
  • trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.c

    r77523 r77524  
    7777 * Copies options from the mount info structure into @a sf_g.
    7878 *
    79  * This is used both by sf_glob_alloc() and sf_remount_fs().
    80  */
    81 static void sf_glob_copy_remount_options(struct sf_glob_info *sf_g, struct vbsf_mount_info_new *info)
     79 * This is used both by sf_super_info_alloc() and sf_remount_fs().
     80 */
     81static void sf_super_info_copy_remount_options(struct vbsf_super_info *sf_g, struct vbsf_mount_info_new *info)
    8282{
    8383        sf_g->ttl_msec = info->ttl;
     
    130130}
    131131
    132 /* allocate global info, try to map host share */
    133 static int sf_glob_alloc(struct vbsf_mount_info_new *info,
    134                          struct sf_glob_info **sf_gp)
     132/* allocate super info, try to map host share */
     133static int sf_super_info_alloc(struct vbsf_mount_info_new *info, struct vbsf_super_info **sf_gp)
    135134{
    136135        int err, rc;
    137136        SHFLSTRING *str_name;
    138137        size_t name_len, str_len;
    139         struct sf_glob_info *sf_g;
     138        struct vbsf_super_info *sf_g;
    140139
    141140        TRACE();
     
    143142        if (!sf_g) {
    144143                err = -ENOMEM;
    145                 LogRelFunc(("could not allocate memory for global info\n"));
     144                LogRelFunc(("could not allocate memory for super info\n"));
    146145                goto fail0;
    147146        }
     
    218217
    219218        /* The rest is shared with remount. */
    220         sf_glob_copy_remount_options(sf_g, info);
     219        sf_super_info_copy_remount_options(sf_g, info);
    221220
    222221        *sf_gp = sf_g;
     
    234233}
    235234
    236 /* unmap the share and free global info [sf_g] */
    237 static void sf_glob_free(struct sf_glob_info *sf_g)
     235/* unmap the share and free super info [sf_g] */
     236static void sf_super_info_free(struct vbsf_super_info *sf_g)
    238237{
    239238        int rc;
     
    254253 * Initialize backing device related matters.
    255254 */
    256 static int sf_init_backing_dev(struct super_block *sb, struct sf_glob_info *sf_g)
     255static int sf_init_backing_dev(struct super_block *sb, struct vbsf_super_info *sf_g)
    257256{
    258257        int rc = 0;
     
    322321 * Undoes what sf_init_backing_dev did.
    323322 */
    324 static void sf_done_backing_dev(struct super_block *sb, struct sf_glob_info *sf_g)
     323static void sf_done_backing_dev(struct super_block *sb, struct vbsf_super_info *sf_g)
    325324{
    326325#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) && LINUX_VERSION_CODE <= KERNEL_VERSION(3, 19, 0)
     
    334333 * the fs and wants to read super_block.
    335334 *
    336  * calls [sf_glob_alloc] to map the folder and allocate global
    337  * information structure.
    338  *
    339  * initializes [sb], initializes root inode and dentry.
    340  *
    341  * should respect [flags]
     335 * Calls sf_super_info_alloc() to map the folder and allocate super information
     336 * structure.
     337 *
     338 * Initializes @a sb, initializes root inode and dentry.
     339 *
     340 * Should respect @a flags.
    342341 */
    343342static int sf_read_super_aux(struct super_block *sb, void *data, int flags)
     
    347346        struct inode *iroot;
    348347        struct sf_inode_info *sf_i;
    349         struct sf_glob_info *sf_g;
     348        struct vbsf_super_info *sf_g;
    350349        SHFLFSOBJINFO fsinfo;
    351350        struct vbsf_mount_info_new *info;
     
    365364        }
    366365
    367         err = sf_glob_alloc(info, &sf_g);
     366        err = sf_super_info_alloc(info, &sf_g);
    368367        if (err)
    369368                goto fail0;
     
    459458
    460459        sb->s_root = droot;
    461         SET_GLOB_INFO(sb, sf_g);
     460        VBSF_SET_SUPER_INFO(sb, sf_g);
    462461        return 0;
    463462
     
    476475
    477476 fail1:
    478         sf_glob_free(sf_g);
     477        sf_super_info_free(sf_g);
    479478
    480479 fail0:
     
    539538
    540539
    541 /* vfs is done with [sb] (umount called) call [sf_glob_free] to unmap
     540/* vfs is done with [sb] (umount called) call [sf_super_info_free] to unmap
    542541   the folder and free [sf_g] */
    543542static void sf_put_super(struct super_block *sb)
    544543{
    545         struct sf_glob_info *sf_g;
    546 
    547         sf_g = GET_GLOB_INFO(sb);
     544        struct vbsf_super_info *sf_g;
     545
     546        sf_g = VBSF_GET_SUPER_INFO(sb);
    548547        BUG_ON(!sf_g);
    549548        sf_done_backing_dev(sb, sf_g);
    550         sf_glob_free(sf_g);
     549        sf_super_info_free(sf_g);
    551550}
    552551
     
    569568        VBOXSFVOLINFOREQ *pReq = (VBOXSFVOLINFOREQ *)VbglR0PhysHeapAlloc(sizeof(*pReq));
    570569        if (pReq) {
    571                 SHFLVOLINFO         *pVolInfo = &pReq->VolInfo;
    572                 struct sf_glob_info *sf_g     = GET_GLOB_INFO(sb);
     570                SHFLVOLINFO            *pVolInfo = &pReq->VolInfo;
     571                struct vbsf_super_info *sf_g     = VBSF_GET_SUPER_INFO(sb);
    573572                rc = VbglR0SfHostReqQueryVolInfo(sf_g->map.root, pReq, SHFL_HANDLE_ROOT);
    574573                if (RT_SUCCESS(rc)) {
     
    606605{
    607606#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 23)
    608         struct sf_glob_info *sf_g;
     607        struct vbsf_super_info *sf_g;
    609608        struct sf_inode_info *sf_i;
    610609        struct inode *iroot;
     
    612611        int err;
    613612
    614         sf_g = GET_GLOB_INFO(sb);
     613        sf_g = VBSF_GET_SUPER_INFO(sb);
    615614        BUG_ON(!sf_g);
    616615        if (data && data[0] != 0) {
     
    620619                    && info->signature[1] == VBSF_MOUNT_SIGNATURE_BYTE_1
    621620                    && info->signature[2] == VBSF_MOUNT_SIGNATURE_BYTE_2) {
    622                         sf_glob_copy_remount_options(sf_g, info);
     621                        sf_super_info_copy_remount_options(sf_g, info);
    623622                }
    624623        }
     
    657656        struct super_block *sb = root->d_sb;
    658657#endif
    659         struct sf_glob_info *sf_g = GET_GLOB_INFO(sb);
     658        struct vbsf_super_info *sf_g = VBSF_GET_SUPER_INFO(sb);
    660659        if (sf_g) {
    661660                seq_printf(m, ",uid=%u,gid=%u,ttl=%d,dmode=0%o,fmode=0%o,dmask=0%o,fmask=0%o,maxiopages=%u",
  • trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.h

    r77523 r77524  
    8585#define DIR_BUFFER_SIZE (16*_1K)
    8686
    87 /* per-shared folder information */
    88 struct sf_glob_info {
     87/**
     88 * VBox specific per-mount (shared folder) information.
     89 */
     90struct vbsf_super_info {
    8991        VBGLSFMAP map;
    9092        struct nls_table *nls;
     
    103105         * This applies to read and write operations.  */
    104106        uint32_t cMaxIoPages;
     107        /** Mount tag for VBoxService automounter.  @since 6.0 */
     108        char tag[32];
    105109#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
     110        /** The backing device info structure. */
    106111        struct backing_dev_info bdi;
    107112#endif
    108         char tag[32];           /**< Mount tag for VBoxService automounter.  @since 6.0 */
    109 };
     113};
     114
     115/* Following casts are here to prevent assignment of void * to
     116   pointers of arbitrary type */
     117#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
     118# define VBSF_GET_SUPER_INFO(sb)       ((struct vbsf_super_info *)(sb)->u.generic_sbp)
     119# define VBSF_SET_SUPER_INFO(sb, sf_g) do { (sb)->u.generic_sbp = sf_g; } while (0)
     120#else
     121# define VBSF_GET_SUPER_INFO(sb)       ((struct vbsf_super_info *)(sb)->s_fs_info)
     122# define VBSF_SET_SUPER_INFO(sb, sf_g) do { (sb)->s_fs_info = sf_g;} while (0)
     123#endif
     124
    110125
    111126/**
     
    196211 * Sets the update-jiffies value for a dentry.
    197212 *
    198  * This is used together with sf_glob_info::ttl to reduce re-validation of
     213 * This is used together with vbsf_super_info::ttl to reduce re-validation of
    199214 * dentry structures while walking.
    200215 *
     
    265280extern void              sf_handle_drop_chain(struct sf_inode_info *pInodeInfo);
    266281extern struct sf_handle *sf_handle_find(struct sf_inode_info *pInodeInfo, uint32_t fFlagsSet, uint32_t fFlagsClear);
    267 extern uint32_t          sf_handle_release_slow(struct sf_handle *pHandle, struct sf_glob_info *sf_g, const char *pszCaller);
     282extern uint32_t          sf_handle_release_slow(struct sf_handle *pHandle, struct vbsf_super_info *sf_g, const char *pszCaller);
    268283extern void              sf_handle_append(struct sf_inode_info *pInodeInfo, struct sf_handle *pHandle);
    269284
     
    277292 * @param   pszCaller       The caller name (for logging failures).
    278293 */
    279 DECLINLINE(uint32_t) sf_handle_release(struct sf_handle *pHandle, struct sf_glob_info *sf_g, const char *pszCaller)
     294DECLINLINE(uint32_t) sf_handle_release(struct sf_handle *pHandle, struct vbsf_super_info *sf_g, const char *pszCaller)
    280295{
    281296        uint32_t cRefs;
     
    292307}
    293308
    294 extern void sf_init_inode(struct inode *inode, struct sf_inode_info *sf_i, PSHFLFSOBJINFO info, struct sf_glob_info *sf_g);
    295 extern int sf_stat(const char *caller, struct sf_glob_info *sf_g,
     309extern void sf_init_inode(struct inode *inode, struct sf_inode_info *sf_i, PSHFLFSOBJINFO info, struct vbsf_super_info *sf_g);
     310extern int sf_stat(const char *caller, struct vbsf_super_info *sf_g,
    296311                   SHFLSTRING * path, PSHFLFSOBJINFO result, int ok_to_fail);
    297312extern int sf_inode_revalidate(struct dentry *dentry);
     
    308323extern int sf_setattr(struct dentry *dentry, struct iattr *iattr);
    309324#endif
    310 extern int sf_path_from_dentry(const char *caller, struct sf_glob_info *sf_g,
     325extern int sf_path_from_dentry(const char *caller, struct vbsf_super_info *sf_g,
    311326                               struct sf_inode_info *sf_i,
    312327                               struct dentry *dentry, SHFLSTRING ** result);
    313 extern int sf_nlscpy(struct sf_glob_info *sf_g, char *name,
     328extern int sf_nlscpy(struct vbsf_super_info *sf_g, char *name,
    314329                     size_t name_bound_len, const unsigned char *utf8_name,
    315330                     size_t utf8_len);
     
    317332extern void sf_dir_info_empty(struct sf_dir_info *p);
    318333extern struct sf_dir_info *sf_dir_info_alloc(void);
    319 extern int sf_dir_read_all(struct sf_glob_info *sf_g,
     334extern int sf_dir_read_all(struct vbsf_super_info *sf_g,
    320335                           struct sf_inode_info *sf_i, struct sf_dir_info *sf_d,
    321336                           SHFLHANDLE handle);
     
    339354#endif
    340355
    341 /* Following casts are here to prevent assignment of void * to
    342    pointers of arbitrary type */
    343 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
    344 # define GET_GLOB_INFO(sb)       ((struct sf_glob_info *) (sb)->u.generic_sbp)
    345 # define SET_GLOB_INFO(sb, sf_g) (sb)->u.generic_sbp = sf_g
    346 #else
    347 # define GET_GLOB_INFO(sb)       ((struct sf_glob_info *) (sb)->s_fs_info)
    348 # define SET_GLOB_INFO(sb, sf_g) (sb)->s_fs_info = sf_g
    349 #endif
    350 
    351356#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) || defined(KERNEL_FC6)
    352357/* FC6 kernel 2.6.18, vanilla kernel 2.6.19+ */
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