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
6d5f84b0
Commit
6d5f84b0
authored
Aug 31, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run gofmt.
parent
7aa7dde6
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
16 additions
and
18 deletions
+16
-18
example/hello/hello.go
example/hello/hello.go
+2
-2
fuse/api.go
fuse/api.go
+2
-2
fuse/cache_test.go
fuse/cache_test.go
+2
-2
fuse/fsetattr_test.go
fuse/fsetattr_test.go
+1
-1
fuse/handle.go
fuse/handle.go
+1
-1
fuse/pathfilesystem.go
fuse/pathfilesystem.go
+2
-4
fuse/pathops.go
fuse/pathops.go
+2
-2
fuse/readonlyfs.go
fuse/readonlyfs.go
+1
-1
unionfs/unionfs_test.go
unionfs/unionfs_test.go
+3
-3
No files found.
example/hello/hello.go
View file @
6d5f84b0
...
...
@@ -18,11 +18,11 @@ func (me *HelloFs) GetAttr(name string, context *fuse.Context) (*os.FileInfo, fu
case
"file.txt"
:
return
&
os
.
FileInfo
{
Mode
:
fuse
.
S_IFREG
|
0644
,
Size
:
int64
(
len
(
name
)),
},
fuse
.
OK
},
fuse
.
OK
case
""
:
return
&
os
.
FileInfo
{
Mode
:
fuse
.
S_IFDIR
|
0755
,
},
fuse
.
OK
},
fuse
.
OK
}
return
nil
,
fuse
.
ENOENT
}
...
...
fuse/api.go
View file @
6d5f84b0
...
...
@@ -111,14 +111,14 @@ type FileSystemOptions struct {
// make inode numbers (exported back to callers) stay within
// int64 (assuming the process uses less than 4G memory.).
// 64-bit inode numbers makes stat() in 32-bit programs fail.
SkipCheckHandles
bool
SkipCheckHandles
bool
}
type
MountOptions
struct
{
AllowOther
bool
// Options are passed as -o string to fusermount.
Options
[]
string
Options
[]
string
// Default is _DEFAULT_BACKGROUND_TASKS, 12.
MaxBackground
int
...
...
fuse/cache_test.go
View file @
6d5f84b0
...
...
@@ -90,7 +90,7 @@ type nonseekFs struct {
func
(
me
*
nonseekFs
)
GetAttr
(
name
string
,
context
*
Context
)
(
fi
*
os
.
FileInfo
,
status
Status
)
{
if
name
==
"file"
{
return
&
os
.
FileInfo
{
Mode
:
S_IFREG
|
0644
},
OK
return
&
os
.
FileInfo
{
Mode
:
S_IFREG
|
0644
},
OK
}
return
nil
,
ENOENT
}
...
...
@@ -110,7 +110,7 @@ func (me *nonseekFs) Open(name string, flags uint32, context *Context) (fuseFile
func
TestNonseekable
(
t
*
testing
.
T
)
{
fs
:=
&
nonseekFs
{}
fs
.
Length
=
200
*
1024
fs
.
Length
=
200
*
1024
dir
:=
MakeTempDir
()
defer
os
.
RemoveAll
(
dir
)
...
...
fuse/fsetattr_test.go
View file @
6d5f84b0
...
...
@@ -152,7 +152,7 @@ func TestFSetAttr(t *testing.T) {
if
state
.
KernelSettings
()
.
Flags
&
CAP_FILE_OPS
==
0
{
log
.
Println
(
"Mount does not support file operations"
)
}
_
,
err
=
f
.
Stat
()
CheckSuccess
(
err
)
...
...
fuse/handle.go
View file @
6d5f84b0
...
...
@@ -163,7 +163,7 @@ func DecodeHandle(handle uint64) (val *Handled) {
if
unsafe
.
Sizeof
(
val
)
==
8
{
ptrBits
:=
uintptr
(
handle
&
(
1
<<
45
-
1
))
check
=
uint32
(
handle
>>
45
)
val
=
(
*
Handled
)(
unsafe
.
Pointer
(
ptrBits
<<
3
+
uintptr
(
baseAddress
)))
val
=
(
*
Handled
)(
unsafe
.
Pointer
(
ptrBits
<<
3
+
uintptr
(
baseAddress
)))
}
if
unsafe
.
Sizeof
(
val
)
==
4
{
val
=
(
*
Handled
)(
unsafe
.
Pointer
(
uintptr
(
handle
&
((
1
<<
32
)
-
1
))))
...
...
fuse/pathfilesystem.go
View file @
6d5f84b0
...
...
@@ -698,15 +698,13 @@ func (me *FileSystemConnector) EntryNotify(dir string, name string) Status {
return
me
.
fsInit
.
EntryNotify
(
node
.
NodeId
,
name
)
}
func
(
me
*
FileSystemConnector
)
Notify
(
path
string
)
Status
{
node
,
rest
:=
me
.
findLastKnownInode
(
path
)
if
len
(
rest
)
>
0
{
return
me
.
fsInit
.
EntryNotify
(
node
.
NodeId
,
rest
[
0
])
return
me
.
fsInit
.
EntryNotify
(
node
.
NodeId
,
rest
[
0
])
}
out
:=
NotifyInvalInodeOut
{
Ino
:
node
.
NodeId
,
Ino
:
node
.
NodeId
,
}
return
me
.
fsInit
.
InodeNotify
(
&
out
)
}
fuse/pathops.go
View file @
6d5f84b0
...
...
@@ -170,8 +170,8 @@ func (me *FileSystemConnector) OpenDir(header *InHeader, input *OpenIn) (flags u
extra
:
node
.
GetMountDirEntries
(),
stream
:
stream
,
}
de
.
extra
=
append
(
de
.
extra
,
DirEntry
{
S_IFDIR
,
"."
},
DirEntry
{
S_IFDIR
,
".."
})
de
.
extra
=
append
(
de
.
extra
,
DirEntry
{
S_IFDIR
,
"."
},
DirEntry
{
S_IFDIR
,
".."
})
h
,
opened
:=
mount
.
registerFileHandle
(
node
,
de
,
nil
,
input
.
Flags
)
return
opened
.
FuseFlags
,
h
,
OK
...
...
fuse/readonlyfs.go
View file @
6d5f84b0
...
...
@@ -58,7 +58,7 @@ func (me *ReadonlyFileSystem) Truncate(name string, offset uint64, context *Cont
}
func
(
me
*
ReadonlyFileSystem
)
Open
(
name
string
,
flags
uint32
,
context
*
Context
)
(
file
File
,
code
Status
)
{
if
flags
&
O_ANYWRITE
!=
0
{
if
flags
&
O_ANYWRITE
!=
0
{
return
nil
,
EPERM
}
// TODO - wrap the File object inside a R/O wrapper too?
...
...
unionfs/unionfs_test.go
View file @
6d5f84b0
...
...
@@ -159,7 +159,7 @@ func TestSymlinkPromote(t *testing.T) {
wd
,
clean
:=
setupUfs
(
t
)
defer
clean
()
err
:=
os
.
Mkdir
(
wd
+
"/ro/subdir"
,
0755
)
err
:=
os
.
Mkdir
(
wd
+
"/ro/subdir"
,
0755
)
CheckSuccess
(
err
)
err
=
os
.
Symlink
(
"/foobar"
,
wd
+
"/mount/subdir/link"
)
...
...
@@ -688,7 +688,7 @@ func TestRmRf(t *testing.T) {
CheckSuccess
(
err
)
bin
,
err
:=
exec
.
LookPath
(
"rm"
)
CheckSuccess
(
err
)
cmd
:=
exec
.
Command
(
bin
,
"-rf"
,
wd
+
"/mount/dir"
)
cmd
:=
exec
.
Command
(
bin
,
"-rf"
,
wd
+
"/mount/dir"
)
err
=
cmd
.
Run
()
if
err
!=
nil
{
t
.
Fatal
(
"rm -rf returned error:"
,
err
)
...
...
@@ -868,7 +868,7 @@ func TestDeletedGetAttr(t *testing.T) {
CheckSuccess
(
err
)
defer
f
.
Close
()
err
=
os
.
Remove
(
wd
+
"/mount/file"
)
err
=
os
.
Remove
(
wd
+
"/mount/file"
)
CheckSuccess
(
err
)
if
fi
,
err
:=
f
.
Stat
();
err
!=
nil
||
!
fi
.
IsRegular
()
{
...
...
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