Changeset 28253 in vbox for trunk/src/VBox/Additions/linux/sharedfolders/dirops.c
- Timestamp:
- Apr 13, 2010 2:14:07 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 59994
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/sharedfolders/dirops.c
r24320 r28253 296 296 goto fail1; 297 297 } 298 sf_new_i->handle = SHFL_HANDLE_NIL; 298 299 299 300 ino = iunique (parent->i_sb, 1); … … 338 339 sf_instantiate (const char *caller, struct inode *parent, 339 340 struct dentry *dentry, SHFLSTRING *path, 340 RTFSOBJINFO *info )341 RTFSOBJINFO *info, SHFLHANDLE handle) 341 342 { 342 343 int err; … … 379 380 380 381 #if LINUX_VERSION_CODE >= KERNEL_VERSION (2, 4, 25) 381 unlock_new_inode(inode); 382 #endif 383 382 unlock_new_inode(inode); 383 #endif 384 385 /* Store this handle if we leave the handle open. */ 386 sf_new_i->handle = handle; 384 387 return 0; 385 388 … … 392 395 393 396 static int 394 sf_create_aux (struct inode *parent, struct dentry *dentry, int mode, int dirop)397 sf_create_aux (struct inode *parent, struct dentry *dentry, int mode, int fDirectory) 395 398 { 396 399 int rc, err; … … 418 421 | SHFL_CF_ACT_FAIL_IF_EXISTS 419 422 | SHFL_CF_ACCESS_READWRITE 420 | ( dirop? SHFL_CF_DIRECTORY : 0)423 | (fDirectory ? SHFL_CF_DIRECTORY : 0) 421 424 ; 422 425 423 426 params.Info.Attr.fMode = 0 424 | ( dirop? RTFS_TYPE_DIRECTORY : RTFS_TYPE_FILE)427 | (fDirectory ? RTFS_TYPE_DIRECTORY : RTFS_TYPE_FILE) 425 428 | (mode & S_IRWXUGO) 426 429 ; … … 433 436 } 434 437 435 LogFunc((" calling vboxCallCreate, folder %s, flags %#x\n",438 LogFunc(("sf_create_aux: calling vboxCallCreate, folder %s, flags %#x\n", 436 439 path->String.utf8, params.CreateFlags)); 437 440 rc = vboxCallCreate (&client_handle, &sf_g->map, path, ¶ms); … … 442 445 } 443 446 err = -EPROTO; 444 LogFunc(("(%d): vboxCallCreate(%s) failed rc=%Rrc\n", dirop,445 sf_i->path->String.utf8, rc));447 LogFunc(("(%d): vboxCallCreate(%s) failed rc=%Rrc\n", 448 fDirectory, sf_i->path->String.utf8, rc)); 446 449 goto fail0; 447 450 } … … 449 452 if (params.Result != SHFL_FILE_CREATED) { 450 453 err = -EPERM; 451 LogFunc(("(%d): could not create file %s result=%d\n", dirop,452 sf_i->path->String.utf8, params.Result));454 LogFunc(("(%d): could not create file %s result=%d\n", 455 fDirectory, sf_i->path->String.utf8, params.Result)); 453 456 goto fail0; 454 457 } 455 458 456 err = sf_instantiate (__func__, parent, dentry, path, ¶ms.Info); 459 err = sf_instantiate (__func__, parent, dentry, path, ¶ms.Info, 460 fDirectory ? SHFL_HANDLE_NIL : params.Handle); 457 461 if (err) { 458 462 LogFunc(("(%d): could not instantiate dentry for %s err=%d\n", 459 dirop, sf_i->path->String.utf8, err));463 fDirectory, sf_i->path->String.utf8, err)); 460 464 goto fail1; 461 465 } 462 466 463 rc = vboxCallClose (&client_handle, &sf_g->map, params.Handle); 464 if (RT_FAILURE (rc)) { 465 LogFunc(("(%d): vboxCallClose failed rc=%Rrc\n", dirop, rc)); 467 /* 468 * Don't close this handle right now. We assume that the same file is 469 * opened with sf_reg_open() and later closed with sf_reg_close(). Save 470 * the handle in between. Does not apply to directories. True? 471 */ 472 if (fDirectory) 473 { 474 rc = vboxCallClose (&client_handle, &sf_g->map, params.Handle); 475 if (RT_FAILURE (rc)) { 476 LogFunc(("(%d): vboxCallClose failed rc=%Rrc\n", fDirectory, rc)); 477 } 466 478 } 467 479 … … 472 484 rc = vboxCallClose (&client_handle, &sf_g->map, params.Handle); 473 485 if (RT_FAILURE (rc)) { 474 LogFunc(("(%d): vboxCallClose failed rc=%Rrc\n", dirop, rc));486 LogFunc(("(%d): vboxCallClose failed rc=%Rrc\n", fDirectory, rc)); 475 487 } 476 488 … … 499 511 500 512 static int 501 sf_unlink_aux (struct inode *parent, struct dentry *dentry, int dirop)513 sf_unlink_aux (struct inode *parent, struct dentry *dentry, int fDirectory) 502 514 { 503 515 int rc, err; … … 515 527 516 528 rc = vboxCallRemove (&client_handle, &sf_g->map, path, 517 dirop? SHFL_REMOVE_DIR : SHFL_REMOVE_FILE);529 fDirectory ? SHFL_REMOVE_DIR : SHFL_REMOVE_FILE); 518 530 if (RT_FAILURE (rc)) { 519 LogFunc(("(%d): vboxCallRemove(%s) failed rc=%Rrc\n", dirop,531 LogFunc(("(%d): vboxCallRemove(%s) failed rc=%Rrc\n", fDirectory, 520 532 path->String.utf8, rc)); 521 533 err = -RTErrConvertToErrno (rc);
Note:
See TracChangeset
for help on using the changeset viewer.