You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.3 KiB

  1. diff -urN db-4.7.25.NC/lock/lock.c db-4.7.25.NC.new/lock/lock.c
  2. --- db-4.7.25.NC/lock/lock.c 2008-05-07 14:27:35.000000000 +0200
  3. +++ db-4.7.25.NC.new/lock/lock.c 2009-11-08 12:52:19.000000000 +0100
  4. @@ -1274,10 +1274,12 @@
  5. SH_TAILQ_REMOVE(
  6. &lt->obj_tab[obj_ndx], sh_obj, links, __db_lockobj);
  7. if (sh_obj->lockobj.size > sizeof(sh_obj->objdata)) {
  8. - LOCK_REGION_LOCK(env);
  9. + if (region->part_t_size != 1)
  10. + LOCK_REGION_LOCK(env);
  11. __env_alloc_free(&lt->reginfo,
  12. SH_DBT_PTR(&sh_obj->lockobj));
  13. - LOCK_REGION_UNLOCK(env);
  14. + if (region->part_t_size != 1)
  15. + LOCK_REGION_UNLOCK(env);
  16. }
  17. SH_TAILQ_INSERT_HEAD(
  18. &FREE_OBJS(lt, part_id), sh_obj, links, __db_lockobj);
  19. @@ -1467,15 +1469,21 @@
  20. if (obj->size <= sizeof(sh_obj->objdata))
  21. p = sh_obj->objdata;
  22. else {
  23. - LOCK_REGION_LOCK(env);
  24. + /*
  25. + * If we have only one partition, the region is locked.
  26. + */
  27. + if (region->part_t_size != 1)
  28. + LOCK_REGION_LOCK(env);
  29. if ((ret =
  30. __env_alloc(&lt->reginfo, obj->size, &p)) != 0) {
  31. __db_errx(env,
  32. "No space for lock object storage");
  33. - LOCK_REGION_UNLOCK(env);
  34. + if (region->part_t_size != 1)
  35. + LOCK_REGION_UNLOCK(env);
  36. goto err;
  37. }
  38. - LOCK_REGION_UNLOCK(env);
  39. + if (region->part_t_size != 1)
  40. + LOCK_REGION_UNLOCK(env);
  41. }
  42. memcpy(p, obj->data, obj->size);