Skip to content

Commit

Permalink
use very high inodeid num for irods entry
Browse files Browse the repository at this point in the history
  • Loading branch information
iychoi committed Dec 4, 2023
1 parent 3f14e2e commit f082460
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
2 changes: 1 addition & 1 deletion irodsfs/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 4 additions & 2 deletions irodsfs/dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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,
}
Expand Down
3 changes: 2 additions & 1 deletion irodsfs/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion irodsfs/irods.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit f082460

Please sign in to comment.