Commit 305708cc authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Gofix mapdelete.

parent ceb0c2a3
......@@ -161,6 +161,6 @@ func (me *BufferPoolImpl) FreeBuffer(slice []byte) {
exp, ok := me.outstandingBuffers[key]
if ok {
me.addBuffer(slice, exp)
me.outstandingBuffers[key] = 0, false
delete(me.outstandingBuffers, key)
}
}
......@@ -324,8 +324,8 @@ func (me *FileSystemConnector) Unmount(node *Inode) Status {
mount.mountInode = nil
mountInode.mountPoint = nil
parentNode.mounts[name] = nil, false
parentNode.children[name] = nil, false
delete(parentNode.mounts, name)
delete(parentNode.children, name)
mount.fs.OnUnmount()
me.EntryNotify(parentNode, name)
......
......@@ -86,7 +86,7 @@ func (me *portableHandleMap) Forget(h uint64) *Handled {
defer me.Unlock()
v := me.handles[h]
v.check = 0
me.handles[h] = nil, false
delete(me.handles, h)
return v
}
......@@ -128,7 +128,7 @@ func (me *int32HandleMap) Forget(handle uint64) *Handled {
me.mutex.Lock()
defer me.mutex.Unlock()
val.check = 0
me.handles[uint32(handle)] = nil, false
delete(me.handles, uint32(handle))
return val
}
......@@ -233,7 +233,7 @@ func (me *int64HandleMap) Forget(handle uint64) (val *Handled) {
me.mutex.Lock()
defer me.mutex.Unlock()
me.handles[handle] = nil, false
delete(me.handles, handle)
val.check = 0
return val
}
......
......@@ -177,7 +177,7 @@ func (me *Inode) addChild(name string, child *Inode) {
func (me *Inode) rmChild(name string) (ch *Inode) {
ch = me.children[name]
if ch != nil {
me.children[name] = nil, false
delete(me.children, name)
}
return ch
}
......
......@@ -301,7 +301,7 @@ func (me *pathInode) rmChild(name string) *pathInode {
ch.Name = m[0].name
return ch
} else {
me.pathFs.clientInodeMap[ch.clientInode] = nil, false
delete(me.pathFs.clientInodeMap, ch.clientInode)
}
}
......@@ -319,7 +319,7 @@ func (me *pathInode) setClientInode(ino uint64) {
}
defer me.LockTree()()
if me.clientInode != 0 {
me.pathFs.clientInodeMap[me.clientInode] = nil, false
delete(me.pathFs.clientInodeMap, me.clientInode)
}
me.clientInode = ino
......@@ -336,7 +336,7 @@ func (me *pathInode) OnForget() {
return
}
defer me.LockTree()()
me.pathFs.clientInodeMap[me.clientInode] = nil, false
delete(me.pathFs.clientInodeMap, me.clientInode)
}
////////////////////////////////////////////////////////////////
......
......@@ -82,7 +82,7 @@ func (me *XAttrTestFs) RemoveXAttr(name string, attr string, context *Context) S
if !ok {
return ENODATA
}
me.attrs[attr] = nil, false
delete(me.attrs, attr)
return OK
}
......
......@@ -134,8 +134,8 @@ func (me *AutoUnionFs) rmFs(name string) (code fuse.Status) {
code = me.nodeFs.Unmount(name)
if code.Ok() {
me.knownFileSystems[name] = knownFs{}, false
me.nameRootMap[name] = "", false
delete(me.knownFileSystems, name)
delete(me.nameRootMap, name)
} else {
log.Printf("Unmount failed for %s. Code %v", name, code)
}
......
......@@ -81,7 +81,7 @@ func (me *DirCache) RemoveEntry(name string) {
return
}
me.names[name] = false, false
delete(me.names, name)
}
func (me *DirCache) AddEntry(name string) {
......
......@@ -69,7 +69,7 @@ func (me *TimedCache) DropEntry(name string) {
me.cacheMapMutex.Lock()
defer me.cacheMapMutex.Unlock()
me.cacheMap[name] = nil, false
delete(me.cacheMap, name)
}
func (me *TimedCache) GetFresh(name string) interface{} {
......@@ -91,7 +91,7 @@ func (me *TimedCache) Purge() {
}
}
for _, k := range keys {
me.cacheMap[k] = nil, false
delete(me.cacheMap, k)
}
}
......@@ -113,7 +113,7 @@ func (me *TimedCache) DropAll(names []string) {
me.cacheMap = make(map[string]*cacheEntry, len(me.cacheMap))
} else {
for _, nm := range names {
me.cacheMap[nm] = nil, false
delete(me.cacheMap, nm)
}
}
}
......@@ -791,9 +791,9 @@ func (me *UnionFs) OpenDir(directory string, context *fuse.Context) (stream chan
}
}
if directory == "" {
results[me.options.DeletionDirName] = 0, false
delete(results, me.options.DeletionDirName)
// HACK.
results[_READONLY] = 0, false
delete(results, _READONLY)
}
stream = make(chan fuse.DirEntry, len(results))
......
......@@ -125,8 +125,8 @@ func (me *MultiZipFs) Unlink(name string, context *fuse.Context) (code fuse.Stat
if !code.Ok() {
return code
}
me.zips[basename] = nil, false
me.dirZipFileMap[basename] = "", false
delete(me.zips, basename)
delete(me.dirZipFileMap, basename)
return fuse.OK
} else {
return fuse.ENOENT
......
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