Changeset 77559 in vbox for trunk/src/VBox/Additions/linux/sharedfolders
- Timestamp:
- Mar 4, 2019 4:19:23 PM (6 years ago)
- Location:
- trunk/src/VBox/Additions/linux/sharedfolders
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/sharedfolders/dirops.c
r77549 r77559 1115 1115 .unlink = vbsf_inode_unlink, 1116 1116 .rename = vbsf_inode_rename, 1117 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) 1118 .revalidate = vbsf_inode_revalidate 1119 #else 1117 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 18) 1120 1118 .getattr = vbsf_inode_getattr, 1121 1119 .setattr = vbsf_inode_setattr, 1120 #else 1121 .revalidate = vbsf_inode_revalidate 1122 #endif 1123 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) 1122 1124 .symlink = vbsf_ino_symlink 1123 1125 #endif -
trunk/src/VBox/Additions/linux/sharedfolders/regops.c
r77549 r77559 1258 1258 case SEEK_END: { 1259 1259 struct vbsf_reg_info *sf_r = file->private_data; 1260 int rc = vbsf_inode_revalidate_with_handle(VBSF_GET_F_DENTRY(file), sf_r->Handle.hHost, true /*fForce*/,1261 false /*fInodeLocked*/);1260 int rc = vbsf_inode_revalidate_with_handle(VBSF_GET_F_DENTRY(file), sf_r->Handle.hHost, 1261 true /*fForce*/, false /*fInodeLocked*/); 1262 1262 if (rc == 0) 1263 1263 break; … … 1359 1359 1360 1360 struct inode_operations vbsf_reg_iops = { 1361 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) 1362 .revalidate = vbsf_inode_revalidate 1363 #else 1361 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 18) 1364 1362 .getattr = vbsf_inode_getattr, 1365 1363 .setattr = vbsf_inode_setattr 1364 #else 1365 .revalidate = vbsf_inode_revalidate 1366 1366 #endif 1367 1367 }; -
trunk/src/VBox/Additions/linux/sharedfolders/utils.c
r77549 r77559 244 244 * Update the inode with new object info from the host. 245 245 * 246 * Called by sf_inode_revalidate() and sf_inode_revalidate_with_handle(), the 247 * inode is probably locked... 248 * 249 * @todo sort out the inode locking situation. 246 * Called by sf_inode_revalidate() and sf_inode_revalidate_with_handle(). 250 247 */ 251 248 void vbsf_update_inode(struct inode *pInode, struct vbsf_inode_info *pInodeInfo, PSHFLFSOBJINFO pObjInfo, … … 370 367 * @sa sf_inode_revalidate() 371 368 */ 372 int vbsf_inode_revalidate_worker(struct dentry *dentry, bool fForced )369 int vbsf_inode_revalidate_worker(struct dentry *dentry, bool fForced, bool fInodeLocked) 373 370 { 374 371 int rc; … … 403 400 * Reset the TTL and copy the info over into the inode structure. 404 401 */ 405 vbsf_update_inode(pInode, sf_i, &pReq->ObjInfo, sf_g, true /*fInodeLocked??*/);402 vbsf_update_inode(pInode, sf_i, &pReq->ObjInfo, sf_g, fInodeLocked); 406 403 } else if (rc == VERR_INVALID_HANDLE) { 407 404 rc = -ENOENT; /* Restore.*/ … … 431 428 * Reset the TTL and copy the info over into the inode structure. 432 429 */ 433 vbsf_update_inode(pInode, sf_i, &pReq->CreateParms.Info, sf_g, true /*fInodeLocked??*/);430 vbsf_update_inode(pInode, sf_i, &pReq->CreateParms.Info, sf_g, fInodeLocked); 434 431 rc = 0; 435 432 } else { … … 456 453 457 454 458 /** 459 * Revalidate an inode. 455 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 18) 456 /** 457 * Revalidate an inode for 2.4. 460 458 * 461 * This is called directly as inode-op on 2.4, indirectly as dir-op 462 * vbsf_dentry_revalidate() on 2.4/2.6. The job is to find out whether 463 * dentry/inode is still valid. The test fails if @a dentry does not have an 464 * inode or vbsf_stat() is unsuccessful, otherwise we return success and update 465 * inode attributes. 459 * This is called in the stat(), lstat() and readlink() code paths. In the stat 460 * cases the caller will use the result afterwards to produce the stat data. 461 * 462 * @note 2.4.x has a getattr() inode operation too, but it is not used. 466 463 */ 467 464 int vbsf_inode_revalidate(struct dentry *dentry) 468 465 { 469 return vbsf_inode_revalidate_worker(dentry, false /*fForced*/); 470 } 466 /* 467 * We pretend the inode is locked here, as 2.4.x does not have inode level locking. 468 */ 469 return vbsf_inode_revalidate_worker(dentry, false /*fForced*/, true /*fInodeLocked*/); 470 } 471 #endif /* < 2.5.18 */ 471 472 472 473 … … 525 526 has inode at all) from these new attributes we derive [kstat] via 526 527 [generic_fillattr] */ 527 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)528 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 18) 528 529 529 530 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) … … 551 552 switch (flags & AT_STATX_SYNC_TYPE) { 552 553 default: 553 rc = vbsf_inode_revalidate_worker(dentry, false /*fForced*/ );554 rc = vbsf_inode_revalidate_worker(dentry, false /*fForced*/, false /*fInodeLocked*/); 554 555 break; 555 556 556 557 case AT_STATX_FORCE_SYNC: 557 rc = vbsf_inode_revalidate_worker(dentry, true /*fForced*/ );558 rc = vbsf_inode_revalidate_worker(dentry, true /*fForced*/, false /*fInodeLocked*/); 558 559 break; 559 560 … … 563 564 } 564 565 # else 565 rc = vbsf_inode_revalidate_worker(dentry, false /*fForced*/ );566 rc = vbsf_inode_revalidate_worker(dentry, false /*fForced*/, false /*fInodeLocked*/); 566 567 # endif 567 568 if (rc == 0) { … … 717 718 * dentry and all its parent entries are valid and could touch their timestamps 718 719 * extending their TTL (CIFS does that). */ 719 return vbsf_inode_revalidate_worker(dentry, true /*fForced*/ );720 return vbsf_inode_revalidate_worker(dentry, true /*fForced*/, true /*fInodeLocked*/); 720 721 721 722 fail1: … … 729 730 } 730 731 731 #endif /* >= 2. 6.0*/732 #endif /* >= 2.5.18 */ 732 733 733 734 static int vbsf_make_path(const char *caller, struct vbsf_inode_info *sf_i, … … 869 870 * cache is still valid. The actual validation is job is handled by 870 871 * vbsf_inode_revalidate_worker(). 872 * 873 * @note Caller holds no relevant locks, just a dentry reference. 871 874 */ 872 875 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) … … 922 925 SFLOGFLOW(("vbsf_dentry_revalidate: age: %lu vs. TTL %lu -> 1\n", cJiffiesAge, sf_g->ttl)); 923 926 rc = 1; 924 } else if (!vbsf_inode_revalidate_worker(dentry, true /*fForced*/ )) {927 } else if (!vbsf_inode_revalidate_worker(dentry, true /*fForced*/, false /*fInodeLocked*/)) { 925 928 vbsf_dentry_set_update_jiffies(dentry, jiffies); /** @todo get jiffies from inode. */ 926 929 SFLOGFLOW(("vbsf_dentry_revalidate: age: %lu vs. TTL %lu -> reval -> 1\n", cJiffiesAge, sf_g->ttl)); -
trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.h
r77549 r77559 213 213 extern void vbsf_update_inode(struct inode *pInode, struct vbsf_inode_info *pInodeInfo, PSHFLFSOBJINFO pObjInfo, 214 214 struct vbsf_super_info *sf_g, bool fInodeLocked); 215 extern int vbsf_inode_revalidate(struct dentry *dentry); 216 extern int vbsf_inode_revalidate_worker(struct dentry *dentry, bool fForced); 215 extern int vbsf_inode_revalidate_worker(struct dentry *dentry, bool fForced, bool fInodeLocked); 217 216 extern int vbsf_inode_revalidate_with_handle(struct dentry *dentry, SHFLHANDLE hHostFile, bool fForced, bool fInodeLocked); 218 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)217 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 18) 219 218 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) 220 219 extern int vbsf_inode_getattr(const struct path *path, struct kstat *kstat, u32 request_mask, unsigned int query_flags); … … 223 222 # endif 224 223 extern int vbsf_inode_setattr(struct dentry *dentry, struct iattr *iattr); 225 #endif 224 #else /* < 2.5.44 */ 225 extern int vbsf_inode_revalidate(struct dentry *dentry); 226 #endif /* < 2.5.44 */ 226 227 227 228
Note:
See TracChangeset
for help on using the changeset viewer.