Skip to content

Commit ff6eb57

Browse files
author
Lars Silvén
committed
Ignore objectstore.readrefresh when using DB.
No performance enhancement was detected when not doing mutex lock.
1 parent 418b23c commit ff6eb57

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

src/lib/common/softhsm2.conf.5.in

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,9 @@ library.reset_on_fork = true
103103
.RE
104104
.LP
105105
.SH OBJECTSTORE.READREFRESH
106-
If set to false, then this will affect the refreshing of the object store in
107-
the following way before an object is used but not changed:
108-
.IP * 2
109-
No files will be read if 'objectstore.backend = file'.
110-
.IP * 2
111-
No wait for mutex to unlock if 'objectstore.backend = db'.
106+
If set to false and if 'objectstore.backend = file', then this will affect
107+
the refreshing of the object store.
108+
Before using an object that is not changed, no files will be read.
112109
.LP
113110
Depending of what kind of HW that is used setting 'false' may improve the
114111
performance of the HSM.
@@ -119,7 +116,9 @@ unmodified or deleted object even if it is changed or deleted. Another
119116
process may have called C_DestroyObject or C_SetAttributeValue. But every
120117
time a process gets a new handle for an object the objectstore of this
121118
process is updated for all objects even if this property is false.
122-
.LP
119+
.LP
120+
If 'objectstore.backend = db' then the value of this property is ignored.
121+
.LP
123122
Default is true.
124123
.LP
125124
.RS

src/lib/object_store/DBObject.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,15 +1362,10 @@ bool DBObject::deleteAttribute(CK_ATTRIBUTE_TYPE type)
13621362
}
13631363

13641364
// The validity state of the object
1365-
// If not 'doRefresh' we know that the object allready exists in the DB
1366-
// and hence _objectId should have been initialized.
1367-
bool DBObject::isValid(const bool doRefresh)
1365+
bool DBObject::isValid(const bool doRefresh __attribute__((unused)))
13681366
{
1369-
if (doRefresh)
1370-
{
1371-
// Wait for update of object.
1372-
MutexLocker lock(_mutex);
1373-
}
1367+
MutexLocker lock(_mutex);
1368+
13741369
return _objectId != 0 && _connection != NULL;
13751370
}
13761371

0 commit comments

Comments
 (0)