swarm: fix megacheck warnings

This commit is contained in:
Egon Elbre
2017-08-08 20:34:35 +03:00
parent 6ca59d98f8
commit 133de3d806
18 changed files with 39 additions and 108 deletions

View File

@ -59,14 +59,6 @@ type MountInfo struct {
lock *sync.RWMutex
}
// Inode numbers need to be unique, they are used for caching inside fuse
func newInode() uint64 {
inodeLock.Lock()
defer inodeLock.Unlock()
inode += 1
return inode
}
func NewMountInfo(mhash, mpoint string, sapi *api.Api) *MountInfo {
newMountInfo := &MountInfo{
MountPoint: mpoint,
@ -103,7 +95,7 @@ func (self *SwarmFS) Mount(mhash, mountpoint string) (*MountInfo, error) {
}
log.Info(fmt.Sprintf("Attempting to mount %s ", cleanedMountPoint))
key, manifestEntryMap, err := self.swarmApi.BuildDirectoryTree(mhash, true)
_, manifestEntryMap, err := self.swarmApi.BuildDirectoryTree(mhash, true)
if err != nil {
return nil, err
}
@ -116,8 +108,7 @@ func (self *SwarmFS) Mount(mhash, mountpoint string) (*MountInfo, error) {
mi.rootDir = rootDir
for suffix, entry := range manifestEntryMap {
key = common.Hex2Bytes(entry.Hash)
key := common.Hex2Bytes(entry.Hash)
fullpath := "/" + suffix
basepath := filepath.Dir(fullpath)