Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Levin Zimmermann
go-fuse
Commits
653fdb7a
Commit
653fdb7a
authored
May 12, 2023
by
Levin Zimmermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
7cd8b7c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
3 deletions
+32
-3
fuse/server.go
fuse/server.go
+32
-3
No files found.
fuse/server.go
View file @
653fdb7a
...
...
@@ -185,10 +185,24 @@ func NewServer(fs RawFileSystem, mountPoint string, opts *MountOptions) (*Server
o
.
Name
=
strings
.
Replace
(
name
[
:
l
],
","
,
";"
,
-
1
)
}
// XXX: Is this really the correct place where we should adjust
// the options? How's if we simply change 'optionsStrings' method?
//
// git grep "optionsStrings"
// fuse/mount_darwin.go: "-o", strings.Join(opts.optionsStrings(), ","),
// fuse/mount_linux.go: if s := opts.optionsStrings(); len(s) > 0 {
// fuse/server.go: for _, s := range o.optionsStrings() {
// fuse/server.go:func (o *MountOptions) optionsStrings() []string {
//
// Because 'optionsStrings' is called in the mount_* files, maybe it's indeed
// sufficient to change optionsStrings?
// This also makes sense, because we don't change the internal representation of
// our mount options with the escaped version, which is more difficult to handle
// and which shouldn't matter for the user. go-fuse could take care of escaping
// without the user having to think about this..
for
_
,
s
:=
range
o
.
optionsStrings
()
{
if
strings
.
Contains
(
s
,
","
)
{
escapeComma
(
s
)
}
escapeComma
(
s
)
}
maxReaders
:=
runtime
.
GOMAXPROCS
(
0
)
...
...
@@ -251,6 +265,21 @@ func NewServer(fs RawFileSystem, mountPoint string, opts *MountOptions) (*Server
return
ms
,
nil
}
func
escapeComma
(
optionValue
string
)
string
{
// Perhaps if clause isn't even needed.
// We need to loop through each character of the string
// anyway, so we'll catch each comma anyway.
//
// Maybe it's very slightly more performant if we initially
// test if it contains a ','?
//
// But perhaps strings.Replace() is equally fast..
// if strings.Contains(s, ",") {}
return
strings
.
Replace
(
optionValue
,
","
,
"//"
,
-
1
)
}
func
(
o
*
MountOptions
)
optionsStrings
()
[]
string
{
var
r
[]
string
r
=
append
(
r
,
o
.
Options
...
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment