mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
mount2: dir read opened file
This commit is contained in:
parent
320637dc7a
commit
b93d57da31
|
@ -55,6 +55,11 @@ func (wfs *WFS) Lookup(cancel <-chan struct{}, header *fuse.InHeader, name strin
|
|||
|
||||
inode := wfs.inodeToPath.Lookup(fullFilePath, localEntry.IsDirectory(), true)
|
||||
|
||||
if fh, found := wfs.fhmap.FindFileHandle(inode); found {
|
||||
glog.V(4).Infof("lookup opened file %s size %d", dirPath.Child(localEntry.Name()), filer.FileSize(fh.entry))
|
||||
localEntry = filer.FromPbEntry(string(dirPath), fh.entry)
|
||||
}
|
||||
|
||||
wfs.outputFilerEntry(out, inode, localEntry)
|
||||
|
||||
return fuse.OK
|
||||
|
|
|
@ -176,6 +176,10 @@ func (wfs *WFS) doReadDirectory(input *fuse.ReadIn, out *fuse.DirEntryList, isPl
|
|||
isEarlyTerminated = true
|
||||
return false
|
||||
}
|
||||
if fh, found := wfs.fhmap.FindFileHandle(inode); found {
|
||||
glog.V(4).Infof("readdir opened file %s", dirPath.Child(dirEntry.Name))
|
||||
entry = filer.FromPbEntry(string(dirPath), fh.entry)
|
||||
}
|
||||
wfs.outputFilerEntry(entryOut, inode, entry)
|
||||
}
|
||||
dh.lastEntryName = entry.Name()
|
||||
|
|
Loading…
Reference in a new issue