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
Kirill Smelkov
go-fuse
Commits
41f74f69
Commit
41f74f69
authored
Jun 22, 2013
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the LockingFileSystem and LockingRawFileSystem types from the
public API. This reduces API clutter.
parent
baa8ca67
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
75 deletions
+79
-75
fuse/lockingfs.go
fuse/lockingfs.go
+47
-42
fuse/pathfs/locking.go
fuse/pathfs/locking.go
+32
-33
No files found.
fuse/lockingfs.go
View file @
41f74f69
...
...
@@ -10,186 +10,191 @@ import (
////////////////////////////////////////////////////////////////
// Locking raw FS.
type
L
ockingRawFileSystem
struct
{
type
l
ockingRawFileSystem
struct
{
RawFS
RawFileSystem
lock
sync
.
Mutex
}
var
_
=
(
RawFileSystem
)((
*
L
ockingRawFileSystem
)(
nil
))
var
_
=
(
RawFileSystem
)((
*
l
ockingRawFileSystem
)(
nil
))
func
(
fs
*
LockingRawFileSystem
)
locked
()
func
()
{
fs
.
lock
.
Lock
()
return
func
()
{
fs
.
lock
.
Unlock
()
}
// Returns a Wrap
func
NewLockingRawFileSystem
(
fs
RawFileSystem
)
RawFileSystem
{
return
&
lockingRawFileSystem
{
RawFS
:
fs
,
}
}
func
(
fs
*
lockingRawFileSystem
)
FS
()
RawFileSystem
{
return
fs
.
RawFS
}
func
NewLockingRawFileSystem
(
rfs
RawFileSystem
)
*
LockingRawFileSystem
{
l
:=
&
LockingRawFileSystem
{}
l
.
RawFS
=
rfs
return
l
func
(
fs
*
lockingRawFileSystem
)
locked
()
func
()
{
fs
.
lock
.
Lock
()
return
func
()
{
fs
.
lock
.
Unlock
()
}
}
func
(
fs
*
L
ockingRawFileSystem
)
Lookup
(
out
*
raw
.
EntryOut
,
h
*
Context
,
name
string
)
(
code
Status
)
{
func
(
fs
*
l
ockingRawFileSystem
)
Lookup
(
out
*
raw
.
EntryOut
,
h
*
Context
,
name
string
)
(
code
Status
)
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
Lookup
(
out
,
h
,
name
)
}
func
(
fs
*
L
ockingRawFileSystem
)
Forget
(
nodeID
uint64
,
nlookup
uint64
)
{
func
(
fs
*
l
ockingRawFileSystem
)
Forget
(
nodeID
uint64
,
nlookup
uint64
)
{
defer
fs
.
locked
()()
fs
.
RawFS
.
Forget
(
nodeID
,
nlookup
)
}
func
(
fs
*
L
ockingRawFileSystem
)
GetAttr
(
out
*
raw
.
AttrOut
,
header
*
Context
,
input
*
raw
.
GetAttrIn
)
(
code
Status
)
{
func
(
fs
*
l
ockingRawFileSystem
)
GetAttr
(
out
*
raw
.
AttrOut
,
header
*
Context
,
input
*
raw
.
GetAttrIn
)
(
code
Status
)
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
GetAttr
(
out
,
header
,
input
)
}
func
(
fs
*
L
ockingRawFileSystem
)
Open
(
out
*
raw
.
OpenOut
,
header
*
Context
,
input
*
raw
.
OpenIn
)
(
status
Status
)
{
func
(
fs
*
l
ockingRawFileSystem
)
Open
(
out
*
raw
.
OpenOut
,
header
*
Context
,
input
*
raw
.
OpenIn
)
(
status
Status
)
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
Open
(
out
,
header
,
input
)
}
func
(
fs
*
L
ockingRawFileSystem
)
SetAttr
(
out
*
raw
.
AttrOut
,
header
*
Context
,
input
*
raw
.
SetAttrIn
)
(
code
Status
)
{
func
(
fs
*
l
ockingRawFileSystem
)
SetAttr
(
out
*
raw
.
AttrOut
,
header
*
Context
,
input
*
raw
.
SetAttrIn
)
(
code
Status
)
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
SetAttr
(
out
,
header
,
input
)
}
func
(
fs
*
L
ockingRawFileSystem
)
Readlink
(
header
*
Context
)
(
out
[]
byte
,
code
Status
)
{
func
(
fs
*
l
ockingRawFileSystem
)
Readlink
(
header
*
Context
)
(
out
[]
byte
,
code
Status
)
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
Readlink
(
header
)
}
func
(
fs
*
L
ockingRawFileSystem
)
Mknod
(
out
*
raw
.
EntryOut
,
header
*
Context
,
input
*
raw
.
MknodIn
,
name
string
)
(
code
Status
)
{
func
(
fs
*
l
ockingRawFileSystem
)
Mknod
(
out
*
raw
.
EntryOut
,
header
*
Context
,
input
*
raw
.
MknodIn
,
name
string
)
(
code
Status
)
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
Mknod
(
out
,
header
,
input
,
name
)
}
func
(
fs
*
L
ockingRawFileSystem
)
Mkdir
(
out
*
raw
.
EntryOut
,
header
*
Context
,
input
*
raw
.
MkdirIn
,
name
string
)
(
code
Status
)
{
func
(
fs
*
l
ockingRawFileSystem
)
Mkdir
(
out
*
raw
.
EntryOut
,
header
*
Context
,
input
*
raw
.
MkdirIn
,
name
string
)
(
code
Status
)
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
Mkdir
(
out
,
header
,
input
,
name
)
}
func
(
fs
*
L
ockingRawFileSystem
)
Unlink
(
header
*
Context
,
name
string
)
(
code
Status
)
{
func
(
fs
*
l
ockingRawFileSystem
)
Unlink
(
header
*
Context
,
name
string
)
(
code
Status
)
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
Unlink
(
header
,
name
)
}
func
(
fs
*
L
ockingRawFileSystem
)
Rmdir
(
header
*
Context
,
name
string
)
(
code
Status
)
{
func
(
fs
*
l
ockingRawFileSystem
)
Rmdir
(
header
*
Context
,
name
string
)
(
code
Status
)
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
Rmdir
(
header
,
name
)
}
func
(
fs
*
L
ockingRawFileSystem
)
Symlink
(
out
*
raw
.
EntryOut
,
header
*
Context
,
pointedTo
string
,
linkName
string
)
(
code
Status
)
{
func
(
fs
*
l
ockingRawFileSystem
)
Symlink
(
out
*
raw
.
EntryOut
,
header
*
Context
,
pointedTo
string
,
linkName
string
)
(
code
Status
)
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
Symlink
(
out
,
header
,
pointedTo
,
linkName
)
}
func
(
fs
*
L
ockingRawFileSystem
)
Rename
(
header
*
Context
,
input
*
raw
.
RenameIn
,
oldName
string
,
newName
string
)
(
code
Status
)
{
func
(
fs
*
l
ockingRawFileSystem
)
Rename
(
header
*
Context
,
input
*
raw
.
RenameIn
,
oldName
string
,
newName
string
)
(
code
Status
)
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
Rename
(
header
,
input
,
oldName
,
newName
)
}
func
(
fs
*
L
ockingRawFileSystem
)
Link
(
out
*
raw
.
EntryOut
,
header
*
Context
,
input
*
raw
.
LinkIn
,
name
string
)
(
code
Status
)
{
func
(
fs
*
l
ockingRawFileSystem
)
Link
(
out
*
raw
.
EntryOut
,
header
*
Context
,
input
*
raw
.
LinkIn
,
name
string
)
(
code
Status
)
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
Link
(
out
,
header
,
input
,
name
)
}
func
(
fs
*
L
ockingRawFileSystem
)
SetXAttr
(
header
*
Context
,
input
*
raw
.
SetXAttrIn
,
attr
string
,
data
[]
byte
)
Status
{
func
(
fs
*
l
ockingRawFileSystem
)
SetXAttr
(
header
*
Context
,
input
*
raw
.
SetXAttrIn
,
attr
string
,
data
[]
byte
)
Status
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
SetXAttr
(
header
,
input
,
attr
,
data
)
}
func
(
fs
*
L
ockingRawFileSystem
)
GetXAttrData
(
header
*
Context
,
attr
string
)
(
data
[]
byte
,
code
Status
)
{
func
(
fs
*
l
ockingRawFileSystem
)
GetXAttrData
(
header
*
Context
,
attr
string
)
(
data
[]
byte
,
code
Status
)
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
GetXAttrData
(
header
,
attr
)
}
func
(
fs
*
L
ockingRawFileSystem
)
GetXAttrSize
(
header
*
Context
,
attr
string
)
(
sz
int
,
code
Status
)
{
func
(
fs
*
l
ockingRawFileSystem
)
GetXAttrSize
(
header
*
Context
,
attr
string
)
(
sz
int
,
code
Status
)
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
GetXAttrSize
(
header
,
attr
)
}
func
(
fs
*
L
ockingRawFileSystem
)
ListXAttr
(
header
*
Context
)
(
data
[]
byte
,
code
Status
)
{
func
(
fs
*
l
ockingRawFileSystem
)
ListXAttr
(
header
*
Context
)
(
data
[]
byte
,
code
Status
)
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
ListXAttr
(
header
)
}
func
(
fs
*
L
ockingRawFileSystem
)
RemoveXAttr
(
header
*
Context
,
attr
string
)
Status
{
func
(
fs
*
l
ockingRawFileSystem
)
RemoveXAttr
(
header
*
Context
,
attr
string
)
Status
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
RemoveXAttr
(
header
,
attr
)
}
func
(
fs
*
L
ockingRawFileSystem
)
Access
(
header
*
Context
,
input
*
raw
.
AccessIn
)
(
code
Status
)
{
func
(
fs
*
l
ockingRawFileSystem
)
Access
(
header
*
Context
,
input
*
raw
.
AccessIn
)
(
code
Status
)
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
Access
(
header
,
input
)
}
func
(
fs
*
L
ockingRawFileSystem
)
Create
(
out
*
raw
.
CreateOut
,
header
*
Context
,
input
*
raw
.
CreateIn
,
name
string
)
(
code
Status
)
{
func
(
fs
*
l
ockingRawFileSystem
)
Create
(
out
*
raw
.
CreateOut
,
header
*
Context
,
input
*
raw
.
CreateIn
,
name
string
)
(
code
Status
)
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
Create
(
out
,
header
,
input
,
name
)
}
func
(
fs
*
L
ockingRawFileSystem
)
OpenDir
(
out
*
raw
.
OpenOut
,
header
*
Context
,
input
*
raw
.
OpenIn
)
(
status
Status
)
{
func
(
fs
*
l
ockingRawFileSystem
)
OpenDir
(
out
*
raw
.
OpenOut
,
header
*
Context
,
input
*
raw
.
OpenIn
)
(
status
Status
)
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
OpenDir
(
out
,
header
,
input
)
}
func
(
fs
*
L
ockingRawFileSystem
)
Release
(
header
*
Context
,
input
*
raw
.
ReleaseIn
)
{
func
(
fs
*
l
ockingRawFileSystem
)
Release
(
header
*
Context
,
input
*
raw
.
ReleaseIn
)
{
defer
fs
.
locked
()()
fs
.
RawFS
.
Release
(
header
,
input
)
}
func
(
fs
*
L
ockingRawFileSystem
)
ReleaseDir
(
header
*
Context
,
h
*
raw
.
ReleaseIn
)
{
func
(
fs
*
l
ockingRawFileSystem
)
ReleaseDir
(
header
*
Context
,
h
*
raw
.
ReleaseIn
)
{
defer
fs
.
locked
()()
fs
.
RawFS
.
ReleaseDir
(
header
,
h
)
}
func
(
fs
*
L
ockingRawFileSystem
)
Read
(
header
*
Context
,
input
*
raw
.
ReadIn
,
buf
[]
byte
)
(
ReadResult
,
Status
)
{
func
(
fs
*
l
ockingRawFileSystem
)
Read
(
header
*
Context
,
input
*
raw
.
ReadIn
,
buf
[]
byte
)
(
ReadResult
,
Status
)
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
Read
(
header
,
input
,
buf
)
}
func
(
fs
*
L
ockingRawFileSystem
)
Write
(
header
*
Context
,
input
*
raw
.
WriteIn
,
data
[]
byte
)
(
written
uint32
,
code
Status
)
{
func
(
fs
*
l
ockingRawFileSystem
)
Write
(
header
*
Context
,
input
*
raw
.
WriteIn
,
data
[]
byte
)
(
written
uint32
,
code
Status
)
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
Write
(
header
,
input
,
data
)
}
func
(
fs
*
L
ockingRawFileSystem
)
Flush
(
header
*
Context
,
input
*
raw
.
FlushIn
)
Status
{
func
(
fs
*
l
ockingRawFileSystem
)
Flush
(
header
*
Context
,
input
*
raw
.
FlushIn
)
Status
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
Flush
(
header
,
input
)
}
func
(
fs
*
L
ockingRawFileSystem
)
Fsync
(
header
*
Context
,
input
*
raw
.
FsyncIn
)
(
code
Status
)
{
func
(
fs
*
l
ockingRawFileSystem
)
Fsync
(
header
*
Context
,
input
*
raw
.
FsyncIn
)
(
code
Status
)
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
Fsync
(
header
,
input
)
}
func
(
fs
*
L
ockingRawFileSystem
)
ReadDir
(
out
*
DirEntryList
,
header
*
Context
,
input
*
raw
.
ReadIn
)
Status
{
func
(
fs
*
l
ockingRawFileSystem
)
ReadDir
(
out
*
DirEntryList
,
header
*
Context
,
input
*
raw
.
ReadIn
)
Status
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
ReadDir
(
out
,
header
,
input
)
}
func
(
fs
*
L
ockingRawFileSystem
)
FsyncDir
(
header
*
Context
,
input
*
raw
.
FsyncIn
)
(
code
Status
)
{
func
(
fs
*
l
ockingRawFileSystem
)
FsyncDir
(
header
*
Context
,
input
*
raw
.
FsyncIn
)
(
code
Status
)
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
FsyncDir
(
header
,
input
)
}
func
(
fs
*
L
ockingRawFileSystem
)
Init
(
params
*
RawFsInit
)
{
func
(
fs
*
l
ockingRawFileSystem
)
Init
(
params
*
RawFsInit
)
{
defer
fs
.
locked
()()
fs
.
RawFS
.
Init
(
params
)
}
func
(
fs
*
L
ockingRawFileSystem
)
StatFs
(
out
*
StatfsOut
,
context
*
Context
)
(
code
Status
)
{
func
(
fs
*
l
ockingRawFileSystem
)
StatFs
(
out
*
StatfsOut
,
context
*
Context
)
(
code
Status
)
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
StatFs
(
out
,
context
)
}
func
(
fs
*
L
ockingRawFileSystem
)
Fallocate
(
c
*
Context
,
in
*
raw
.
FallocateIn
)
(
code
Status
)
{
func
(
fs
*
l
ockingRawFileSystem
)
Fallocate
(
c
*
Context
,
in
*
raw
.
FallocateIn
)
(
code
Status
)
{
defer
fs
.
locked
()()
return
fs
.
RawFS
.
Fallocate
(
c
,
in
)
}
func
(
fs
*
L
ockingRawFileSystem
)
String
()
string
{
func
(
fs
*
l
ockingRawFileSystem
)
String
()
string
{
defer
fs
.
locked
()()
return
fmt
.
Sprintf
(
"Locked(%s)"
,
fs
.
RawFS
.
String
())
}
fuse/pathfs/locking.go
View file @
41f74f69
...
...
@@ -7,149 +7,148 @@ import (
"github.com/hanwen/go-fuse/fuse"
)
// This is a wrapper that makes a FileSystem threadsafe by
// trivially locking all operations. For improved performance, you
// should probably invent do your own locking inside the file system.
type
LockingFileSystem
struct
{
type
lockingFileSystem
struct
{
// Should be public so people reusing can access the wrapped
// FS.
FS
FileSystem
lock
sync
.
Mutex
}
var
_
=
((
FileSystem
)((
*
L
ockingFileSystem
)(
nil
)))
var
_
=
((
FileSystem
)((
*
l
ockingFileSystem
)(
nil
)))
func
NewLockingFileSystem
(
pfs
FileSystem
)
*
LockingFileSystem
{
l
:=
new
(
LockingFileSystem
)
// NewLockingFileSystem is a wrapper that makes a FileSystem
// threadsafe by serializing each operation.
func
NewLockingFileSystem
(
pfs
FileSystem
)
FileSystem
{
l
:=
new
(
lockingFileSystem
)
l
.
FS
=
pfs
return
l
}
func
(
fs
*
L
ockingFileSystem
)
String
()
string
{
func
(
fs
*
l
ockingFileSystem
)
String
()
string
{
defer
fs
.
locked
()()
return
fs
.
FS
.
String
()
}
func
(
fs
*
L
ockingFileSystem
)
StatFs
(
name
string
)
*
fuse
.
StatfsOut
{
func
(
fs
*
l
ockingFileSystem
)
StatFs
(
name
string
)
*
fuse
.
StatfsOut
{
defer
fs
.
locked
()()
return
fs
.
FS
.
StatFs
(
name
)
}
func
(
fs
*
L
ockingFileSystem
)
locked
()
func
()
{
func
(
fs
*
l
ockingFileSystem
)
locked
()
func
()
{
fs
.
lock
.
Lock
()
return
func
()
{
fs
.
lock
.
Unlock
()
}
}
func
(
fs
*
L
ockingFileSystem
)
GetAttr
(
name
string
,
context
*
fuse
.
Context
)
(
*
fuse
.
Attr
,
fuse
.
Status
)
{
func
(
fs
*
l
ockingFileSystem
)
GetAttr
(
name
string
,
context
*
fuse
.
Context
)
(
*
fuse
.
Attr
,
fuse
.
Status
)
{
defer
fs
.
locked
()()
return
fs
.
FS
.
GetAttr
(
name
,
context
)
}
func
(
fs
*
L
ockingFileSystem
)
Readlink
(
name
string
,
context
*
fuse
.
Context
)
(
string
,
fuse
.
Status
)
{
func
(
fs
*
l
ockingFileSystem
)
Readlink
(
name
string
,
context
*
fuse
.
Context
)
(
string
,
fuse
.
Status
)
{
defer
fs
.
locked
()()
return
fs
.
FS
.
Readlink
(
name
,
context
)
}
func
(
fs
*
L
ockingFileSystem
)
Mknod
(
name
string
,
mode
uint32
,
dev
uint32
,
context
*
fuse
.
Context
)
fuse
.
Status
{
func
(
fs
*
l
ockingFileSystem
)
Mknod
(
name
string
,
mode
uint32
,
dev
uint32
,
context
*
fuse
.
Context
)
fuse
.
Status
{
defer
fs
.
locked
()()
return
fs
.
FS
.
Mknod
(
name
,
mode
,
dev
,
context
)
}
func
(
fs
*
L
ockingFileSystem
)
Mkdir
(
name
string
,
mode
uint32
,
context
*
fuse
.
Context
)
fuse
.
Status
{
func
(
fs
*
l
ockingFileSystem
)
Mkdir
(
name
string
,
mode
uint32
,
context
*
fuse
.
Context
)
fuse
.
Status
{
defer
fs
.
locked
()()
return
fs
.
FS
.
Mkdir
(
name
,
mode
,
context
)
}
func
(
fs
*
L
ockingFileSystem
)
Unlink
(
name
string
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
func
(
fs
*
l
ockingFileSystem
)
Unlink
(
name
string
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
defer
fs
.
locked
()()
return
fs
.
FS
.
Unlink
(
name
,
context
)
}
func
(
fs
*
L
ockingFileSystem
)
Rmdir
(
name
string
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
func
(
fs
*
l
ockingFileSystem
)
Rmdir
(
name
string
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
defer
fs
.
locked
()()
return
fs
.
FS
.
Rmdir
(
name
,
context
)
}
func
(
fs
*
L
ockingFileSystem
)
Symlink
(
value
string
,
linkName
string
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
func
(
fs
*
l
ockingFileSystem
)
Symlink
(
value
string
,
linkName
string
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
defer
fs
.
locked
()()
return
fs
.
FS
.
Symlink
(
value
,
linkName
,
context
)
}
func
(
fs
*
L
ockingFileSystem
)
Rename
(
oldName
string
,
newName
string
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
func
(
fs
*
l
ockingFileSystem
)
Rename
(
oldName
string
,
newName
string
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
defer
fs
.
locked
()()
return
fs
.
FS
.
Rename
(
oldName
,
newName
,
context
)
}
func
(
fs
*
L
ockingFileSystem
)
Link
(
oldName
string
,
newName
string
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
func
(
fs
*
l
ockingFileSystem
)
Link
(
oldName
string
,
newName
string
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
defer
fs
.
locked
()()
return
fs
.
FS
.
Link
(
oldName
,
newName
,
context
)
}
func
(
fs
*
L
ockingFileSystem
)
Chmod
(
name
string
,
mode
uint32
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
func
(
fs
*
l
ockingFileSystem
)
Chmod
(
name
string
,
mode
uint32
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
defer
fs
.
locked
()()
return
fs
.
FS
.
Chmod
(
name
,
mode
,
context
)
}
func
(
fs
*
L
ockingFileSystem
)
Chown
(
name
string
,
uid
uint32
,
gid
uint32
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
func
(
fs
*
l
ockingFileSystem
)
Chown
(
name
string
,
uid
uint32
,
gid
uint32
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
defer
fs
.
locked
()()
return
fs
.
FS
.
Chown
(
name
,
uid
,
gid
,
context
)
}
func
(
fs
*
L
ockingFileSystem
)
Truncate
(
name
string
,
offset
uint64
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
func
(
fs
*
l
ockingFileSystem
)
Truncate
(
name
string
,
offset
uint64
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
defer
fs
.
locked
()()
return
fs
.
FS
.
Truncate
(
name
,
offset
,
context
)
}
func
(
fs
*
L
ockingFileSystem
)
Open
(
name
string
,
flags
uint32
,
context
*
fuse
.
Context
)
(
file
fuse
.
File
,
code
fuse
.
Status
)
{
func
(
fs
*
l
ockingFileSystem
)
Open
(
name
string
,
flags
uint32
,
context
*
fuse
.
Context
)
(
file
fuse
.
File
,
code
fuse
.
Status
)
{
return
fs
.
FS
.
Open
(
name
,
flags
,
context
)
}
func
(
fs
*
L
ockingFileSystem
)
OpenDir
(
name
string
,
context
*
fuse
.
Context
)
(
stream
[]
fuse
.
DirEntry
,
status
fuse
.
Status
)
{
func
(
fs
*
l
ockingFileSystem
)
OpenDir
(
name
string
,
context
*
fuse
.
Context
)
(
stream
[]
fuse
.
DirEntry
,
status
fuse
.
Status
)
{
defer
fs
.
locked
()()
return
fs
.
FS
.
OpenDir
(
name
,
context
)
}
func
(
fs
*
L
ockingFileSystem
)
OnMount
(
nodeFs
*
PathNodeFs
)
{
func
(
fs
*
l
ockingFileSystem
)
OnMount
(
nodeFs
*
PathNodeFs
)
{
defer
fs
.
locked
()()
fs
.
FS
.
OnMount
(
nodeFs
)
}
func
(
fs
*
L
ockingFileSystem
)
OnUnmount
()
{
func
(
fs
*
l
ockingFileSystem
)
OnUnmount
()
{
defer
fs
.
locked
()()
fs
.
FS
.
OnUnmount
()
}
func
(
fs
*
L
ockingFileSystem
)
Access
(
name
string
,
mode
uint32
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
func
(
fs
*
l
ockingFileSystem
)
Access
(
name
string
,
mode
uint32
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
defer
fs
.
locked
()()
return
fs
.
FS
.
Access
(
name
,
mode
,
context
)
}
func
(
fs
*
L
ockingFileSystem
)
Create
(
name
string
,
flags
uint32
,
mode
uint32
,
context
*
fuse
.
Context
)
(
file
fuse
.
File
,
code
fuse
.
Status
)
{
func
(
fs
*
l
ockingFileSystem
)
Create
(
name
string
,
flags
uint32
,
mode
uint32
,
context
*
fuse
.
Context
)
(
file
fuse
.
File
,
code
fuse
.
Status
)
{
defer
fs
.
locked
()()
return
fs
.
FS
.
Create
(
name
,
flags
,
mode
,
context
)
}
func
(
fs
*
L
ockingFileSystem
)
Utimens
(
name
string
,
Atime
*
time
.
Time
,
Mtime
*
time
.
Time
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
func
(
fs
*
l
ockingFileSystem
)
Utimens
(
name
string
,
Atime
*
time
.
Time
,
Mtime
*
time
.
Time
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
defer
fs
.
locked
()()
return
fs
.
FS
.
Utimens
(
name
,
Atime
,
Mtime
,
context
)
}
func
(
fs
*
L
ockingFileSystem
)
GetXAttr
(
name
string
,
attr
string
,
context
*
fuse
.
Context
)
([]
byte
,
fuse
.
Status
)
{
func
(
fs
*
l
ockingFileSystem
)
GetXAttr
(
name
string
,
attr
string
,
context
*
fuse
.
Context
)
([]
byte
,
fuse
.
Status
)
{
defer
fs
.
locked
()()
return
fs
.
FS
.
GetXAttr
(
name
,
attr
,
context
)
}
func
(
fs
*
L
ockingFileSystem
)
SetXAttr
(
name
string
,
attr
string
,
data
[]
byte
,
flags
int
,
context
*
fuse
.
Context
)
fuse
.
Status
{
func
(
fs
*
l
ockingFileSystem
)
SetXAttr
(
name
string
,
attr
string
,
data
[]
byte
,
flags
int
,
context
*
fuse
.
Context
)
fuse
.
Status
{
defer
fs
.
locked
()()
return
fs
.
FS
.
SetXAttr
(
name
,
attr
,
data
,
flags
,
context
)
}
func
(
fs
*
L
ockingFileSystem
)
ListXAttr
(
name
string
,
context
*
fuse
.
Context
)
([]
string
,
fuse
.
Status
)
{
func
(
fs
*
l
ockingFileSystem
)
ListXAttr
(
name
string
,
context
*
fuse
.
Context
)
([]
string
,
fuse
.
Status
)
{
defer
fs
.
locked
()()
return
fs
.
FS
.
ListXAttr
(
name
,
context
)
}
func
(
fs
*
L
ockingFileSystem
)
RemoveXAttr
(
name
string
,
attr
string
,
context
*
fuse
.
Context
)
fuse
.
Status
{
func
(
fs
*
l
ockingFileSystem
)
RemoveXAttr
(
name
string
,
attr
string
,
context
*
fuse
.
Context
)
fuse
.
Status
{
defer
fs
.
locked
()()
return
fs
.
FS
.
RemoveXAttr
(
name
,
attr
,
context
)
}
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