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