Commit b77bee27 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent c962c878
...@@ -558,6 +558,8 @@ type Head struct { ...@@ -558,6 +558,8 @@ type Head struct {
// it is also kept rlocked by OS cache uploaders (see BigFile.uploadBlk) // it is also kept rlocked by OS cache uploaders (see BigFile.uploadBlk)
// with additional locking protocol to avoid deadlocks (see below for // with additional locking protocol to avoid deadlocks (see below for
// pauseOSCacheUpload + ...). // pauseOSCacheUpload + ...).
//
// TODO head.zheadMu -> special mutex with Lock(ctx) so that Lock wait could be canceled
zheadMu sync.RWMutex zheadMu sync.RWMutex
zconn *xzodb.ZConn // for head/ zwatcher resyncs head.zconn; others only read zconn objects. zconn *xzodb.ZConn // for head/ zwatcher resyncs head.zconn; others only read zconn objects.
...@@ -730,16 +732,6 @@ func (_ *zodbCacheControl) PCacheClassify(obj zodb.IPersistent) zodb.PCachePolic ...@@ -730,16 +732,6 @@ func (_ *zodbCacheControl) PCacheClassify(obj zodb.IPersistent) zodb.PCachePolic
return 0 return 0
} }
/*
// -------- zhead lock/wait --------
// XXX needed?
// TODO head.zheadMu -> special mutex with Lock(ctx) so that Lock wait could be canceled
func (head *Head) zheadRLock() { head.zheadMu.RLock() }
func (head *Head) zheadRUnlock() { head.zheadMu.RUnlock() }
func (head *Head) zheadLock() { head.zheadMu.Lock() }
func (head *Head) zheadUnlock() { head.zheadMu.Unlock() }
*/
// -------- 4) ZODB invalidation -> OS cache -------- // -------- 4) ZODB invalidation -> OS cache --------
...@@ -2076,7 +2068,7 @@ func (bfdir *BigFileDir) lookup(out *fuse.Attr, name string, fctx *fuse.Context) ...@@ -2076,7 +2068,7 @@ func (bfdir *BigFileDir) lookup(out *fuse.Attr, name string, fctx *fuse.Context)
f2, already := bfdir.fileTab[oid] f2, already := bfdir.fileTab[oid]
if already { if already {
bfdir.fileMu.Unlock() bfdir.fileMu.Unlock()
// no need to f.Close() - BigFile is all just garbage-collected // f.Close() not needed - BigFile is all just garbage-collected
return f2, nil return f2, nil
} }
......
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