Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kirill Smelkov
jacobsa-fuse
Commits
e9e97851
Commit
e9e97851
authored
9 years ago
by
Aaron Jacobs
Browse files
Options
Download
Plain Diff
Added package fuse support for creating symlinks.
parents
e331443c
e9a77cf2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
0 deletions
+59
-0
fuseops/convert.go
fuseops/convert.go
+9
-0
fuseops/ops.go
fuseops/ops.go
+41
-0
fuseutil/file_system.go
fuseutil/file_system.go
+4
-0
fuseutil/not_implemented_file_system.go
fuseutil/not_implemented_file_system.go
+5
-0
No files found.
fuseops/convert.go
View file @
e9e97851
...
...
@@ -114,6 +114,15 @@ func Convert(
io
=
to
co
=
&
to
.
commonOp
case
*
bazilfuse
.
SymlinkRequest
:
to
:=
&
CreateSymlinkOp
{
Parent
:
InodeID
(
typed
.
Header
.
Node
),
Name
:
typed
.
NewName
,
Target
:
typed
.
Target
,
}
io
=
to
co
=
&
to
.
commonOp
case
*
bazilfuse
.
RemoveRequest
:
if
typed
.
Dir
{
to
:=
&
RmDirOp
{
...
...
This diff is collapsed.
Click to expand it.
fuseops/ops.go
View file @
e9e97851
...
...
@@ -371,6 +371,47 @@ func (o *CreateFileOp) toBazilfuseResponse() (bfResp interface{}) {
return
}
// Create a symlink inode.
type
CreateSymlinkOp
struct
{
commonOp
// The ID of parent directory inode within which to create the child symlink.
Parent
InodeID
// The name of the symlink to create.
Name
string
// The target of the symlink.
Target
string
// Set by the file system: information about the symlink inode that was
// created.
//
// The lookup count for the inode is implicitly incremented. See notes on
// ForgetInodeOp for more information.
Entry
ChildInodeEntry
}
func
(
o
*
CreateSymlinkOp
)
ShortDesc
()
(
desc
string
)
{
desc
=
fmt
.
Sprintf
(
"CreateSymlink(parent=%v, name=%q, target=%q)"
,
o
.
Parent
,
o
.
Name
,
o
.
Target
)
return
}
func
(
o
*
CreateSymlinkOp
)
toBazilfuseResponse
()
(
bfResp
interface
{})
{
resp
:=
bazilfuse
.
SymlinkResponse
{}
bfResp
=
&
resp
convertChildInodeEntry
(
&
o
.
Entry
,
&
resp
.
LookupResponse
)
return
return
}
////////////////////////////////////////////////////////////////////////
// Unlinking
////////////////////////////////////////////////////////////////////////
...
...
This diff is collapsed.
Click to expand it.
fuseutil/file_system.go
View file @
e9e97851
...
...
@@ -45,6 +45,7 @@ type FileSystem interface {
ForgetInode
(
*
fuseops
.
ForgetInodeOp
)
MkDir
(
*
fuseops
.
MkDirOp
)
CreateFile
(
*
fuseops
.
CreateFileOp
)
CreateSymlink
(
*
fuseops
.
CreateSymlinkOp
)
RmDir
(
*
fuseops
.
RmDirOp
)
Unlink
(
*
fuseops
.
UnlinkOp
)
OpenDir
(
*
fuseops
.
OpenDirOp
)
...
...
@@ -149,6 +150,9 @@ func (s fileSystemServer) handleOp(op fuseops.Op) {
case
*
fuseops
.
CreateFileOp
:
s
.
fs
.
CreateFile
(
typed
)
case
*
fuseops
.
CreateSymlinkOp
:
s
.
fs
.
CreateSymlink
(
typed
)
case
*
fuseops
.
RmDirOp
:
s
.
fs
.
RmDir
(
typed
)
...
...
This diff is collapsed.
Click to expand it.
fuseutil/not_implemented_file_system.go
View file @
e9e97851
...
...
@@ -63,6 +63,11 @@ func (fs *NotImplementedFileSystem) CreateFile(
op
.
Respond
(
fuse
.
ENOSYS
)
}
func
(
fs
*
NotImplementedFileSystem
)
CreateSymlink
(
op
*
fuseops
.
CreateSymlinkOp
)
{
op
.
Respond
(
fuse
.
ENOSYS
)
}
func
(
fs
*
NotImplementedFileSystem
)
RmDir
(
op
*
fuseops
.
RmDirOp
)
{
op
.
Respond
(
fuse
.
ENOSYS
)
...
...
This diff is collapsed.
Click to expand it.
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