Browse Source

temp disable locking

testing
chrislu 2 years ago
parent
commit
4f15a52044
  1. 4
      weed/mount/filehandle.go
  2. 4
      weed/mount/weedfs_attr.go
  3. 4
      weed/mount/weedfs_dir_lookup.go
  4. 4
      weed/mount/weedfs_file_lseek.go
  5. 4
      weed/mount/weedfs_file_sync.go
  6. 8
      weed/mount/weedfs_xattr.go

4
weed/mount/filehandle.go

@ -71,8 +71,8 @@ func (fh *FileHandle) UpdateEntry(fn func(entry *filer_pb.Entry)) *filer_pb.Entr
} }
func (fh *FileHandle) AddChunks(chunks []*filer_pb.FileChunk) { func (fh *FileHandle) AddChunks(chunks []*filer_pb.FileChunk) {
fh.entryLock.Lock()
defer fh.entryLock.Unlock()
//fh.entryLock.Lock()
//defer fh.entryLock.Unlock()
if fh.entry == nil { if fh.entry == nil {
return return

4
weed/mount/weedfs_attr.go

@ -45,8 +45,8 @@ func (wfs *WFS) SetAttr(cancel <-chan struct{}, input *fuse.SetAttrIn, out *fuse
return status return status
} }
if fh != nil { if fh != nil {
fh.entryLock.Lock()
defer fh.entryLock.Unlock()
//fh.entryLock.Lock()
//defer fh.entryLock.Unlock()
} }
if size, ok := input.GetSize(); ok && entry != nil { if size, ok := input.GetSize(); ok && entry != nil {

4
weed/mount/weedfs_dir_lookup.go

@ -58,12 +58,12 @@ func (wfs *WFS) Lookup(cancel <-chan struct{}, header *fuse.InHeader, name strin
inode := wfs.inodeToPath.Lookup(fullFilePath, localEntry.Crtime.Unix(), localEntry.IsDirectory(), len(localEntry.HardLinkId) > 0, localEntry.Inode, true) inode := wfs.inodeToPath.Lookup(fullFilePath, localEntry.Crtime.Unix(), localEntry.IsDirectory(), len(localEntry.HardLinkId) > 0, localEntry.Inode, true)
if fh, found := wfs.fhmap.FindFileHandle(inode); found { if fh, found := wfs.fhmap.FindFileHandle(inode); found {
fh.entryLock.Lock()
//fh.entryLock.Lock()
if entry := fh.GetEntry(); entry != nil { if entry := fh.GetEntry(); entry != nil {
glog.V(4).Infof("lookup opened file %s size %d", dirPath.Child(localEntry.Name()), filer.FileSize(entry)) glog.V(4).Infof("lookup opened file %s size %d", dirPath.Child(localEntry.Name()), filer.FileSize(entry))
localEntry = filer.FromPbEntry(string(dirPath), entry) localEntry = filer.FromPbEntry(string(dirPath), entry)
} }
fh.entryLock.Unlock()
//fh.entryLock.Unlock()
} }
wfs.outputFilerEntry(out, inode, localEntry) wfs.outputFilerEntry(out, inode, localEntry)

4
weed/mount/weedfs_file_lseek.go

@ -38,8 +38,8 @@ func (wfs *WFS) Lseek(cancel <-chan struct{}, in *fuse.LseekIn, out *fuse.LseekO
// lock the file until the proper offset was calculated // lock the file until the proper offset was calculated
fh.orderedMutex.Acquire(context.Background(), 1) fh.orderedMutex.Acquire(context.Background(), 1)
defer fh.orderedMutex.Release(1) defer fh.orderedMutex.Release(1)
fh.entryLock.Lock()
defer fh.entryLock.Unlock()
//fh.entryLock.Lock()
//defer fh.entryLock.Unlock()
fileSize := int64(filer.FileSize(fh.GetEntry())) fileSize := int64(filer.FileSize(fh.GetEntry()))
offset := max(int64(in.Offset), 0) offset := max(int64(in.Offset), 0)

4
weed/mount/weedfs_file_sync.go

@ -118,8 +118,8 @@ func (wfs *WFS) doFlush(fh *FileHandle, uid, gid uint32) fuse.Status {
err := wfs.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error { err := wfs.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error {
fh.entryLock.Lock()
defer fh.entryLock.Unlock()
//fh.entryLock.Lock()
//defer fh.entryLock.Unlock()
entry := fh.GetEntry() entry := fh.GetEntry()
if entry == nil { if entry == nil {

8
weed/mount/weedfs_xattr.go

@ -111,8 +111,8 @@ func (wfs *WFS) SetXAttr(cancel <-chan struct{}, input *fuse.SetXAttrIn, attr st
return fuse.ENOENT return fuse.ENOENT
} }
if fh != nil { if fh != nil {
fh.entryLock.Lock()
defer fh.entryLock.Unlock()
//fh.entryLock.Lock()
//defer fh.entryLock.Unlock()
} }
if entry.Extended == nil { if entry.Extended == nil {
@ -189,8 +189,8 @@ func (wfs *WFS) RemoveXAttr(cancel <-chan struct{}, header *fuse.InHeader, attr
return fuse.OK return fuse.OK
} }
if fh != nil { if fh != nil {
fh.entryLock.Lock()
defer fh.entryLock.Unlock()
//fh.entryLock.Lock()
//defer fh.entryLock.Unlock()
} }
if entry.Extended == nil { if entry.Extended == nil {

Loading…
Cancel
Save