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
e8e94fea
Commit
e8e94fea
authored
May 01, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run gofmt.
parent
49cf5940
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
49 additions
and
46 deletions
+49
-46
fuse/default.go
fuse/default.go
+2
-2
fuse/fsetattr_test.go
fuse/fsetattr_test.go
+14
-14
fuse/fuse.go
fuse/fuse.go
+1
-1
fuse/opcode.go
fuse/opcode.go
+5
-5
fuse/pathfilesystem.go
fuse/pathfilesystem.go
+4
-4
fuse/pathops.go
fuse/pathops.go
+10
-10
fuse/request.go
fuse/request.go
+2
-2
fuse/types.go
fuse/types.go
+8
-5
unionfs/unionfs.go
unionfs/unionfs.go
+1
-1
unionfs/unionfs_test.go
unionfs/unionfs_test.go
+2
-2
No files found.
fuse/default.go
View file @
e8e94fea
fuse/fsetattr_test.go
View file @
e8e94fea
...
@@ -16,7 +16,7 @@ type MutableDataFile struct {
...
@@ -16,7 +16,7 @@ type MutableDataFile struct {
}
}
func
(
me
*
MutableDataFile
)
Read
(
r
*
ReadIn
,
bp
*
BufferPool
)
([]
byte
,
Status
)
{
func
(
me
*
MutableDataFile
)
Read
(
r
*
ReadIn
,
bp
*
BufferPool
)
([]
byte
,
Status
)
{
return
me
.
data
[
r
.
Offset
:
r
.
Offset
+
uint64
(
r
.
Size
)],
OK
return
me
.
data
[
r
.
Offset
:
r
.
Offset
+
uint64
(
r
.
Size
)],
OK
}
}
func
(
me
*
MutableDataFile
)
Write
(
w
*
WriteIn
,
d
[]
byte
)
(
uint32
,
Status
)
{
func
(
me
*
MutableDataFile
)
Write
(
w
*
WriteIn
,
d
[]
byte
)
(
uint32
,
Status
)
{
...
@@ -135,7 +135,7 @@ func TestFSetAttr(t *testing.T) {
...
@@ -135,7 +135,7 @@ func TestFSetAttr(t *testing.T) {
go
state
.
Loop
(
false
)
go
state
.
Loop
(
false
)
fn
:=
dir
+
"/file"
fn
:=
dir
+
"/file"
f
,
err
:=
os
.
OpenFile
(
fn
,
os
.
O_CREATE
|
os
.
O_WRONLY
,
0755
)
f
,
err
:=
os
.
OpenFile
(
fn
,
os
.
O_CREATE
|
os
.
O_WRONLY
,
0755
)
CheckSuccess
(
err
)
CheckSuccess
(
err
)
defer
f
.
Close
()
defer
f
.
Close
()
...
@@ -151,7 +151,7 @@ func TestFSetAttr(t *testing.T) {
...
@@ -151,7 +151,7 @@ func TestFSetAttr(t *testing.T) {
t
.
Error
(
"truncate"
)
t
.
Error
(
"truncate"
)
}
}
if
state
.
KernelSettings
()
.
Flags
&
CAP_FILE_OPS
==
0
{
if
state
.
KernelSettings
()
.
Flags
&
CAP_FILE_OPS
==
0
{
log
.
Println
(
"Mount does not support file operations"
)
log
.
Println
(
"Mount does not support file operations"
)
m
,
_
:=
json
.
Marshal
(
state
.
KernelSettings
())
m
,
_
:=
json
.
Marshal
(
state
.
KernelSettings
())
log
.
Println
(
"Kernel settings: "
,
string
(
m
))
log
.
Println
(
"Kernel settings: "
,
string
(
m
))
...
@@ -167,7 +167,7 @@ func TestFSetAttr(t *testing.T) {
...
@@ -167,7 +167,7 @@ func TestFSetAttr(t *testing.T) {
err
=
os
.
Chmod
(
fn
,
024
)
err
=
os
.
Chmod
(
fn
,
024
)
CheckSuccess
(
err
)
CheckSuccess
(
err
)
if
fs
.
file
.
FileInfo
.
Mode
&
07777
!=
024
{
if
fs
.
file
.
FileInfo
.
Mode
&
07777
!=
024
{
t
.
Error
(
"chmod"
)
t
.
Error
(
"chmod"
)
}
}
...
...
fuse/fuse.go
View file @
e8e94fea
fuse/opcode.go
View file @
e8e94fea
fuse/pathfilesystem.go
View file @
e8e94fea
...
@@ -16,7 +16,7 @@ package fuse
...
@@ -16,7 +16,7 @@ package fuse
lookups (eg. after doing a symlink). We could probably do without
lookups (eg. after doing a symlink). We could probably do without
the GetAttr calls.
the GetAttr calls.
*/
*/
import
(
import
(
"fmt"
"fmt"
...
...
fuse/pathops.go
View file @
e8e94fea
...
@@ -74,7 +74,7 @@ func (me *FileSystemConnector) Forget(h *InHeader, input *ForgetIn) {
...
@@ -74,7 +74,7 @@ func (me *FileSystemConnector) Forget(h *InHeader, input *ForgetIn) {
}
}
func
(
me
*
FileSystemConnector
)
GetAttr
(
header
*
InHeader
,
input
*
GetAttrIn
)
(
out
*
AttrOut
,
code
Status
)
{
func
(
me
*
FileSystemConnector
)
GetAttr
(
header
*
InHeader
,
input
*
GetAttrIn
)
(
out
*
AttrOut
,
code
Status
)
{
if
input
.
Flags
&
FUSE_GETATTR_FH
!=
0
{
if
input
.
Flags
&
FUSE_GETATTR_FH
!=
0
{
f
,
mount
:=
me
.
getFile
(
input
.
Fh
)
f
,
mount
:=
me
.
getFile
(
input
.
Fh
)
attr
:=
f
.
GetAttr
()
attr
:=
f
.
GetAttr
()
if
attr
!=
nil
{
if
attr
!=
nil
{
...
@@ -205,14 +205,14 @@ func (me *FileSystemConnector) SetAttr(header *InHeader, input *SetAttrIn) (out
...
@@ -205,14 +205,14 @@ func (me *FileSystemConnector) SetAttr(header *InHeader, input *SetAttrIn) (out
fileResult
=
ENOSYS
fileResult
=
ENOSYS
}
}
}
}
if
err
==
OK
&&
(
input
.
Valid
&
(
FATTR_ATIME
|
FATTR_MTIME
|
FATTR_ATIME_NOW
|
FATTR_MTIME_NOW
)
!=
0
)
{
if
err
==
OK
&&
(
input
.
Valid
&
(
FATTR_ATIME
|
FATTR_MTIME
|
FATTR_ATIME_NOW
|
FATTR_MTIME_NOW
)
!=
0
)
{
atime
:=
uint64
(
input
.
Atime
*
1e9
)
+
uint64
(
input
.
Atimensec
)
atime
:=
uint64
(
input
.
Atime
*
1e9
)
+
uint64
(
input
.
Atimensec
)
if
input
.
Valid
&
FATTR_ATIME_NOW
!=
0
{
if
input
.
Valid
&
FATTR_ATIME_NOW
!=
0
{
atime
=
uint64
(
time
.
Nanoseconds
())
atime
=
uint64
(
time
.
Nanoseconds
())
}
}
mtime
:=
uint64
(
input
.
Mtime
*
1e9
)
+
uint64
(
input
.
Mtimensec
)
mtime
:=
uint64
(
input
.
Mtime
*
1e9
)
+
uint64
(
input
.
Mtimensec
)
if
input
.
Valid
&
FATTR_MTIME_NOW
!=
0
{
if
input
.
Valid
&
FATTR_MTIME_NOW
!=
0
{
mtime
=
uint64
(
time
.
Nanoseconds
())
mtime
=
uint64
(
time
.
Nanoseconds
())
}
}
...
...
fuse/request.go
View file @
e8e94fea
fuse/types.go
View file @
e8e94fea
...
@@ -243,6 +243,7 @@ type FlushIn struct {
...
@@ -243,6 +243,7 @@ type FlushIn struct {
const
(
const
(
FUSE_READ_LOCKOWNER
=
(
1
<<
1
)
FUSE_READ_LOCKOWNER
=
(
1
<<
1
)
)
)
type
ReadIn
struct
{
type
ReadIn
struct
{
Fh
uint64
Fh
uint64
Offset
uint64
Offset
uint64
...
@@ -258,6 +259,7 @@ const (
...
@@ -258,6 +259,7 @@ const (
FUSE_WRITE_CACHE
=
(
1
<<
0
)
FUSE_WRITE_CACHE
=
(
1
<<
0
)
FUSE_WRITE_LOCKOWNER
=
(
1
<<
1
)
FUSE_WRITE_LOCKOWNER
=
(
1
<<
1
)
)
)
type
WriteIn
struct
{
type
WriteIn
struct
{
Fh
uint64
Fh
uint64
Offset
uint64
Offset
uint64
...
@@ -384,6 +386,7 @@ const (
...
@@ -384,6 +386,7 @@ const (
FUSE_IOCTL_UNRESTRICTED
=
(
1
<<
1
)
FUSE_IOCTL_UNRESTRICTED
=
(
1
<<
1
)
FUSE_IOCTL_RETRY
=
(
1
<<
2
)
FUSE_IOCTL_RETRY
=
(
1
<<
2
)
)
)
type
IoctlIn
struct
{
type
IoctlIn
struct
{
Fh
uint64
Fh
uint64
Flags
uint32
Flags
uint32
...
...
unionfs/unionfs.go
View file @
e8e94fea
unionfs/unionfs_test.go
View file @
e8e94fea
...
@@ -330,11 +330,11 @@ func TestTruncate(t *testing.T) {
...
@@ -330,11 +330,11 @@ func TestTruncate(t *testing.T) {
writeToFile
(
wd
+
"/ro/file"
,
"hello"
)
writeToFile
(
wd
+
"/ro/file"
,
"hello"
)
os
.
Truncate
(
wd
+
"/mount/file"
,
2
)
os
.
Truncate
(
wd
+
"/mount/file"
,
2
)
content
:=
readFromFile
(
wd
+
"/mount/file"
)
content
:=
readFromFile
(
wd
+
"/mount/file"
)
if
content
!=
"he"
{
if
content
!=
"he"
{
t
.
Errorf
(
"unexpected content %v"
,
content
)
t
.
Errorf
(
"unexpected content %v"
,
content
)
}
}
content2
:=
readFromFile
(
wd
+
"/rw/file"
)
content2
:=
readFromFile
(
wd
+
"/rw/file"
)
if
content2
!=
content
{
if
content2
!=
content
{
t
.
Errorf
(
"unexpected rw content %v"
,
content2
)
t
.
Errorf
(
"unexpected rw content %v"
,
content2
)
}
}
...
...
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