Changeset 223 for branches/samba-3.3.x/source/utils/net_conf.c
- Timestamp:
- May 24, 2009, 7:51:24 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.3.x/source/utils/net_conf.c
r221 r223 339 339 &service); 340 340 if (!W_ERROR_IS_OK(werr)) { 341 goto done;341 goto cancel; 342 342 } 343 343 werr = import_process_service(c, conf_ctx, service); 344 344 if (!W_ERROR_IS_OK(werr)) { 345 goto done;345 goto cancel; 346 346 } 347 347 } else { … … 353 353 &services); 354 354 if (!W_ERROR_IS_OK(werr)) { 355 goto done;355 goto cancel; 356 356 } 357 357 if (!c->opt_testmode) { 358 358 werr = smbconf_drop(conf_ctx); 359 359 if (!W_ERROR_IS_OK(werr)) { 360 goto done; 361 } 362 } 360 goto cancel; 361 } 362 } 363 364 /* 365 * Wrap the importing of shares into a transaction, 366 * but only 100 at a time, in order to serve memory. 367 * The allocated memory accumulates across the actions 368 * within the transaction, and for me, some 1500 369 * imported shares, the MAX_TALLOC_SIZE of 256 MB 370 * was exceeded. 371 */ 372 werr = smbconf_transaction_start(conf_ctx); 373 if (!W_ERROR_IS_OK(werr)) { 374 d_printf("error starting transaction: %s\n", 375 win_errstr(werr)); 376 goto done; 377 } 378 363 379 for (sidx = 0; sidx < num_shares; sidx++) { 364 380 werr = import_process_service(c, conf_ctx, 365 381 services[sidx]); 366 382 if (!W_ERROR_IS_OK(werr)) { 383 goto cancel; 384 } 385 386 if (sidx % 100) { 387 continue; 388 } 389 390 werr = smbconf_transaction_commit(conf_ctx); 391 if (!W_ERROR_IS_OK(werr)) { 392 d_printf("error committing transaction: %s\n", 393 win_errstr(werr)); 367 394 goto done; 368 395 } 369 } 370 } 371 372 ret = 0; 396 werr = smbconf_transaction_start(conf_ctx); 397 if (!W_ERROR_IS_OK(werr)) { 398 d_printf("error starting transaction: %s\n", 399 win_errstr(werr)); 400 goto done; 401 } 402 } 403 } 404 405 werr = smbconf_transaction_commit(conf_ctx); 406 if (!W_ERROR_IS_OK(werr)) { 407 d_printf("error committing transaction: %s\n", 408 win_errstr(werr)); 409 } else { 410 ret = 0; 411 } 412 413 goto done; 414 415 cancel: 416 werr = smbconf_transaction_cancel(conf_ctx); 417 if (!W_ERROR_IS_OK(werr)) { 418 d_printf("error cancelling transaction: %s\n", 419 win_errstr(werr)); 420 } 373 421 374 422 done:
Note:
See TracChangeset
for help on using the changeset viewer.