refactor: moved to locked entry
This commit is contained in:
@@ -103,17 +103,13 @@ func (wfs *WFS) SetXAttr(cancel <-chan struct{}, input *fuse.SetXAttrIn, attr st
|
||||
}
|
||||
}
|
||||
|
||||
path, fh, entry, status := wfs.maybeReadEntry(input.NodeId)
|
||||
path, _, entry, status := wfs.maybeReadEntry(input.NodeId)
|
||||
if status != fuse.OK {
|
||||
return status
|
||||
}
|
||||
if entry == nil {
|
||||
return fuse.ENOENT
|
||||
}
|
||||
if fh != nil {
|
||||
fh.entryLock.Lock()
|
||||
defer fh.entryLock.Unlock()
|
||||
}
|
||||
|
||||
if entry.Extended == nil {
|
||||
entry.Extended = make(map[string][]byte)
|
||||
@@ -181,17 +177,13 @@ func (wfs *WFS) RemoveXAttr(cancel <-chan struct{}, header *fuse.InHeader, attr
|
||||
if len(attr) == 0 {
|
||||
return fuse.EINVAL
|
||||
}
|
||||
path, fh, entry, status := wfs.maybeReadEntry(header.NodeId)
|
||||
path, _, entry, status := wfs.maybeReadEntry(header.NodeId)
|
||||
if status != fuse.OK {
|
||||
return status
|
||||
}
|
||||
if entry == nil {
|
||||
return fuse.OK
|
||||
}
|
||||
if fh != nil {
|
||||
fh.entryLock.Lock()
|
||||
defer fh.entryLock.Unlock()
|
||||
}
|
||||
|
||||
if entry.Extended == nil {
|
||||
return fuse.ENOATTR
|
||||
|
||||
Reference in New Issue
Block a user