mount2: use consistent inode
This commit is contained in:
@@ -25,6 +25,7 @@ type Attr struct {
|
||||
Md5 []byte
|
||||
FileSize uint64
|
||||
Rdev uint32
|
||||
Inode uint64
|
||||
}
|
||||
|
||||
func (attr Attr) IsDirectory() bool {
|
||||
|
||||
@@ -49,6 +49,7 @@ func EntryAttributeToPb(entry *Entry) *filer_pb.FuseAttributes {
|
||||
Md5: entry.Attr.Md5,
|
||||
FileSize: entry.Attr.FileSize,
|
||||
Rdev: entry.Attr.Rdev,
|
||||
Inode: entry.Attr.Inode,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,6 +77,7 @@ func PbToEntryAttribute(attr *filer_pb.FuseAttributes) Attr {
|
||||
t.Md5 = attr.Md5
|
||||
t.FileSize = attr.FileSize
|
||||
t.Rdev = attr.Rdev
|
||||
t.Inode = attr.Inode
|
||||
|
||||
return t
|
||||
}
|
||||
|
||||
@@ -9,8 +9,6 @@ import (
|
||||
"github.com/chrislusf/seaweedfs/weed/util"
|
||||
)
|
||||
|
||||
type HardLinkId []byte
|
||||
|
||||
const (
|
||||
MsgFailDelNonEmptyFolder = "fail to delete non-empty folder"
|
||||
)
|
||||
|
||||
16
weed/filer/filer_hardlink.go
Normal file
16
weed/filer/filer_hardlink.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package filer
|
||||
|
||||
import (
|
||||
"github.com/chrislusf/seaweedfs/weed/util"
|
||||
)
|
||||
|
||||
const (
|
||||
HARD_LINK_MARKER = '\x01'
|
||||
)
|
||||
|
||||
type HardLinkId []byte // 16 bytes + 1 marker byte
|
||||
|
||||
func NewHardLinkId() HardLinkId {
|
||||
bytes := append(util.RandomBytes(16), HARD_LINK_MARKER)
|
||||
return bytes
|
||||
}
|
||||
Reference in New Issue
Block a user