Changeset 4909 in vbox
- Timestamp:
- Sep 20, 2007 7:27:19 AM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 24647
- Location:
- trunk/src/VBox/Additions/linux/sharedfolders
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/sharedfolders/utils.c
r4860 r4909 19 19 20 20 #include "vfsmod.h" 21 #include <linux/nfs_fs.h> 22 #include <linux/vfs.h> 21 23 22 24 /* #define USE_VMALLOC */ … … 590 592 } 591 593 594 int sf_get_volume_info(struct super_block *sb, STRUCT_STATFS *stat) 595 { 596 struct sf_glob_info *sf_g; 597 SHFLVOLINFO SHFLVolumeInfo; 598 uint32_t cbBuffer; 599 int rc; 600 601 sf_g = GET_GLOB_INFO (sb); 602 cbBuffer = sizeof(SHFLVolumeInfo); 603 rc = vboxCallFSInfo(&client_handle, &sf_g->map, 0, SHFL_INFO_GET | SHFL_INFO_VOLUME, 604 &cbBuffer, (PSHFLDIRINFO)&SHFLVolumeInfo); 605 if (VBOX_FAILURE(rc)) 606 return -RTErrConvertToErrno(rc); 607 608 stat->f_type = NFS_SUPER_MAGIC; /* XXX vboxsf type? */ 609 stat->f_bsize = SHFLVolumeInfo.ulBytesPerAllocationUnit; 610 stat->f_blocks = SHFLVolumeInfo.ullTotalAllocationBytes 611 / SHFLVolumeInfo.ulBytesPerAllocationUnit; 612 stat->f_bfree = SHFLVolumeInfo.ullAvailableAllocationBytes 613 / SHFLVolumeInfo.ulBytesPerAllocationUnit; 614 stat->f_bavail = SHFLVolumeInfo.ullAvailableAllocationBytes 615 / SHFLVolumeInfo.ulBytesPerAllocationUnit; 616 stat->f_files = 1000; 617 stat->f_ffree = 1000; /* don't return 0 here since the guest may think 618 * that it is not possible to create any more files */ 619 stat->f_fsid.val[0] = 0; 620 stat->f_fsid.val[1] = 0; 621 stat->f_namelen = 255; 622 return 0; 623 } 624 592 625 struct dentry_operations sf_dentry_ops = { 593 626 .d_revalidate = sf_dentry_revalidate -
trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.c
r4860 r4909 311 311 } 312 312 313 static int314 sf_statfs (315 313 #if LINUX_VERSION_CODE < KERNEL_VERSION (2, 6, 18) 316 struct super_block *sb, 314 static int 315 sf_statfs (struct super_block *sb, STRUCT_STATFS *stat) 316 { 317 return sf_get_volume_info(sb, stat); 318 } 317 319 #else 318 struct dentry *dentry, 319 #endif 320 #if LINUX_VERSION_CODE < KERNEL_VERSION (2, 6, 0) 321 struct statfs *stat 322 #else 323 struct kstatfs *stat 324 #endif 325 ) 326 { 327 TRACE (); 328 return -ENOSYS; 329 } 320 static int 321 sf_statfs (struct dentry *dentry, STRUCT_STATFS *stat) 322 { 323 struct super_block *sb = dentry->d_inode->i_sb; 324 return sf_get_volume_info(sb, stat); 325 } 326 #endif 330 327 331 328 static int -
trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.h
r4735 r4909 93 93 struct sf_dir_info *sf_d, SHFLHANDLE handle); 94 94 95 #if LINUX_VERSION_CODE < KERNEL_VERSION (2, 6, 0) 96 #define STRUCT_STATFS struct statfs 97 #else 98 #define STRUCT_STATFS struct kstatfs 99 #endif 100 int sf_get_volume_info(struct super_block *sb,STRUCT_STATFS *stat); 101 95 102 #ifdef ALIGN 96 103 #undef ALIGN
Note:
See TracChangeset
for help on using the changeset viewer.