aboutsummaryrefslogtreecommitdiff
path: root/weed/mount/weedfs_dir_read.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2024-09-12 22:45:30 -0700
committerchrislu <chris.lu@gmail.com>2024-09-12 22:45:30 -0700
commita9c9e1bcb33855b2778c09680bb41b8651cab1ad (patch)
treea50ff3737657811a1fd25b1230c97bd20738647d /weed/mount/weedfs_dir_read.go
parent6063a889ed61b4e3ef29360faa5d7623a4a70364 (diff)
downloadseaweedfs-a9c9e1bcb33855b2778c09680bb41b8651cab1ad.tar.xz
seaweedfs-a9c9e1bcb33855b2778c09680bb41b8651cab1ad.zip
refactor
Diffstat (limited to 'weed/mount/weedfs_dir_read.go')
-rw-r--r--weed/mount/weedfs_dir_read.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/weed/mount/weedfs_dir_read.go b/weed/mount/weedfs_dir_read.go
index c80ecce9e..6e18b50e8 100644
--- a/weed/mount/weedfs_dir_read.go
+++ b/weed/mount/weedfs_dir_read.go
@@ -46,30 +46,30 @@ func NewDirectoryHandleToInode() *DirectoryHandleToInode {
func (wfs *WFS) AcquireDirectoryHandle() (DirectoryHandleId, *DirectoryHandle) {
fh := FileHandleId(util.RandomUint64())
- wfs.dhmap.Lock()
- defer wfs.dhmap.Unlock()
+ wfs.dhMap.Lock()
+ defer wfs.dhMap.Unlock()
dh := new(DirectoryHandle)
dh.reset()
- wfs.dhmap.dir2inode[DirectoryHandleId(fh)] = dh
+ wfs.dhMap.dir2inode[DirectoryHandleId(fh)] = dh
return DirectoryHandleId(fh), dh
}
func (wfs *WFS) GetDirectoryHandle(dhid DirectoryHandleId) *DirectoryHandle {
- wfs.dhmap.Lock()
- defer wfs.dhmap.Unlock()
- if dh, found := wfs.dhmap.dir2inode[dhid]; found {
+ wfs.dhMap.Lock()
+ defer wfs.dhMap.Unlock()
+ if dh, found := wfs.dhMap.dir2inode[dhid]; found {
return dh
}
dh := new(DirectoryHandle)
dh.reset()
- wfs.dhmap.dir2inode[dhid] = dh
+ wfs.dhMap.dir2inode[dhid] = dh
return dh
}
func (wfs *WFS) ReleaseDirectoryHandle(dhid DirectoryHandleId) {
- wfs.dhmap.Lock()
- defer wfs.dhmap.Unlock()
- delete(wfs.dhmap.dir2inode, dhid)
+ wfs.dhMap.Lock()
+ defer wfs.dhMap.Unlock()
+ delete(wfs.dhMap.dir2inode, dhid)
}
// Directory handling
@@ -169,7 +169,7 @@ func (wfs *WFS) doReadDirectory(input *fuse.ReadIn, out *fuse.DirEntryList, isPl
isEarlyTerminated = true
return false
}
- if fh, found := wfs.fhmap.FindFileHandle(inode); found {
+ 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.GetEntry().GetEntry())
}