- Timestamp:
- Mar 1, 2019 11:58:24 AM (6 years ago)
- Location:
- trunk/src/VBox/Additions/linux/sharedfolders
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/sharedfolders/dirops.c
r77502 r77524 39 39 * reading in the whole directory on open. 40 40 */ 41 static int sf_dir_open_worker(struct sf_glob_info *sf_g, struct sf_dir_info *sf_d,41 static int sf_dir_open_worker(struct vbsf_super_info *sf_g, struct sf_dir_info *sf_d, 42 42 struct sf_inode_info *sf_i, const char *pszCaller) 43 43 { … … 113 113 static int sf_dir_open(struct inode *inode, struct file *file) 114 114 { 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; 115 118 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);119 119 120 120 TRACE(); … … 209 209 { 210 210 loff_t cur; 211 struct sf_glob_info *sf_g;211 struct vbsf_super_info *sf_g; 212 212 struct sf_dir_info *sf_d; 213 213 struct sf_inode_info *sf_i; … … 219 219 inode = GET_F_DENTRY(dir)->d_inode; 220 220 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); 222 222 sf_d = dir->private_data; 223 223 … … 382 382 */ 383 383 static 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) 385 385 { 386 386 /* … … 447 447 ) 448 448 { 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; 454 454 455 455 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) … … 551 551 SHFLHANDLE handle) 552 552 { 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*/); 555 555 if (pInode) { 556 556 /* Store this handle if we leave the handle open. */ … … 576 576 int rc, err; 577 577 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); 579 579 SHFLSTRING *path; 580 580 union CreateAuxReq … … 730 730 { 731 731 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); 733 733 struct sf_inode_info *sf_parent_i = GET_INODE_INFO(parent); 734 734 SHFLSTRING *path; … … 822 822 { 823 823 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); 825 825 826 826 TRACE(); … … 833 833 #endif 834 834 835 if (sf_g != GET_GLOB_INFO(new_parent->i_sb)) {835 if (sf_g != VBSF_GET_SUPER_INFO(new_parent->i_sb)) { 836 836 LogFunc(("rename with different roots\n")); 837 837 err = -EINVAL; … … 895 895 int rc; 896 896 struct sf_inode_info *sf_i; 897 struct sf_glob_info *sf_g;897 struct vbsf_super_info *sf_g; 898 898 SHFLSTRING *path, *ssymname; 899 899 SHFLFSOBJINFO info; … … 901 901 902 902 TRACE(); 903 sf_g = GET_GLOB_INFO(parent->i_sb);903 sf_g = VBSF_GET_SUPER_INFO(parent->i_sb); 904 904 sf_i = GET_INODE_INFO(parent); 905 905 -
trunk/src/VBox/Additions/linux/sharedfolders/lnkops.c
r77424 r77524 43 43 { 44 44 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); 46 46 struct sf_inode_info *sf_i = GET_INODE_INFO(inode); 47 47 int error = -ENOMEM; … … 89 89 struct delayed_call *done) 90 90 { 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); 92 92 struct sf_inode_info *sf_i = GET_INODE_INFO(inode); 93 93 char *path; -
trunk/src/VBox/Additions/linux/sharedfolders/regops.c
r77515 r77524 121 121 * @param pszCaller The caller name (for logging failures). 122 122 */ 123 uint32_t sf_handle_release_slow(struct sf_handle *pHandle, struct sf_glob_info *sf_g, const char *pszCaller)123 uint32_t sf_handle_release_slow(struct sf_handle *pHandle, struct vbsf_super_info *sf_g, const char *pszCaller) 124 124 { 125 125 int rc; … … 247 247 }; 248 248 249 static int sf_reg_read_aux(const char *caller, struct sf_glob_info *sf_g,249 static int sf_reg_read_aux(const char *caller, struct vbsf_super_info *sf_g, 250 250 struct sf_reg_info *sf_r, void *buf, 251 251 uint32_t * nread, uint64_t pos) … … 272 272 loff_t offset = orig_offset; 273 273 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); 275 275 struct sf_reg_info *sf_r = in->private_data; 276 276 ssize_t retval; … … 456 456 */ 457 457 static 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) 459 459 { 460 460 /* … … 573 573 { 574 574 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); 576 576 struct sf_reg_info *sf_r = file->private_data; 577 577 struct address_space *mapping = inode->i_mapping; … … 697 697 static ssize_t sf_reg_write_fallback(struct file *file, const char /*__user*/ *buf, size_t size, loff_t *off, loff_t offFile, 698 698 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) 700 700 { 701 701 /* … … 816 816 loff_t * off) 817 817 { 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; 824 824 825 825 SFLOGFLOW(("sf_reg_write: inode=%p file=%p buf=%p size=%#zx off=%#llx\n", inode, file, buf, size, *off)); … … 948 948 { 949 949 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); 951 951 struct sf_inode_info *sf_i = GET_INODE_INFO(inode); 952 952 struct sf_reg_info *sf_r; … … 1110 1110 { 1111 1111 struct sf_reg_info *sf_r; 1112 struct sf_glob_info *sf_g;1112 struct vbsf_super_info *sf_g; 1113 1113 struct sf_inode_info *sf_i = GET_INODE_INFO(inode); 1114 1114 1115 1115 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); 1117 1117 sf_r = file->private_data; 1118 1118 … … 1283 1283 VBOXSFREADPGLSTREQ *pReq = (VBOXSFREADPGLSTREQ *)VbglR0PhysHeapAlloc(sizeof(*pReq)); 1284 1284 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; 1289 1289 1290 1290 pReq->PgLst.offFirstPage = 0; … … 1343 1343 1344 1344 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)); 1347 1347 if (pReq) { 1348 1348 uint64_t const cbFile = i_size_read(inode); -
trunk/src/VBox/Additions/linux/sharedfolders/utils.c
r77523 r77524 120 120 * Initializes the @a inode attributes based on @a pObjInfo and @a sf_g options. 121 121 */ 122 void sf_init_inode(struct inode *inode, struct sf_inode_info *sf_i, PSHFLFSOBJINFO pObjInfo, struct sf_glob_info *sf_g)122 void sf_init_inode(struct inode *inode, struct sf_inode_info *sf_i, PSHFLFSOBJINFO pObjInfo, struct vbsf_super_info *sf_g) 123 123 { 124 124 PCSHFLFSOBJATTR pAttr = &pObjInfo->Attr; … … 193 193 */ 194 194 static 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) 196 196 { 197 197 PCSHFLFSOBJATTR pAttr = &pObjInfo->Attr; … … 267 267 268 268 /** @note Currently only used for the root directory during (re-)mount. */ 269 int sf_stat(const char *caller, struct sf_glob_info *sf_g,269 int sf_stat(const char *caller, struct vbsf_super_info *sf_g, 270 270 SHFLSTRING *path, PSHFLFSOBJINFO result, int ok_to_fail) 271 271 { … … 318 318 struct inode *pInode = dentry ? dentry->d_inode : NULL; 319 319 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); 322 322 AssertReturn(sf_i, -EINVAL); 323 323 AssertReturn(sf_g, -EINVAL); … … 427 427 err = -EINVAL; 428 428 } 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); 431 431 AssertReturn(sf_i, -EINVAL); 432 432 AssertReturn(sf_g, -EINVAL); … … 554 554 int sf_setattr(struct dentry *dentry, struct iattr *iattr) 555 555 { 556 struct sf_glob_info *sf_g;556 struct vbsf_super_info *sf_g; 557 557 struct sf_inode_info *sf_i; 558 558 union SetAttrReqs … … 572 572 TRACE(); 573 573 574 sf_g = GET_GLOB_INFO(dentry->d_inode->i_sb);574 sf_g = VBSF_GET_SUPER_INFO(dentry->d_inode->i_sb); 575 575 sf_i = GET_INODE_INFO(dentry->d_inode); 576 576 cbReq = RT_MAX(sizeof(pReq->Info), sizeof(pReq->Create) + SHFLSTRING_HEADER_SIZE + sf_i->path->u16Size); … … 741 741 * [sf_make_path] which will allocate SHFLSTRING and fill it in 742 742 */ 743 int sf_path_from_dentry(const char *caller, struct sf_glob_info *sf_g,743 int sf_path_from_dentry(const char *caller, struct vbsf_super_info *sf_g, 744 744 struct sf_inode_info *sf_i, struct dentry *dentry, 745 745 SHFLSTRING ** result) … … 821 821 } 822 822 823 int sf_nlscpy(struct sf_glob_info *sf_g,823 int sf_nlscpy(struct vbsf_super_info *sf_g, 824 824 char *name, size_t name_bound_len, 825 825 const unsigned char *utf8_name, size_t utf8_len) … … 992 992 /** @todo r=bird: Why on earth do we read in the entire directory??? This 993 993 * 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,994 int sf_dir_read_all(struct vbsf_super_info *sf_g, struct sf_inode_info *sf_i, 995 995 struct sf_dir_info *sf_d, SHFLHANDLE handle) 996 996 { … … 1100 1100 */ 1101 1101 //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); 1104 1104 if (cJiffiesAge < sf_g->ttl) { 1105 1105 SFLOGFLOW(("sf_dentry_revalidate: age: %lu vs. TTL %lu -> 1\n", cJiffiesAge, sf_g->ttl)); … … 1134 1134 } else { 1135 1135 /* 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); 1138 1138 if (cJiffiesAge < sf_g->ttl) { 1139 1139 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 77 77 * Copies options from the mount info structure into @a sf_g. 78 78 * 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 */ 81 static void sf_super_info_copy_remount_options(struct vbsf_super_info *sf_g, struct vbsf_mount_info_new *info) 82 82 { 83 83 sf_g->ttl_msec = info->ttl; … … 130 130 } 131 131 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 */ 133 static int sf_super_info_alloc(struct vbsf_mount_info_new *info, struct vbsf_super_info **sf_gp) 135 134 { 136 135 int err, rc; 137 136 SHFLSTRING *str_name; 138 137 size_t name_len, str_len; 139 struct sf_glob_info *sf_g;138 struct vbsf_super_info *sf_g; 140 139 141 140 TRACE(); … … 143 142 if (!sf_g) { 144 143 err = -ENOMEM; 145 LogRelFunc(("could not allocate memory for globalinfo\n"));144 LogRelFunc(("could not allocate memory for super info\n")); 146 145 goto fail0; 147 146 } … … 218 217 219 218 /* 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); 221 220 222 221 *sf_gp = sf_g; … … 234 233 } 235 234 236 /* unmap the share and free globalinfo [sf_g] */237 static void sf_ glob_free(struct sf_glob_info *sf_g)235 /* unmap the share and free super info [sf_g] */ 236 static void sf_super_info_free(struct vbsf_super_info *sf_g) 238 237 { 239 238 int rc; … … 254 253 * Initialize backing device related matters. 255 254 */ 256 static int sf_init_backing_dev(struct super_block *sb, struct sf_glob_info *sf_g)255 static int sf_init_backing_dev(struct super_block *sb, struct vbsf_super_info *sf_g) 257 256 { 258 257 int rc = 0; … … 322 321 * Undoes what sf_init_backing_dev did. 323 322 */ 324 static void sf_done_backing_dev(struct super_block *sb, struct sf_glob_info *sf_g)323 static void sf_done_backing_dev(struct super_block *sb, struct vbsf_super_info *sf_g) 325 324 { 326 325 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) && LINUX_VERSION_CODE <= KERNEL_VERSION(3, 19, 0) … … 334 333 * the fs and wants to read super_block. 335 334 * 336 * calls [sf_glob_alloc] to map the folder and allocate global337 * informationstructure.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. 342 341 */ 343 342 static int sf_read_super_aux(struct super_block *sb, void *data, int flags) … … 347 346 struct inode *iroot; 348 347 struct sf_inode_info *sf_i; 349 struct sf_glob_info *sf_g;348 struct vbsf_super_info *sf_g; 350 349 SHFLFSOBJINFO fsinfo; 351 350 struct vbsf_mount_info_new *info; … … 365 364 } 366 365 367 err = sf_ glob_alloc(info, &sf_g);366 err = sf_super_info_alloc(info, &sf_g); 368 367 if (err) 369 368 goto fail0; … … 459 458 460 459 sb->s_root = droot; 461 SET_GLOB_INFO(sb, sf_g);460 VBSF_SET_SUPER_INFO(sb, sf_g); 462 461 return 0; 463 462 … … 476 475 477 476 fail1: 478 sf_ glob_free(sf_g);477 sf_super_info_free(sf_g); 479 478 480 479 fail0: … … 539 538 540 539 541 /* vfs is done with [sb] (umount called) call [sf_ glob_free] to unmap540 /* vfs is done with [sb] (umount called) call [sf_super_info_free] to unmap 542 541 the folder and free [sf_g] */ 543 542 static void sf_put_super(struct super_block *sb) 544 543 { 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); 548 547 BUG_ON(!sf_g); 549 548 sf_done_backing_dev(sb, sf_g); 550 sf_ glob_free(sf_g);549 sf_super_info_free(sf_g); 551 550 } 552 551 … … 569 568 VBOXSFVOLINFOREQ *pReq = (VBOXSFVOLINFOREQ *)VbglR0PhysHeapAlloc(sizeof(*pReq)); 570 569 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); 573 572 rc = VbglR0SfHostReqQueryVolInfo(sf_g->map.root, pReq, SHFL_HANDLE_ROOT); 574 573 if (RT_SUCCESS(rc)) { … … 606 605 { 607 606 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 23) 608 struct sf_glob_info *sf_g;607 struct vbsf_super_info *sf_g; 609 608 struct sf_inode_info *sf_i; 610 609 struct inode *iroot; … … 612 611 int err; 613 612 614 sf_g = GET_GLOB_INFO(sb);613 sf_g = VBSF_GET_SUPER_INFO(sb); 615 614 BUG_ON(!sf_g); 616 615 if (data && data[0] != 0) { … … 620 619 && info->signature[1] == VBSF_MOUNT_SIGNATURE_BYTE_1 621 620 && 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); 623 622 } 624 623 } … … 657 656 struct super_block *sb = root->d_sb; 658 657 #endif 659 struct sf_glob_info *sf_g = GET_GLOB_INFO(sb);658 struct vbsf_super_info *sf_g = VBSF_GET_SUPER_INFO(sb); 660 659 if (sf_g) { 661 660 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 85 85 #define DIR_BUFFER_SIZE (16*_1K) 86 86 87 /* per-shared folder information */ 88 struct sf_glob_info { 87 /** 88 * VBox specific per-mount (shared folder) information. 89 */ 90 struct vbsf_super_info { 89 91 VBGLSFMAP map; 90 92 struct nls_table *nls; … … 103 105 * This applies to read and write operations. */ 104 106 uint32_t cMaxIoPages; 107 /** Mount tag for VBoxService automounter. @since 6.0 */ 108 char tag[32]; 105 109 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) 110 /** The backing device info structure. */ 106 111 struct backing_dev_info bdi; 107 112 #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 110 125 111 126 /** … … 196 211 * Sets the update-jiffies value for a dentry. 197 212 * 198 * This is used together with sf_glob_info::ttl to reduce re-validation of213 * This is used together with vbsf_super_info::ttl to reduce re-validation of 199 214 * dentry structures while walking. 200 215 * … … 265 280 extern void sf_handle_drop_chain(struct sf_inode_info *pInodeInfo); 266 281 extern 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);282 extern uint32_t sf_handle_release_slow(struct sf_handle *pHandle, struct vbsf_super_info *sf_g, const char *pszCaller); 268 283 extern void sf_handle_append(struct sf_inode_info *pInodeInfo, struct sf_handle *pHandle); 269 284 … … 277 292 * @param pszCaller The caller name (for logging failures). 278 293 */ 279 DECLINLINE(uint32_t) sf_handle_release(struct sf_handle *pHandle, struct sf_glob_info *sf_g, const char *pszCaller)294 DECLINLINE(uint32_t) sf_handle_release(struct sf_handle *pHandle, struct vbsf_super_info *sf_g, const char *pszCaller) 280 295 { 281 296 uint32_t cRefs; … … 292 307 } 293 308 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,309 extern void sf_init_inode(struct inode *inode, struct sf_inode_info *sf_i, PSHFLFSOBJINFO info, struct vbsf_super_info *sf_g); 310 extern int sf_stat(const char *caller, struct vbsf_super_info *sf_g, 296 311 SHFLSTRING * path, PSHFLFSOBJINFO result, int ok_to_fail); 297 312 extern int sf_inode_revalidate(struct dentry *dentry); … … 308 323 extern int sf_setattr(struct dentry *dentry, struct iattr *iattr); 309 324 #endif 310 extern int sf_path_from_dentry(const char *caller, struct sf_glob_info *sf_g,325 extern int sf_path_from_dentry(const char *caller, struct vbsf_super_info *sf_g, 311 326 struct sf_inode_info *sf_i, 312 327 struct dentry *dentry, SHFLSTRING ** result); 313 extern int sf_nlscpy(struct sf_glob_info *sf_g, char *name,328 extern int sf_nlscpy(struct vbsf_super_info *sf_g, char *name, 314 329 size_t name_bound_len, const unsigned char *utf8_name, 315 330 size_t utf8_len); … … 317 332 extern void sf_dir_info_empty(struct sf_dir_info *p); 318 333 extern struct sf_dir_info *sf_dir_info_alloc(void); 319 extern int sf_dir_read_all(struct sf_glob_info *sf_g,334 extern int sf_dir_read_all(struct vbsf_super_info *sf_g, 320 335 struct sf_inode_info *sf_i, struct sf_dir_info *sf_d, 321 336 SHFLHANDLE handle); … … 339 354 #endif 340 355 341 /* Following casts are here to prevent assignment of void * to342 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_g346 #else347 # 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_g349 #endif350 351 356 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) || defined(KERNEL_FC6) 352 357 /* FC6 kernel 2.6.18, vanilla kernel 2.6.19+ */
Note:
See TracChangeset
for help on using the changeset viewer.