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.
 
 
 
 
 
 

42 lines
1.3 KiB

--- a/lock/lock.c
+++ b/lock/lock.c
@@ -1274,10 +1274,12 @@ __lock_put_internal(lt, lockp, obj_ndx,
SH_TAILQ_REMOVE(
&lt->obj_tab[obj_ndx], sh_obj, links, __db_lockobj);
if (sh_obj->lockobj.size > sizeof(sh_obj->objdata)) {
- LOCK_REGION_LOCK(env);
+ if (region->part_t_size != 1)
+ LOCK_REGION_LOCK(env);
__env_alloc_free(&lt->reginfo,
SH_DBT_PTR(&sh_obj->lockobj));
- LOCK_REGION_UNLOCK(env);
+ if (region->part_t_size != 1)
+ LOCK_REGION_UNLOCK(env);
}
SH_TAILQ_INSERT_HEAD(
&FREE_OBJS(lt, part_id), sh_obj, links, __db_lockobj);
@@ -1467,15 +1469,21 @@ retry: SH_TAILQ_FOREACH(sh_obj, &lt->obj
if (obj->size <= sizeof(sh_obj->objdata))
p = sh_obj->objdata;
else {
- LOCK_REGION_LOCK(env);
+ /*
+ * If we have only one partition, the region is locked.
+ */
+ if (region->part_t_size != 1)
+ LOCK_REGION_LOCK(env);
if ((ret =
__env_alloc(&lt->reginfo, obj->size, &p)) != 0) {
__db_errx(env,
"No space for lock object storage");
- LOCK_REGION_UNLOCK(env);
+ if (region->part_t_size != 1)
+ LOCK_REGION_UNLOCK(env);
goto err;
}
- LOCK_REGION_UNLOCK(env);
+ if (region->part_t_size != 1)
+ LOCK_REGION_UNLOCK(env);
}
memcpy(p, obj->data, obj->size);