From f082460a7068fe43621789a4ff78ae12bb9be27e Mon Sep 17 00:00:00 2001 From: Illyoung Choi Date: Mon, 4 Dec 2023 12:03:30 -0700 Subject: [PATCH] use very high inodeid num for irods entry --- go.mod | 2 +- go.sum | 4 ++-- irodsfs/common.go | 2 +- irodsfs/dir.go | 6 ++++-- irodsfs/fs.go | 3 ++- irodsfs/irods.go | 1 - 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 5aff233..01f4f2b 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/cyverse/go-irodsclient v0.12.19 - github.com/cyverse/irodsfs-common v0.0.0-20231129193344-5f38b97f63ec + github.com/cyverse/irodsfs-common v0.0.0-20231204184731-17326bdd41c3 github.com/cyverse/irodsfs-monitor v0.0.0-20220809235922-daf13261a2dc github.com/cyverse/irodsfs-pool v0.6.22 github.com/hanwen/go-fuse/v2 v2.3.0 diff --git a/go.sum b/go.sum index fe37e3c..178e80f 100644 --- a/go.sum +++ b/go.sum @@ -6,8 +6,8 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cyverse/go-irodsclient v0.12.19 h1:I/u9N5M7FdB7HqANaK1xqigEQ10HJU7dJKajp04m45c= github.com/cyverse/go-irodsclient v0.12.19/go.mod h1:fuYhSizhXhRoy4MWcyo2IKk6f3oCqhvo2UCQAyPN/Aw= -github.com/cyverse/irodsfs-common v0.0.0-20231129193344-5f38b97f63ec h1:AbGowZqV+2wlroKBBNhlKK92aDLp3TPG692bg68JFkU= -github.com/cyverse/irodsfs-common v0.0.0-20231129193344-5f38b97f63ec/go.mod h1:Np0MUgLC2BKk+HrEBPLhJ9ZXhUKCwVxmSQwaHSEwtDo= +github.com/cyverse/irodsfs-common v0.0.0-20231204184731-17326bdd41c3 h1:mEap1fqJkaqI92YhUbwgItghiW62PEjxyihLiXQqeZc= +github.com/cyverse/irodsfs-common v0.0.0-20231204184731-17326bdd41c3/go.mod h1:Np0MUgLC2BKk+HrEBPLhJ9ZXhUKCwVxmSQwaHSEwtDo= github.com/cyverse/irodsfs-monitor v0.0.0-20220809235922-daf13261a2dc h1:gIpG0ETQOEZloFwB5iU2zljVsoUDTpUEl/3WF19gLNk= github.com/cyverse/irodsfs-monitor v0.0.0-20220809235922-daf13261a2dc/go.mod h1:8UE1mT26+0vAsqS9UJ6Q/vlKq3da6FLdt5p6Tt1AIC4= github.com/cyverse/irodsfs-pool v0.6.22 h1:kjqRXx08HmqcrFQ+URN6zuGoYDHOhN4OwqPNWpZDmXA= diff --git a/irodsfs/common.go b/irodsfs/common.go index 7a5dd42..5dd6ef3 100644 --- a/irodsfs/common.go +++ b/irodsfs/common.go @@ -14,7 +14,7 @@ import ( ) func setAttrOutForVirtualDirEntry(inodeManager *irodsfs_common_inode.InodeManager, entry *irodsfs_common_vpath.VPathVirtualDirEntry, uid uint32, gid uint32, out *fuse.Attr) { - out.Ino = entry.ID + out.Ino = inodeManager.GetInodeIDForVPathEntryID(entry.ID) out.Uid = uid out.Gid = gid out.SetTimes(&entry.ModifyTime, &entry.ModifyTime, &entry.ModifyTime) diff --git a/irodsfs/dir.go b/irodsfs/dir.go index 192fae0..7720e18 100644 --- a/irodsfs/dir.go +++ b/irodsfs/dir.go @@ -425,7 +425,8 @@ func (dir *Dir) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*f // Virtual Dir if vpathEntry.IsVirtualDirEntry() { if vpathEntry.Path == targetPath { - _, subDirInode := NewSubDirInode(ctx, dir, vpathEntry.VirtualDirEntry.ID, targetPath) + inodeID := dir.fs.inodeManager.GetInodeIDForVPathEntryID(vpathEntry.VirtualDirEntry.ID) + _, subDirInode := NewSubDirInode(ctx, dir, inodeID, targetPath) setAttrOutForVirtualDirEntry(dir.fs.inodeManager, vpathEntry.VirtualDirEntry, dir.fs.uid, dir.fs.gid, &out.Attr) return subDirInode, fusefs.OK } @@ -554,8 +555,9 @@ func (dir *Dir) Readdir(ctx context.Context) (fusefs.DirStream, syscall.Errno) { for _, entry := range vpathEntry.VirtualDirEntry.DirEntries { if entry.IsVirtualDirEntry() { // Virtual Dir entry + inodeID := dir.fs.inodeManager.GetInodeIDForVPathEntryID(entry.VirtualDirEntry.ID) dirEntry := fuse.DirEntry{ - Ino: entry.VirtualDirEntry.ID, + Ino: inodeID, Mode: uint32(fuse.S_IFDIR), Name: entry.VirtualDirEntry.Name, } diff --git a/irodsfs/fs.go b/irodsfs/fs.go index 387c51c..b8eef9f 100644 --- a/irodsfs/fs.go +++ b/irodsfs/fs.go @@ -384,7 +384,8 @@ func (fs *IRODSFS) Root() (*Dir, error) { } if vpathEntry.IsVirtualDirEntry() { - return NewDir(fs, vpathEntry.VirtualDirEntry.ID, "/"), nil + inodeID := fs.inodeManager.GetInodeIDForVPathEntryID(vpathEntry.VirtualDirEntry.ID) + return NewDir(fs, inodeID, "/"), nil } return NewIRODSRoot(fs, vpathEntry) diff --git a/irodsfs/irods.go b/irodsfs/irods.go index 74a99a9..d411625 100644 --- a/irodsfs/irods.go +++ b/irodsfs/irods.go @@ -588,7 +588,6 @@ func IRODSCreate(ctx context.Context, fs *IRODSFS, dir *Dir, path string, flags mode := IRODSGetACL(ctx, fs, entry, false) setAttrOutForIRODSEntry(fs.inodeManager, entry, fs.uid, fs.gid, mode, &out.Attr) - return entry.ID, fileHandle, fusefs.OK }