Skip to content

feat: implement open virtual drive folder functionality and error handling#312

Open
egalvis27 wants to merge 1 commit intofeat/go-fuse-daemonfrom
feat/implement-open-virtual-drive-folder
Open

feat: implement open virtual drive folder functionality and error handling#312
egalvis27 wants to merge 1 commit intofeat/go-fuse-daemonfrom
feat/implement-open-virtual-drive-folder

Conversation

@egalvis27
Copy link
Copy Markdown

What is Changed / Added


When switching to the new daemon, the option to open the virtual drive folder from the widget had stopped working; this functionality has now been restored.

MaxReadAhead: 128 * 1024,
DisableXAttrs: false,
Debug: false,
DirectMount: true,
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a new parameter that, according to the documentation, cleans up existing mounts before remounting. This prevents orphaned mounts from causing remount failures.

https://github.com/hanwen/go-fuse/blob/v2.9.0/fuse/api.go#L312

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
13.2% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Comment on lines 39 to 57
func (fs *InternxtFilesystem) GetAttr(name string, context *fuse.Context) (*fuse.Attr, fuse.Status) {
fs.logger.Warn("not implemented", "op", "GetAttr", "path", name)
return nil, fuse.ENOSYS
if isRootPath(name) {
return &fuse.Attr{
Mode: uint32(syscall.S_IFDIR | 0o755),
Nlink: 2,
Owner: fuse.Owner{Uid: context.Owner.Uid, Gid: context.Owner.Gid},
}, fuse.OK
}

return nil, fuse.ENOENT
}

func (fs *InternxtFilesystem) OpenDir(name string, context *fuse.Context) ([]fuse.DirEntry, fuse.Status) {
fs.logger.Warn("not implemented", "op", "OpenDir", "path", name)
return nil, fuse.ENOSYS
if isRootPath(name) {
return []fuse.DirEntry{}, fuse.OK
}

return nil, fuse.ENOENT
}
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These callbacks currently include only the bare minimum required to access the folder. Once the drive content loading logic is implemented, these elements will likely be relocated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant