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
9d5f7e99
Commit
9d5f7e99
authored
Apr 25, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Plain Diff
.
parents
8e7f68ca
1d6f9351
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
68 additions
and
62 deletions
+68
-62
fs/bridge.go
fs/bridge.go
+7
-1
fs/inode.go
fs/inode.go
+2
-2
fuse/api.go
fuse/api.go
+1
-1
fuse/opcode.go
fuse/opcode.go
+5
-5
fuse/print.go
fuse/print.go
+26
-26
fuse/test/cache_test.go
fuse/test/cache_test.go
+1
-1
fuse/types.go
fuse/types.go
+26
-26
No files found.
fs/bridge.go
View file @
9d5f7e99
...
...
@@ -303,6 +303,10 @@ func (b *rawBridge) Mkdir(cancel <-chan struct{}, input *fuse.MkdirIn, name stri
return
errnoToStatus
(
errno
)
}
if
out
.
Attr
.
Mode
&^
07777
==
0
{
out
.
Attr
.
Mode
|=
fuse
.
S_IFDIR
}
if
out
.
Attr
.
Mode
&^
07777
!=
fuse
.
S_IFDIR
{
log
.
Panicf
(
"Mkdir: mode must be S_IFDIR (%o), got %o"
,
fuse
.
S_IFDIR
,
out
.
Attr
.
Mode
)
}
...
...
@@ -443,7 +447,9 @@ func (b *rawBridge) Rename(cancel <-chan struct{}, input *fuse.RenameIn, oldName
if
input
.
Flags
&
RENAME_EXCHANGE
!=
0
{
p1
.
ExchangeChild
(
oldName
,
p2
,
newName
)
}
else
{
p1
.
MvChild
(
oldName
,
p2
,
newName
,
true
)
if
ok
:=
p1
.
MvChild
(
oldName
,
p2
,
newName
,
true
);
!
ok
{
log
.
Println
(
"MvChild failed"
)
}
}
return
errnoToStatus
(
errno
)
...
...
fs/inode.go
View file @
9d5f7e99
...
...
@@ -164,10 +164,10 @@ func (n *Inode) String() string {
defer
n
.
mu
.
Unlock
()
var
ss
[]
string
for
nm
,
ch
:=
range
n
.
children
{
ss
=
append
(
ss
,
fmt
.
Sprintf
(
"%q=%d[%s]"
,
nm
,
ch
.
stableAttr
.
Ino
,
modeStr
(
ch
.
stableAttr
.
Mode
)))
ss
=
append
(
ss
,
fmt
.
Sprintf
(
"%q=
i
%d[%s]"
,
nm
,
ch
.
stableAttr
.
Ino
,
modeStr
(
ch
.
stableAttr
.
Mode
)))
}
return
fmt
.
Sprintf
(
"
%d[%s]
: %s"
,
n
.
stableAttr
.
Ino
,
modeStr
(
n
.
stableAttr
.
Mode
),
strings
.
Join
(
ss
,
","
))
return
fmt
.
Sprintf
(
"
i%d (%s)
: %s"
,
n
.
stableAttr
.
Ino
,
modeStr
(
n
.
stableAttr
.
Mode
),
strings
.
Join
(
ss
,
","
))
}
// sortNodes rearranges inode group in consistent order.
...
...
fuse/api.go
View file @
9d5f7e99
...
...
@@ -157,7 +157,7 @@ type MountOptions struct {
// If set, ask kernel not to do automatic data cache invalidation.
// The filesystem is fully responsible for invalidating data cache.
Precise
DataCacheControl
bool
Explicit
DataCacheControl
bool
}
// RawFileSystem is an interface close to the FUSE wire protocol.
...
...
fuse/opcode.go
View file @
9d5f7e99
...
...
@@ -102,13 +102,13 @@ func doInit(server *Server, req *request) {
dataCacheMode
:=
input
.
Flags
&
CAP_AUTO_INVAL_DATA
if
server
.
opts
.
Precise
DataCacheControl
{
// we don't want CAP_AUTO_INVAL_DATA even if we cannot go into fully
precise
mode
if
server
.
opts
.
Explicit
DataCacheControl
{
// we don't want CAP_AUTO_INVAL_DATA even if we cannot go into fully
explicit
mode
dataCacheMode
=
0
precise
:=
input
.
Flags
&
CAP_PRECISE
_INVAL_DATA
if
precise
!=
0
{
dataCacheMode
=
precise
explicit
:=
input
.
Flags
&
CAP_EXPLICIT
_INVAL_DATA
if
explicit
!=
0
{
dataCacheMode
=
explicit
}
}
server
.
kernelSettings
.
Flags
|=
dataCacheMode
...
...
fuse/print.go
View file @
9d5f7e99
...
...
@@ -22,32 +22,32 @@ var (
READ_LOCKOWNER
:
"LOCKOWNER"
,
}
initFlagNames
=
map
[
int64
]
string
{
CAP_ASYNC_READ
:
"ASYNC_READ"
,
CAP_POSIX_LOCKS
:
"POSIX_LOCKS"
,
CAP_FILE_OPS
:
"FILE_OPS"
,
CAP_ATOMIC_O_TRUNC
:
"ATOMIC_O_TRUNC"
,
CAP_EXPORT_SUPPORT
:
"EXPORT_SUPPORT"
,
CAP_BIG_WRITES
:
"BIG_WRITES"
,
CAP_DONT_MASK
:
"DONT_MASK"
,
CAP_SPLICE_WRITE
:
"SPLICE_WRITE"
,
CAP_SPLICE_MOVE
:
"SPLICE_MOVE"
,
CAP_SPLICE_READ
:
"SPLICE_READ"
,
CAP_FLOCK_LOCKS
:
"FLOCK_LOCKS"
,
CAP_IOCTL_DIR
:
"IOCTL_DIR"
,
CAP_AUTO_INVAL_DATA
:
"AUTO_INVAL_DATA"
,
CAP_READDIRPLUS
:
"READDIRPLUS"
,
CAP_READDIRPLUS_AUTO
:
"READDIRPLUS_AUTO"
,
CAP_ASYNC_DIO
:
"ASYNC_DIO"
,
CAP_WRITEBACK_CACHE
:
"WRITEBACK_CACHE"
,
CAP_NO_OPEN_SUPPORT
:
"NO_OPEN_SUPPORT"
,
CAP_PARALLEL_DIROPS
:
"PARALLEL_DIROPS"
,
CAP_POSIX_ACL
:
"POSIX_ACL"
,
CAP_HANDLE_KILLPRIV
:
"HANDLE_KILLPRIV"
,
CAP_ABORT_ERROR
:
"ABORT_ERROR"
,
CAP_MAX_PAGES
:
"MAX_PAGES"
,
CAP_CACHE_SYMLINKS
:
"CACHE_SYMLINKS"
,
CAP_NO_OPENDIR_SUPPORT
:
"NO_OPENDIR_SUPPORT"
,
CAP_
PRECISE_INVAL_DATA
:
"PRECISE
_INVAL_DATA"
,
CAP_ASYNC_READ
:
"ASYNC_READ"
,
CAP_POSIX_LOCKS
:
"POSIX_LOCKS"
,
CAP_FILE_OPS
:
"FILE_OPS"
,
CAP_ATOMIC_O_TRUNC
:
"ATOMIC_O_TRUNC"
,
CAP_EXPORT_SUPPORT
:
"EXPORT_SUPPORT"
,
CAP_BIG_WRITES
:
"BIG_WRITES"
,
CAP_DONT_MASK
:
"DONT_MASK"
,
CAP_SPLICE_WRITE
:
"SPLICE_WRITE"
,
CAP_SPLICE_MOVE
:
"SPLICE_MOVE"
,
CAP_SPLICE_READ
:
"SPLICE_READ"
,
CAP_FLOCK_LOCKS
:
"FLOCK_LOCKS"
,
CAP_IOCTL_DIR
:
"IOCTL_DIR"
,
CAP_AUTO_INVAL_DATA
:
"AUTO_INVAL_DATA"
,
CAP_READDIRPLUS
:
"READDIRPLUS"
,
CAP_READDIRPLUS_AUTO
:
"READDIRPLUS_AUTO"
,
CAP_ASYNC_DIO
:
"ASYNC_DIO"
,
CAP_WRITEBACK_CACHE
:
"WRITEBACK_CACHE"
,
CAP_NO_OPEN_SUPPORT
:
"NO_OPEN_SUPPORT"
,
CAP_PARALLEL_DIROPS
:
"PARALLEL_DIROPS"
,
CAP_POSIX_ACL
:
"POSIX_ACL"
,
CAP_HANDLE_KILLPRIV
:
"HANDLE_KILLPRIV"
,
CAP_ABORT_ERROR
:
"ABORT_ERROR"
,
CAP_MAX_PAGES
:
"MAX_PAGES"
,
CAP_CACHE_SYMLINKS
:
"CACHE_SYMLINKS"
,
CAP_NO_OPENDIR_SUPPORT
:
"NO_OPENDIR_SUPPORT"
,
CAP_
EXPLICIT_INVAL_DATA
:
"EXPLICIT
_INVAL_DATA"
,
}
releaseFlagNames
=
map
[
int64
]
string
{
RELEASE_FLUSH
:
"FLUSH"
,
...
...
fuse/test/cache_test.go
View file @
9d5f7e99
...
...
@@ -48,7 +48,7 @@ func setupCacheTest(t *testing.T) (string, *pathfs.PathNodeFs, func()) {
mntOpts
:=
&
fuse
.
MountOptions
{
// ask kernel not to invalidate file data automatically
Precise
DataCacheControl
:
true
,
Explicit
DataCacheControl
:
true
,
Debug
:
testutil
.
VerboseTest
(),
}
...
...
fuse/types.go
View file @
9d5f7e99
...
...
@@ -265,32 +265,32 @@ type OpenOut struct {
// To be set in InitIn/InitOut.Flags.
const
(
CAP_ASYNC_READ
=
(
1
<<
0
)
CAP_POSIX_LOCKS
=
(
1
<<
1
)
CAP_FILE_OPS
=
(
1
<<
2
)
CAP_ATOMIC_O_TRUNC
=
(
1
<<
3
)
CAP_EXPORT_SUPPORT
=
(
1
<<
4
)
CAP_BIG_WRITES
=
(
1
<<
5
)
CAP_DONT_MASK
=
(
1
<<
6
)
CAP_SPLICE_WRITE
=
(
1
<<
7
)
CAP_SPLICE_MOVE
=
(
1
<<
8
)
CAP_SPLICE_READ
=
(
1
<<
9
)
CAP_FLOCK_LOCKS
=
(
1
<<
10
)
CAP_IOCTL_DIR
=
(
1
<<
11
)
CAP_AUTO_INVAL_DATA
=
(
1
<<
12
)
CAP_READDIRPLUS
=
(
1
<<
13
)
CAP_READDIRPLUS_AUTO
=
(
1
<<
14
)
CAP_ASYNC_DIO
=
(
1
<<
15
)
CAP_WRITEBACK_CACHE
=
(
1
<<
16
)
CAP_NO_OPEN_SUPPORT
=
(
1
<<
17
)
CAP_PARALLEL_DIROPS
=
(
1
<<
18
)
CAP_HANDLE_KILLPRIV
=
(
1
<<
19
)
CAP_POSIX_ACL
=
(
1
<<
20
)
CAP_ABORT_ERROR
=
(
1
<<
21
)
CAP_MAX_PAGES
=
(
1
<<
22
)
CAP_CACHE_SYMLINKS
=
(
1
<<
23
)
CAP_NO_OPENDIR_SUPPORT
=
(
1
<<
24
)
CAP_
PRECISE
_INVAL_DATA
=
(
1
<<
25
)
CAP_ASYNC_READ
=
(
1
<<
0
)
CAP_POSIX_LOCKS
=
(
1
<<
1
)
CAP_FILE_OPS
=
(
1
<<
2
)
CAP_ATOMIC_O_TRUNC
=
(
1
<<
3
)
CAP_EXPORT_SUPPORT
=
(
1
<<
4
)
CAP_BIG_WRITES
=
(
1
<<
5
)
CAP_DONT_MASK
=
(
1
<<
6
)
CAP_SPLICE_WRITE
=
(
1
<<
7
)
CAP_SPLICE_MOVE
=
(
1
<<
8
)
CAP_SPLICE_READ
=
(
1
<<
9
)
CAP_FLOCK_LOCKS
=
(
1
<<
10
)
CAP_IOCTL_DIR
=
(
1
<<
11
)
CAP_AUTO_INVAL_DATA
=
(
1
<<
12
)
CAP_READDIRPLUS
=
(
1
<<
13
)
CAP_READDIRPLUS_AUTO
=
(
1
<<
14
)
CAP_ASYNC_DIO
=
(
1
<<
15
)
CAP_WRITEBACK_CACHE
=
(
1
<<
16
)
CAP_NO_OPEN_SUPPORT
=
(
1
<<
17
)
CAP_PARALLEL_DIROPS
=
(
1
<<
18
)
CAP_HANDLE_KILLPRIV
=
(
1
<<
19
)
CAP_POSIX_ACL
=
(
1
<<
20
)
CAP_ABORT_ERROR
=
(
1
<<
21
)
CAP_MAX_PAGES
=
(
1
<<
22
)
CAP_CACHE_SYMLINKS
=
(
1
<<
23
)
CAP_NO_OPENDIR_SUPPORT
=
(
1
<<
24
)
CAP_
EXPLICIT
_INVAL_DATA
=
(
1
<<
25
)
)
type
InitIn
struct
{
...
...
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