VirtualBox

Ignore:
Timestamp:
Mar 3, 2019 4:42:04 AM (6 years ago)
Author:
vboxsync
Message:

linux/vboxsf: Some cleanups and logging in dirops.c. bugref:9172

File:
1 edited

Legend:

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

    r77539 r77543  
    3434
    3535/**
    36  * Open a directory.
    37  *
    38  * @param inode     inode
    39  * @param file      file
    40  * @returns 0 on success, Linux error code otherwise
     36 * Open a directory (implements file_operations::open).
     37 *
     38 * @returns 0 on success, negative errno otherwise.
     39 * @param   inode   inode
     40 * @param   file    file
    4141 */
    4242static int vbsf_dir_open(struct inode *inode, struct file *file)
    4343{
    44     struct vbsf_super_info *sf_g = VBSF_GET_SUPER_INFO(inode->i_sb);
    45     struct vbsf_inode_info *sf_i = VBSF_GET_INODE_INFO(inode);
     44    struct vbsf_super_info *sf_g   = VBSF_GET_SUPER_INFO(inode->i_sb);
     45    struct vbsf_inode_info *sf_i   = VBSF_GET_INODE_INFO(inode);
    4646    struct dentry          *dentry = VBSF_GET_F_DENTRY(file);
    4747    struct vbsf_dir_info   *sf_d;
     
    9898                    file->private_data = sf_d;
    9999                    VbglR0PhysHeapFree(pReq);
     100                    SFLOGFLOW(("vbsf_dir_open(%p,%p): returns 0; hHost=%#llx\n", inode, file, sf_d->Handle.hHost));
    100101                    return 0;
    101102
     
    123124    } else
    124125        rc = -ENOMEM;
     126    SFLOGFLOW(("vbsf_dir_open(%p,%p): returns %d\n", inode, file, rc));
    125127    return rc;
    126128}
     
    140142    struct vbsf_dir_info *sf_d = (struct vbsf_dir_info *)file->private_data;
    141143
    142     TRACE();
     144    SFLOGFLOW(("vbsf_dir_release(%p,%p): sf_d=%p hHost=%#llx\n", inode, file, sf_d, sf_d ? sf_d->Handle.hHost : SHFL_HANDLE_NIL));
    143145
    144146    if (sf_d) {
     
    166168/**
    167169 * Translate RTFMODE into DT_xxx (in conjunction to rtDirType()).
    168  * @param fMode     file mode
    169170 * returns d_type
    170  */
    171 static int vbsf_get_d_type(RTFMODE fMode)
     171 * @param  fMode    file mode
     172 */
     173DECLINLINE(int) vbsf_get_d_type(RTFMODE fMode)
    172174{
    173175    switch (fMode & RTFS_TYPE_MASK) {
     
    200202     */
    201203    if (sf_d->fNoMoreFiles) {
    202         if (!fRestart)
     204        if (!fRestart) {
     205            SFLOGFLOW(("vbsf_dir_read_more: no more files\n"));
    203206            return 0;
     207        }
    204208        sf_d->fNoMoreFiles = false;
    205209    }
    206 
    207210
    208211    /*
     
    257260    } else
    258261        rc = -ENOMEM;
     262    SFLOGFLOW(("vbsf_dir_read_more: returns %d; cbValid=%#x cEntriesLeft=%#x fNoMoreFiles=%d\n",
     263               rc, sf_d->cbValid, sf_d->cEntriesLeft, sf_d->fNoMoreFiles));
    259264    return rc;
    260265}
     
    282287#endif
    283288    }
     289
    284290    /* Assuming this is a buffer overflow issue, just silently skip it. */
     291    SFLOGFLOW(("vbsf_dir_emit_nls: vbsf_nlscopy failed with %d for '%s'\n", rc, pszSrcName));
    285292    return true;
    286293}
     
    317324{
    318325#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
    319     loff_t                  offPos  = ctx->pos;
    320 #else
    321     loff_t                  offPos  = dir->f_pos;
    322 #endif
    323     struct vbsf_dir_info   *sf_d    = (struct vbsf_dir_info *)dir->private_data;
    324     struct vbsf_super_info *sf_g    = VBSF_GET_SUPER_INFO(VBSF_GET_F_DENTRY(dir)->d_sb);
     326    loff_t                  offPos = ctx->pos;
     327#else
     328    loff_t                  offPos = dir->f_pos;
     329#endif
     330    struct vbsf_dir_info   *sf_d   = (struct vbsf_dir_info *)dir->private_data;
     331    struct vbsf_super_info *sf_g   = VBSF_GET_SUPER_INFO(VBSF_GET_F_DENTRY(dir)->d_sb);
    325332    int                     rc;
    326333
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