Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-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
Kirill Smelkov
jacobsa-fuse
Commits
8aade5c7
Commit
8aade5c7
authored
Dec 04, 2015
by
Ka-Hing Cheung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RemoveXattr implementation
parent
77e8f7f7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
0 deletions
+40
-0
conversions.go
conversions.go
+16
-0
fuseops/ops.go
fuseops/ops.go
+13
-0
fuseutil/file_system.go
fuseutil/file_system.go
+4
-0
fuseutil/not_implemented_file_system.go
fuseutil/not_implemented_file_system.go
+7
-0
No files found.
conversions.go
View file @
8aade5c7
...
...
@@ -420,6 +420,19 @@ func convertInMessage(
Flags
:
fusekernel
.
InitFlags
(
in
.
Flags
),
}
case
fusekernel
.
OpRemovexattr
:
buf
:=
inMsg
.
ConsumeBytes
(
inMsg
.
Len
())
n
:=
len
(
buf
)
if
n
==
0
||
buf
[
n
-
1
]
!=
'\x00'
{
err
=
errors
.
New
(
"Corrupt OpRemovexattr"
)
return
}
o
=
&
fuseops
.
RemoveXattrOp
{
Inode
:
fuseops
.
InodeID
(
inMsg
.
Header
()
.
Nodeid
),
Name
:
string
(
buf
[
:
n
-
1
]),
}
default
:
o
=
&
unknownOp
{
OpCode
:
inMsg
.
Header
()
.
Opcode
,
...
...
@@ -623,6 +636,9 @@ func (c *Connection) kernelResponseForOp(
out
.
St
.
Bsize
=
o
.
IoSize
out
.
St
.
Frsize
=
o
.
BlockSize
case
*
fuseops
.
RemoveXattrOp
:
// Empty response
case
*
initOp
:
out
:=
(
*
fusekernel
.
InitOut
)(
m
.
Grow
(
int
(
unsafe
.
Sizeof
(
fusekernel
.
InitOut
{}))))
...
...
fuseops/ops.go
View file @
8aade5c7
...
...
@@ -767,3 +767,16 @@ type ReadSymlinkOp struct {
// Set by the file system: the target of the symlink.
Target
string
}
////////////////////////////////////////////////////////////////////////
// eXtended attributes
////////////////////////////////////////////////////////////////////////
// Remove an extended attribute
type
RemoveXattrOp
struct
{
// The inode that we are reading
Inode
InodeID
// The name of the extended attribute
Name
string
}
fuseutil/file_system.go
View file @
8aade5c7
...
...
@@ -57,6 +57,7 @@ type FileSystem interface {
FlushFile
(
context
.
Context
,
*
fuseops
.
FlushFileOp
)
error
ReleaseFileHandle
(
context
.
Context
,
*
fuseops
.
ReleaseFileHandleOp
)
error
ReadSymlink
(
context
.
Context
,
*
fuseops
.
ReadSymlinkOp
)
error
RemoveXattr
(
context
.
Context
,
*
fuseops
.
RemoveXattrOp
)
error
// Regard all inodes (including the root inode) as having their lookup counts
// decremented to zero, and clean up any resources associated with the file
...
...
@@ -186,6 +187,9 @@ func (s *fileSystemServer) handleOp(
case
*
fuseops
.
ReadSymlinkOp
:
err
=
s
.
fs
.
ReadSymlink
(
ctx
,
typed
)
case
*
fuseops
.
RemoveXattrOp
:
err
=
s
.
fs
.
RemoveXattr
(
ctx
,
typed
)
}
c
.
Reply
(
ctx
,
err
)
...
...
fuseutil/not_implemented_file_system.go
View file @
8aade5c7
...
...
@@ -183,5 +183,12 @@ func (fs *NotImplementedFileSystem) ReadSymlink(
return
}
func
(
fs
*
NotImplementedFileSystem
)
RemoveXattr
(
ctx
context
.
Context
,
op
*
fuseops
.
RemoveXattrOp
)
(
err
error
)
{
err
=
fuse
.
ENOSYS
return
}
func
(
fs
*
NotImplementedFileSystem
)
Destroy
()
{
}
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