Commit 862d57af authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 9212b13c
...@@ -306,7 +306,7 @@ error _Conn::__pin1(PinReq *req) { ...@@ -306,7 +306,7 @@ error _Conn::__pin1(PinReq *req) {
// on error don't need to continue with other mappings - all fileh and // on error don't need to continue with other mappings - all fileh and
// all mappings become marked invalid on pinner failure. // all mappings become marked invalid on pinner failure.
// XXX all call wconn._down from here under wconn._filehmu lock? // XXX all call wconn._down from here under wconn._mu lock?
if (err != nil) if (err != nil)
return err; return err;
...@@ -435,11 +435,11 @@ error _FileH::close() { ...@@ -435,11 +435,11 @@ error _FileH::close() {
// remove fileh from wconn._filehTab // remove fileh from wconn._filehTab
// fileh.close can be called several times and after first call another // fileh.close can be called several times and after first call another
// fileh could be opened for the same foid. Be careful not to erase it. // fileh could be opened for the same foid. Be careful not to erase it.
wconn->_filehmu.lock(); wconn->_mu.lock();
// XXX decref open count // XXX decref open count
if (wconn->_filehTab.get(fileh.foid)._ptr() == &fileh) if (wconn->_filehTab.get(fileh.foid)._ptr() == &fileh)
wconn->_filehTab.erase(fileh.foid); wconn->_filehTab.erase(fileh.foid);
wconn->_filehmu.unlock(); wconn->_mu.unlock();
return E(fileh._headf->close()); return E(fileh._headf->close());
} }
...@@ -582,9 +582,9 @@ error _Conn::resync(zodb::Tid at) { ...@@ -582,9 +582,9 @@ error _Conn::resync(zodb::Tid at) {
error err; error err;
wconn._downMu.lock(); // wconn._downMu.lock(); XXX
err = wconn._downErr; err = wconn._downErr;
wconn._downMu.unlock(); // wconn._downMu.unlock(); XXX
if (err != nil) if (err != nil)
return E(err); return E(err);
...@@ -713,15 +713,15 @@ error _Mapping::_remmapblk(int64_t blk, zodb::Tid at) { ...@@ -713,15 +713,15 @@ error _Mapping::_remmapblk(int64_t blk, zodb::Tid at) {
// RW dirty page was e.g. discarded. // RW dirty page was e.g. discarded.
error _Mapping::remmap_blk(int64_t blk) { error _Mapping::remmap_blk(int64_t blk) {
_Mapping& mmap = *this; _Mapping& mmap = *this;
FileH f = mmap->fileh; FileH f = mmap.fileh;
// NOTE virtmem lock is held by virtmem caller // NOTE virtmem lock is held by virtmem caller
// XXX locking ok? // XXX locking ok?
f.wconn._atMu.RLock(); f->wconn->_atMu.RLock();
f._mu.lock(); f->_mu.lock();
defer([&]() { defer([&]() {
f._mu.unlock(); f->_mu.unlock();
f.wconn._atMu.RUnlock(); f->wconn->_atMu.RUnlock();
}); });
if (!(mmap.blk_start <= blk && blk < mmap.blk_stop())) if (!(mmap.blk_start <= blk && blk < mmap.blk_stop()))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment