Added FUSE support #55

Merged
Elara6331 merged 65 commits from yannickulrich/itd:fuse into master 2023-03-25 22:23:52 +00:00
Showing only changes of commit 9d3fdeb78f - Show all commits

View File

@ -346,6 +346,33 @@ func (f *ITNode) Create(ctx context.Context, name string, flags uint32, mode uin
return node, fh, fuseFlags, 0 return node, fh, fuseFlags, 0
} }
var _ = (fs.NodeMkdirer)((*ITNode)(nil))
func (f *ITNode) Mkdir(ctx context.Context, name string, mode uint32, out *fuse.EntryOut) (*fs.Inode, syscall.Errno) {
if f.kind != 2 {
return nil, syscall.EROFS
}
path := f.path + "/" + name
err := myfs.Mkdir(path)
if err != nil {
return nil, syscall.EROFS
}
ino := uint64(len(inodemap)) + 11
inodemap[path] = ino
stable := fs.StableAttr{
Mode: fuse.S_IFDIR,
Ino: ino,
}
operations := &ITNode{
kind: 2, Ino: ino,
path : path,
}
node := f.NewInode(ctx, operations, stable)
return node, 0
}
func main() { func main() {
// This is where we'll mount the FS // This is where we'll mount the FS
mntDir := "/tmp/x" mntDir := "/tmp/x"