aboutsummaryrefslogtreecommitdiff
path: root/weed/util/fullpath.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/util/fullpath.go')
-rw-r--r--weed/util/fullpath.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/weed/util/fullpath.go b/weed/util/fullpath.go
index 85028b052..404187e8b 100644
--- a/weed/util/fullpath.go
+++ b/weed/util/fullpath.go
@@ -41,8 +41,14 @@ func (fp FullPath) Child(name string) FullPath {
return FullPath(dir + "/" + noPrefix)
}
-func (fp FullPath) AsInode() uint64 {
- return uint64(HashStringToLong(string(fp)))
+func (fp FullPath) AsInode(isDirectory bool) uint64 {
+ inode := uint64(HashStringToLong(string(fp)))
+ if isDirectory {
+ inode = inode - inode%2 // even
+ } else {
+ inode = inode - inode%2 + 1 // odd
+ }
+ return inode
}
// split, but skipping the root