remove nlink property from directory node
This commit is contained in:
@@ -31,11 +31,6 @@ func (filer *MemDbStore) InsertEntry(entry *filer2.Entry) (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (filer *MemDbStore) AddDirectoryLink(directory *filer2.Entry, delta int32) (err error) {
|
||||
directory.Nlink = uint32(int32(directory.Nlink) + delta)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (filer *MemDbStore) AppendFileChunk(fullpath filer2.FullPath, fileChunk filer2.FileChunk) (err error) {
|
||||
found, entry, err := filer.FindEntry(fullpath)
|
||||
if !found {
|
||||
|
||||
@@ -101,8 +101,9 @@ func TestCreateFileAndList(t *testing.T) {
|
||||
return
|
||||
}
|
||||
|
||||
file3Path := filer2.FullPath("/home/chris/this/is/file3.jpg")
|
||||
entry3 := &filer2.Entry{
|
||||
FullPath: filer2.FullPath("/home/chris/this/is/file3.jpg"),
|
||||
FullPath: file3Path,
|
||||
Attr: filer2.Attr{
|
||||
Mode: 0440,
|
||||
Uid: 1234,
|
||||
@@ -118,4 +119,12 @@ func TestCreateFileAndList(t *testing.T) {
|
||||
return
|
||||
}
|
||||
|
||||
// delete file and count
|
||||
filer.DeleteEntry(file3Path)
|
||||
entries, _ = filer.ListDirectoryEntries(filer2.FullPath("/home/chris/this/is"))
|
||||
if len(entries) != 1 {
|
||||
t.Errorf("list entries count: %v", len(entries))
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user