Added FUSE support #55

Merged
Elara6331 merged 65 commits from yannickulrich/itd:fuse into master 2023-03-25 22:23:52 +00:00
1 changed files with 17 additions and 0 deletions
Showing only changes of commit 82ed906857 - Show all commits

View File

@ -373,6 +373,23 @@ func (f *ITNode) Mkdir(ctx context.Context, name string, mode uint32, out *fuse.
return node, 0
}
var _ = (fs.NodeRenamer)((*ITNode)(nil))
func (f *ITNode) Rename(ctx context.Context, name string, newParent fs.InodeEmbedder, newName string, flags uint32) syscall.Errno {
p1 := f.path + "/" + name
p2 := newParent.EmbeddedInode().Path(nil)[2:] + "/" + newName
err := myfs.Rename(p1, p2)
if err != nil {
return syscall.EROFS
}
ino := inodemap[p1]
delete(inodemap, p1)
inodemap[p2] = ino
return 0
}
func main() {
// This is where we'll mount the FS
mntDir := "/tmp/x"