mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
ensure consistent inode value
This commit is contained in:
parent
b971317a16
commit
3074e9b428
|
@ -59,7 +59,7 @@ func (dir *Dir) Attr(ctx context.Context, attr *fuse.Attr) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// attr.Inode = util.FullPath(dir.FullPath()).AsInode()
|
attr.Inode = util.FullPath(dir.FullPath()).AsInode()
|
||||||
attr.Mode = os.FileMode(entry.Attributes.FileMode) | os.ModeDir
|
attr.Mode = os.FileMode(entry.Attributes.FileMode) | os.ModeDir
|
||||||
attr.Mtime = time.Unix(entry.Attributes.Mtime, 0)
|
attr.Mtime = time.Unix(entry.Attributes.Mtime, 0)
|
||||||
attr.Crtime = time.Unix(entry.Attributes.Crtime, 0)
|
attr.Crtime = time.Unix(entry.Attributes.Crtime, 0)
|
||||||
|
@ -331,10 +331,10 @@ func (dir *Dir) ReadDirAll(ctx context.Context) (ret []fuse.Dirent, err error) {
|
||||||
|
|
||||||
processEachEntryFn := func(entry *filer.Entry, isLast bool) {
|
processEachEntryFn := func(entry *filer.Entry, isLast bool) {
|
||||||
if entry.IsDirectory() {
|
if entry.IsDirectory() {
|
||||||
dirent := fuse.Dirent{Name: entry.Name(), Type: fuse.DT_Dir}
|
dirent := fuse.Dirent{Name: entry.Name(), Type: fuse.DT_Dir, Inode: dirPath.Child(entry.Name()).AsInode()}
|
||||||
ret = append(ret, dirent)
|
ret = append(ret, dirent)
|
||||||
} else {
|
} else {
|
||||||
dirent := fuse.Dirent{Name: entry.Name(), Type: findFileType(uint16(entry.Attr.Mode))}
|
dirent := fuse.Dirent{Name: entry.Name(), Type: findFileType(uint16(entry.Attr.Mode)), Inode: dirPath.Child(entry.Name()).AsInode()}
|
||||||
ret = append(ret, dirent)
|
ret = append(ret, dirent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ func (file *File) Attr(ctx context.Context, attr *fuse.Attr) (err error) {
|
||||||
return fuse.ENOENT
|
return fuse.ENOENT
|
||||||
}
|
}
|
||||||
|
|
||||||
// attr.Inode = file.fullpath().AsInode()
|
attr.Inode = file.fullpath().AsInode()
|
||||||
attr.Valid = time.Second
|
attr.Valid = time.Second
|
||||||
attr.Mode = os.FileMode(entry.Attributes.FileMode)
|
attr.Mode = os.FileMode(entry.Attributes.FileMode)
|
||||||
attr.Size = filer.FileSize(entry)
|
attr.Size = filer.FileSize(entry)
|
||||||
|
|
Loading…
Reference in a new issue