Changeset 4860 in vbox for trunk/src/VBox/Additions/linux/sharedfolders
- Timestamp:
- Sep 17, 2007 3:45:24 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 24579
- Location:
- trunk/src/VBox/Additions/linux/sharedfolders
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/sharedfolders/dirops.c
r4822 r4860 42 42 43 43 if (!sf_d) { 44 LogRelPrintFunc("could not allocate directory info for"); 45 LogRelPrint(sf_i->path->String.utf8); 46 LogRelPrint("\n"); 44 LogRelFunc(("could not allocate directory info for %s\n", 45 sf_i->path->String.utf8)); 47 46 return -ENOMEM; 48 47 } … … 211 210 fake_ino = sanity; 212 211 if (sanity - fake_ino) { 213 LogRel PrintFunc("can not compute ino\n");212 LogRelFunc(("can not compute ino\n")); 214 213 return -EINVAL; 215 214 } … … 286 285 sf_new_i = kmalloc (sizeof (*sf_new_i), GFP_KERNEL); 287 286 if (!sf_new_i) { 288 LogRel PrintFunc("could not allocate memory for new inode info\n");287 LogRelFunc(("could not allocate memory for new inode info\n")); 289 288 err = -ENOMEM; 290 289 goto fail1; … … 337 336 sf_new_i = kmalloc (sizeof (*sf_new_i), GFP_KERNEL); 338 337 if (!sf_new_i) { 339 LogRelPrintFunc("could not allocate inode info. caller="); 340 LogRelPrint(caller); 341 LogRelPrint("\n"); 338 LogRelFunc(("could not allocate inode info. caller=%s\n", caller)); 342 339 err = -ENOMEM; 343 340 goto fail0; -
trunk/src/VBox/Additions/linux/sharedfolders/regops.c
r4743 r4860 65 65 tmp = kmalloc (CHUNK_SIZE, GFP_KERNEL); 66 66 if (!tmp) { 67 LogRelPrintFunc("could not allocate bounce buffer memory "); 68 LogRelPrintQuote(CHUNK_SIZE); 69 LogRelPrint(" bytes\n"); 67 LogRelFunc(("could not allocate bounce buffer memory %d bytes\n", CHUNK_SIZE)); 70 68 return -ENOMEM; 71 69 } … … 137 135 tmp = kmalloc (CHUNK_SIZE, GFP_KERNEL); 138 136 if (!tmp) { 139 LogRelPrintFunc("could not allocate bounce buffer memory "); 140 LogRelPrintQuote(CHUNK_SIZE); 141 LogRelPrint("bytes\n"); 137 LogRelFunc(("could not allocate bounce buffer memory %d\n", CHUNK_SIZE)); 142 138 return -ENOMEM; 143 139 } … … 205 201 sf_r = kmalloc (sizeof (*sf_r), GFP_KERNEL); 206 202 if (!sf_r) { 207 LogRel PrintFunc("could not allocate reg info\n");203 LogRelFunc(("could not allocate reg info\n")); 208 204 return -ENOMEM; 209 205 } … … 223 219 /* We ignore O_EXCL, as the Linux kernel seems to call create 224 220 beforehand itself, so O_EXCL should always fail. */ 225 // if (file->f_flags & O_EXCL) { 226 // LogFunc(("O_EXCL set\n")); 227 // params.CreateFlags |= SHFL_CF_ACT_FAIL_IF_EXISTS; 228 // } 229 // else { 230 /* O_TRUNC combined with O_EXCL is undefined. */ 231 if (file->f_flags & O_TRUNC) { 232 LogFunc(("O_TRUNC set\n")); 233 params.CreateFlags |= SHFL_CF_ACT_OVERWRITE_IF_EXISTS; 234 } 235 else { 236 params.CreateFlags |= SHFL_CF_ACT_OPEN_IF_EXISTS; 237 } 238 // } 221 if (file->f_flags & O_TRUNC) { 222 LogFunc(("O_TRUNC set\n")); 223 params.CreateFlags |= SHFL_CF_ACT_OVERWRITE_IF_EXISTS; 224 } 225 else { 226 params.CreateFlags |= SHFL_CF_ACT_OPEN_IF_EXISTS; 227 } 239 228 } 240 229 else { … … 248 237 if (!(params.CreateFlags & SHFL_CF_ACCESS_READWRITE)) { 249 238 switch (file->f_flags & O_ACCMODE) { 250 251 252 253 254 255 256 257 258 259 260 261 262 263 239 case O_RDONLY: 240 params.CreateFlags |= SHFL_CF_ACCESS_READ; 241 break; 242 243 case O_WRONLY: 244 params.CreateFlags |= SHFL_CF_ACCESS_WRITE; 245 break; 246 247 case O_RDWR: 248 params.CreateFlags |= SHFL_CF_ACCESS_READWRITE; 249 break; 250 251 default: 252 BUG (); 264 253 } 265 254 } … … 273 262 file->f_flags, params.CreateFlags, rc)); 274 263 kfree (sf_r); 275 return - EPROTO;264 return -RTErrConvertToErrno(rc); 276 265 } 277 266 … … 347 336 page = alloc_page (GFP_HIGHUSER); 348 337 if (!page) { 349 LogRel PrintFunc("failed to allocate page\n");338 LogRelFunc(("failed to allocate page\n")); 350 339 SET_TYPE (VM_FAULT_OOM); 351 340 return NOPAGE_OOM; -
trunk/src/VBox/Additions/linux/sharedfolders/utils.c
r4822 r4860 251 251 tmp = kmalloc (shflstring_len, GFP_KERNEL); 252 252 if (!tmp) { 253 LogRelPrintFunc("kmalloc failed, caller="); 254 LogRelPrint(caller); 253 LogRelFunc(("kmalloc failed, caller=%s\n", caller)); 255 254 return -ENOMEM; 256 255 } … … 419 418 b = kmalloc (sizeof (*b), GFP_KERNEL); 420 419 if (!b) { 421 LogRel PrintFunc("could not alloc directory buffer\n");420 LogRelFunc(("could not alloc directory buffer\n")); 422 421 return NULL; 423 422 } … … 430 429 if (!b->buf) { 431 430 kfree (b); 432 LogRel PrintFunc("could not alloc directory buffer storage\n");431 LogRelFunc(("could not alloc directory buffer storage\n")); 433 432 return NULL; 434 433 } … … 480 479 p = kmalloc (sizeof (*p), GFP_KERNEL); 481 480 if (!p) { 482 LogRel PrintFunc("could not alloc directory info\n");481 LogRelFunc(("could not alloc directory info\n")); 483 482 return NULL; 484 483 } … … 536 535 if (!b) { 537 536 err = -ENOMEM; 538 LogRel PrintFunc("could not alloc directory buffer\n");537 LogRelFunc(("could not alloc directory buffer\n")); 539 538 goto fail1; 540 539 } -
trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.c
r4743 r4860 73 73 if (!sf_g) { 74 74 err = -ENOMEM; 75 LogRel PrintFunc("could not allocate memory for global info\n");75 LogRelFunc(("could not allocate memory for global info\n")); 76 76 goto fail0; 77 77 } … … 91 91 if (!str_name) { 92 92 err = -ENOMEM; 93 LogRel PrintFunc("could not allocate memory for host name\n");93 LogRelFunc(("could not allocate memory for host name\n")); 94 94 goto fail1; 95 95 } … … 196 196 if (!sf_i) { 197 197 err = -ENOMEM; 198 LogRel PrintFunc ("could not allocate memory for root inode info\n");198 LogRelFunc (("could not allocate memory for root inode info\n")); 199 199 goto fail1; 200 200 } … … 203 203 if (!sf_i->path) { 204 204 err = -ENOMEM; 205 LogRel PrintFunc ("could not allocate memory for root inode path\n");205 LogRelFunc (("could not allocate memory for root inode path\n")); 206 206 goto fail2; 207 207 } … … 418 418 rc = vboxInit (); 419 419 if (VBOX_FAILURE (rc)) { 420 LogRelPrintFunc ("vboxInit failed\n"); 421 Log (("rc=%d\n", rc)); 420 LogRelFunc (("vboxInit failed, rc=%d\n", rc)); 422 421 goto fail0; 423 422 } … … 425 424 rc = vboxConnect (&client_handle); 426 425 if (VBOX_FAILURE (rc)) { 427 LogRelPrintFunc ("vboxConnect failed\n"); 428 Log (("rc=%d\n", rc)); 426 LogRelFunc (("vboxConnect failed, rc=%d\n", rc)); 429 427 goto fail1; 430 428 } … … 432 430 rc = vboxCallSetUtf8 (&client_handle); 433 431 if (VBOX_FAILURE (rc)) { 434 LogRelPrintFunc ("vboxCallSetUtf8 failed\n"); 435 Log (("rc=%d\n", rc)); 432 LogRelFunc (("vboxCallSetUtf8 failed, rc=%d\n", rc)); 436 433 goto fail2; 437 434 }
Note:
See TracChangeset
for help on using the changeset viewer.