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
ff77141e
Commit
ff77141e
authored
Sep 26, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add String() to the File API.
parent
0c88a201
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
16 deletions
+48
-16
fuse/api.go
fuse/api.go
+3
-0
fuse/defaultfile.go
fuse/defaultfile.go
+4
-0
fuse/files.go
fuse/files.go
+13
-0
fuse/memnode.go
fuse/memnode.go
+4
-0
unionfs/memunionfs.go
unionfs/memunionfs.go
+20
-16
unionfs/unionfs.go
unionfs/unionfs.go
+4
-0
No files found.
fuse/api.go
View file @
ff77141e
...
...
@@ -143,6 +143,9 @@ type File interface {
// Called upon registering the filehandle in the inode.
SetInode
(
*
Inode
)
// The String method is for debug printing.
String
()
string
// Wrappers around other File implementations, should return
// the inner file here.
InnerFile
()
File
...
...
fuse/defaultfile.go
View file @
ff77141e
...
...
@@ -14,6 +14,10 @@ func (me *DefaultFile) InnerFile() File {
return
nil
}
func
(
me
*
DefaultFile
)
String
()
string
{
return
"DefaultFile"
}
func
(
me
*
DefaultFile
)
Read
(
*
ReadIn
,
BufferPool
)
([]
byte
,
Status
)
{
return
[]
byte
(
""
),
ENOSYS
}
...
...
fuse/files.go
View file @
ff77141e
...
...
@@ -42,6 +42,11 @@ func NewDevNullFile() *DevNullFile {
return
new
(
DevNullFile
)
}
func
(
me
*
DevNullFile
)
String
()
string
{
return
"DevNullFile"
}
func
(
me
*
DevNullFile
)
Read
(
input
*
ReadIn
,
bp
BufferPool
)
([]
byte
,
Status
)
{
return
[]
byte
{},
OK
}
...
...
@@ -71,6 +76,10 @@ type LoopbackFile struct {
DefaultFile
}
func
(
me
*
LoopbackFile
)
String
()
string
{
return
fmt
.
Sprintf
(
"LoopbackFile(%s)"
,
me
.
File
.
Name
())
}
func
(
me
*
LoopbackFile
)
Read
(
input
*
ReadIn
,
buffers
BufferPool
)
([]
byte
,
Status
)
{
slice
:=
buffers
.
AllocBuffer
(
input
.
Size
)
...
...
@@ -124,6 +133,10 @@ type ReadOnlyFile struct {
File
}
func
(
me
*
ReadOnlyFile
)
String
()
string
{
return
fmt
.
Sprintf
(
"ReadOnlyFile(%s)"
,
me
.
File
.
String
())
}
func
(
me
*
ReadOnlyFile
)
Write
(
input
*
WriteIn
,
data
[]
byte
)
(
uint32
,
Status
)
{
return
0
,
EPERM
}
...
...
fuse/memnode.go
View file @
ff77141e
...
...
@@ -140,6 +140,10 @@ type memNodeFile struct {
node
*
memNode
}
func
(
me
*
memNodeFile
)
String
()
string
{
return
fmt
.
Sprintf
(
"memNodeFile(%s)"
,
me
.
LoopbackFile
.
String
())
}
func
(
me
*
memNodeFile
)
InnerFile
()
File
{
return
&
me
.
LoopbackFile
}
...
...
unionfs/memunionfs.go
View file @
ff77141e
...
...
@@ -202,7 +202,7 @@ func (me *MemUnionFs) getFilename() string {
id
:=
me
.
nextFree
me
.
nextFree
++
if
me
.
nextFree
%
1000
==
0
{
go
me
.
gc
()
//
go me.gc()
}
return
fmt
.
Sprintf
(
"%s/%d"
,
me
.
backingStore
,
id
)
}
...
...
@@ -435,6 +435,10 @@ type memNodeFile struct {
node
*
memNode
}
func
(
me
*
memNodeFile
)
String
()
string
{
return
fmt
.
Sprintf
(
"memUfsFile(%s)"
,
me
.
File
.
String
())
}
func
(
me
*
memNodeFile
)
InnerFile
()
fuse
.
File
{
return
me
.
File
}
...
...
unionfs/unionfs.go
View file @
ff77141e
...
...
@@ -971,6 +971,10 @@ type unionFsFile struct {
layer
int
}
func
(
me
*
unionFsFile
)
String
()
string
{
return
fmt
.
Sprintf
(
"unionFsFile(%s)"
,
me
.
File
.
String
())
}
func
(
me
*
UnionFs
)
newUnionFsFile
(
f
fuse
.
File
,
branch
int
)
*
unionFsFile
{
return
&
unionFsFile
{
File
:
f
,
...
...
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