VirtualBox

Ignore:
Timestamp:
Nov 11, 2011 5:05:17 PM (13 years ago)
Author:
vboxsync
Message:

Additions/solaris/SharedFolders: Consolidate volinfo calls into one fsinfo.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/solaris/SharedFolders/vboxfs_vfs.c

    r39270 r39278  
    526526{
    527527        sffs_data_t *sffs = (sffs_data_t *)vfsp->vfs_data;
    528         uint64_t x;
    529         uint32_t u;
     528        sffs_fsinfo_t fsinfo;
    530529        dev32_t d32;
    531530        int error;
    532531
    533532        bzero(sbp, sizeof(*sbp));
    534         error = sfprov_get_blksize(sffs->sf_handle, &x);
     533        error = sfprov_get_fsinfo(sffs->sf_handle, &fsinfo);
    535534        if (error != 0)
    536535                return (error);
    537         sbp->f_bsize = x;
    538         sbp->f_frsize = x;
    539 
    540         error = sfprov_get_blksavail(sffs->sf_handle, &x);
    541         if (error != 0)
    542                 return (error);
    543         sbp->f_bfree = x;
    544         sbp->f_bavail = x;
    545         sbp->f_files = x / 4;   /* some kind of reasonable value */
    546         sbp->f_ffree = x / 4;
    547         sbp->f_favail = x / 4;
    548 
    549         error = sfprov_get_blksused(sffs->sf_handle, &x);
    550         if (error != 0)
    551                 return (error);
    552         sbp->f_blocks = x + sbp->f_bavail;
     536
     537        sbp->f_bsize = fsinfo.blksize;
     538        sbp->f_frsize = fsinfo.blksize;
     539
     540        sbp->f_bfree = fsinfo.blksavail;
     541        sbp->f_bavail = fsinfo.blksavail;
     542        sbp->f_files = fsinfo.blksavail / 4; /* some kind of reasonable value */
     543        sbp->f_ffree = fsinfo.blksavail / 4;
     544        sbp->f_favail = fsinfo.blksavail / 4;
     545
     546        sbp->f_blocks = fsinfo.blksused + sbp->f_bavail;
    553547
    554548        (void) cmpldev(&d32, vfsp->vfs_dev);
     
    557551        sbp->f_flag |= ST_NOSUID;
    558552
    559         error = sfprov_get_readonly(sffs->sf_handle, &u);
    560         if (error != 0)
    561                 return (error);
    562         if (u)
     553        if (fsinfo.readonly)
    563554                sbp->f_flag |= ST_RDONLY;
    564555
    565         error = sfprov_get_maxnamesize(sffs->sf_handle, &u);
    566         if (error != 0)
    567                 return (error);
    568         sbp->f_namemax = u;
     556        sbp->f_namemax = fsinfo.maxnamesize;
    569557        return (0);
    570558}
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