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
a964aa5c
Commit
a964aa5c
authored
Jul 11, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update for weekly.2011-07-07.
parent
42f12e1c
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
22 additions
and
22 deletions
+22
-22
example/bulkstat/bulkstat.go
example/bulkstat/bulkstat.go
+1
-1
fuse/latencymap.go
fuse/latencymap.go
+1
-1
fuse/mount.go
fuse/mount.go
+1
-1
fuse/opcode.go
fuse/opcode.go
+1
-1
fuse/pathdebug.go
fuse/pathdebug.go
+5
-5
fuse/pathfilesystem.go
fuse/pathfilesystem.go
+1
-1
fuse/request.go
fuse/request.go
+1
-1
fuse/xattr.go
fuse/xattr.go
+1
-1
unionfs/autounion.go
unionfs/autounion.go
+4
-4
unionfs/cachingfs.go
unionfs/cachingfs.go
+3
-3
zipfs/memtree.go
zipfs/memtree.go
+1
-1
zipfs/tarfs.go
zipfs/tarfs.go
+1
-1
zipfs/zipfs.go
zipfs/zipfs.go
+1
-1
No files found.
example/bulkstat/bulkstat.go
View file @
a964aa5c
...
...
@@ -64,7 +64,7 @@ func main() {
func
Analyze
(
times
[]
float64
)
{
sorted
:=
times
sort
.
Sort
Float64s
(
sorted
)
sort
.
Float64s
(
sorted
)
tot
:=
0.0
for
_
,
v
:=
range
times
{
...
...
fuse/latencymap.go
View file @
a964aa5c
...
...
@@ -96,6 +96,6 @@ func (me *LatencyMap) TopArgs(name string) []string {
for
k
,
v
:=
range
counts
{
results
=
append
(
results
,
fmt
.
Sprintf
(
"% 9d %s"
,
v
,
k
))
}
sort
.
S
ortS
trings
(
results
)
sort
.
Strings
(
results
)
return
results
}
fuse/mount.go
View file @
a964aa5c
...
...
@@ -134,7 +134,7 @@ func getConnection(local *os.File) (f *os.File, err os.Error) {
}
func
init
()
{
for
_
,
v
:=
range
strings
.
Split
(
os
.
Getenv
(
"PATH"
),
":"
,
-
1
)
{
for
_
,
v
:=
range
strings
.
Split
(
os
.
Getenv
(
"PATH"
),
":"
)
{
tpath
:=
path
.
Join
(
v
,
"fusermount"
)
fi
,
err
:=
os
.
Stat
(
tpath
)
if
err
==
nil
&&
(
fi
.
Mode
&
0111
)
!=
0
{
...
...
fuse/opcode.go
View file @
a964aa5c
...
...
@@ -261,7 +261,7 @@ func doFsyncDir(state *MountState, req *request) {
}
func
doSetXAttr
(
state
*
MountState
,
req
*
request
)
{
splits
:=
bytes
.
Split
(
req
.
arg
,
[]
byte
{
0
},
2
)
splits
:=
bytes
.
Split
N
(
req
.
arg
,
[]
byte
{
0
},
2
)
req
.
status
=
state
.
fileSystem
.
SetXAttr
(
req
.
inHeader
,
(
*
SetXAttrIn
)(
req
.
inData
),
string
(
splits
[
0
]),
splits
[
1
])
}
...
...
fuse/pathdebug.go
View file @
a964aa5c
...
...
@@ -54,7 +54,7 @@ func (me *FileSystemDebug) Open(path string, flags uint32) (fuseFile File, statu
var
SeparatorString
=
string
([]
byte
{
filepath
.
Separator
})
func
(
me
*
FileSystemDebug
)
getContent
(
path
string
)
[]
byte
{
comps
:=
strings
.
Split
(
path
,
SeparatorString
,
-
1
)
comps
:=
strings
.
Split
(
path
,
SeparatorString
)
if
comps
[
0
]
==
DebugDir
{
me
.
RWMutex
.
RLock
()
defer
me
.
RWMutex
.
RUnlock
()
...
...
@@ -80,14 +80,14 @@ func (me *FileSystemDebug) GetAttr(path string) (*os.FileInfo, Status) {
if
path
==
DebugDir
{
return
&
os
.
FileInfo
{
Mode
:
S_IFDIR
|
0755
,
},
OK
},
OK
}
c
:=
me
.
getContent
(
path
)
if
c
!=
nil
{
return
&
os
.
FileInfo
{
Mode
:
S_IFREG
|
0644
,
Size
:
int64
(
len
(
c
)),
},
OK
},
OK
}
return
nil
,
ENOENT
}
...
...
@@ -98,7 +98,7 @@ func FloatMapToBytes(m map[string]float64) []byte {
keys
=
append
(
keys
,
k
)
}
sort
.
S
ortS
trings
(
keys
)
sort
.
Strings
(
keys
)
var
r
[]
string
for
_
,
k
:=
range
keys
{
...
...
@@ -114,7 +114,7 @@ func IntMapToBytes(m map[string]int) []byte {
keys
=
append
(
keys
,
k
)
}
sort
.
S
ortS
trings
(
keys
)
sort
.
Strings
(
keys
)
var
r
[]
string
for
_
,
k
:=
range
keys
{
...
...
fuse/pathfilesystem.go
View file @
a964aa5c
...
...
@@ -448,7 +448,7 @@ func (me *FileSystemConnector) unlinkUpdate(parent *inode, name string) {
// node not found.
func
(
me
*
FileSystemConnector
)
findInode
(
fullPath
string
)
*
inode
{
fullPath
=
strings
.
TrimLeft
(
filepath
.
Clean
(
fullPath
),
"/"
)
comps
:=
strings
.
Split
(
fullPath
,
"/"
,
-
1
)
comps
:=
strings
.
Split
(
fullPath
,
"/"
)
node
:=
me
.
rootNode
for
_
,
component
:=
range
comps
{
...
...
fuse/request.go
View file @
a964aa5c
...
...
@@ -110,7 +110,7 @@ func (me *request) parse() {
if
count
==
1
{
me
.
filenames
=
[]
string
{
string
(
me
.
arg
[
:
len
(
me
.
arg
)
-
1
])}
}
else
{
names
:=
bytes
.
Split
(
me
.
arg
[
:
len
(
me
.
arg
)
-
1
],
[]
byte
{
0
},
count
)
names
:=
bytes
.
Split
N
(
me
.
arg
[
:
len
(
me
.
arg
)
-
1
],
[]
byte
{
0
},
count
)
me
.
filenames
=
make
([]
string
,
len
(
names
))
for
i
,
n
:=
range
names
{
me
.
filenames
[
i
]
=
string
(
n
)
...
...
fuse/xattr.go
View file @
a964aa5c
...
...
@@ -65,7 +65,7 @@ func ListXAttr(path string) (attributes []string, errno int) {
// -1 to drop the final empty slice.
dest
=
dest
[
:
sz
-
1
]
attributesBytes
:=
bytes
.
Split
(
dest
,
[]
byte
{
0
}
,
-
1
)
attributesBytes
:=
bytes
.
Split
(
dest
,
[]
byte
{
0
})
attributes
=
make
([]
string
,
len
(
attributesBytes
))
for
i
,
v
:=
range
attributesBytes
{
attributes
[
i
]
=
string
(
v
)
...
...
unionfs/autounion.go
View file @
a964aa5c
...
...
@@ -168,7 +168,7 @@ func (me *AutoUnionFs) updateKnownFses() {
}
func
(
me
*
AutoUnionFs
)
Readlink
(
path
string
)
(
out
string
,
code
fuse
.
Status
)
{
comps
:=
strings
.
Split
(
path
,
fuse
.
SeparatorString
,
-
1
)
comps
:=
strings
.
Split
(
path
,
fuse
.
SeparatorString
)
if
comps
[
0
]
==
_STATUS
&&
comps
[
1
]
==
_ROOT
{
return
me
.
root
,
fuse
.
OK
}
...
...
@@ -194,7 +194,7 @@ func (me *AutoUnionFs) getUnionFs(name string) *UnionFs {
}
func
(
me
*
AutoUnionFs
)
Symlink
(
pointedTo
string
,
linkName
string
)
(
code
fuse
.
Status
)
{
comps
:=
strings
.
Split
(
linkName
,
"/"
,
-
1
)
comps
:=
strings
.
Split
(
linkName
,
"/"
)
if
len
(
comps
)
!=
2
{
return
fuse
.
EPERM
}
...
...
@@ -213,7 +213,7 @@ func (me *AutoUnionFs) Symlink(pointedTo string, linkName string) (code fuse.Sta
func
(
me
*
AutoUnionFs
)
Unlink
(
path
string
)
(
code
fuse
.
Status
)
{
comps
:=
strings
.
Split
(
path
,
"/"
,
-
1
)
comps
:=
strings
.
Split
(
path
,
"/"
)
if
len
(
comps
)
!=
2
{
return
fuse
.
EPERM
}
...
...
@@ -260,7 +260,7 @@ func (me *AutoUnionFs) GetAttr(path string) (*os.FileInfo, fuse.Status) {
}
return
a
,
fuse
.
OK
}
comps
:=
strings
.
Split
(
path
,
fuse
.
SeparatorString
,
-
1
)
comps
:=
strings
.
Split
(
path
,
fuse
.
SeparatorString
)
if
len
(
comps
)
>
1
&&
comps
[
0
]
==
_CONFIG
{
fs
:=
me
.
getUnionFs
(
comps
[
1
])
...
...
unionfs/cachingfs.go
View file @
a964aa5c
...
...
@@ -69,7 +69,7 @@ func getAttr(fs fuse.FileSystem, name string) *attrResponse {
}
func
getXAttr
(
fs
fuse
.
FileSystem
,
nameAttr
string
)
*
xattrResponse
{
ns
:=
strings
.
Split
(
nameAttr
,
_XATTRSEP
,
2
)
ns
:=
strings
.
Split
N
(
nameAttr
,
_XATTRSEP
,
2
)
a
,
code
:=
fs
.
GetXAttr
(
ns
[
0
],
ns
[
1
])
return
&
xattrResponse
{
data
:
a
,
...
...
@@ -93,7 +93,7 @@ func NewCachingFileSystem(fs fuse.FileSystem, ttlNs int64) *CachingFileSystem {
c
.
links
=
NewTimedCache
(
func
(
n
string
)
interface
{}
{
return
readLink
(
fs
,
n
)
},
ttlNs
)
c
.
xattr
=
NewTimedCache
(
func
(
n
string
)
interface
{}
{
return
getXAttr
(
fs
,
n
)
},
ttlNs
)
},
ttlNs
)
return
c
}
...
...
@@ -107,7 +107,7 @@ func (me *CachingFileSystem) GetAttr(name string) (*os.FileInfo, fuse.Status) {
if
name
==
_DROP_CACHE
{
return
&
os
.
FileInfo
{
Mode
:
fuse
.
S_IFREG
|
0777
,
},
fuse
.
OK
},
fuse
.
OK
}
r
:=
me
.
attributes
.
Get
(
name
)
.
(
*
attrResponse
)
...
...
zipfs/memtree.go
View file @
a964aa5c
...
...
@@ -46,7 +46,7 @@ func (me *MemTree) Lookup(name string) (*MemTree, MemFile) {
return
me
,
nil
}
parent
:=
me
comps
:=
strings
.
Split
(
filepath
.
Clean
(
name
),
"/"
,
-
1
)
comps
:=
strings
.
Split
(
filepath
.
Clean
(
name
),
"/"
)
for
_
,
c
:=
range
comps
[
:
len
(
comps
)
-
1
]
{
parent
=
parent
.
subdirs
[
c
]
if
parent
==
nil
{
...
...
zipfs/tarfs.go
View file @
a964aa5c
...
...
@@ -74,7 +74,7 @@ func NewTarTree(r io.Reader) *MemTree {
longName
=
nil
}
comps
:=
strings
.
Split
(
filepath
.
Clean
(
hdr
.
Name
),
"/"
,
-
1
)
comps
:=
strings
.
Split
(
filepath
.
Clean
(
hdr
.
Name
),
"/"
)
base
:=
""
if
!
strings
.
HasSuffix
(
hdr
.
Name
,
"/"
)
{
base
=
comps
[
len
(
comps
)
-
1
]
...
...
zipfs/zipfs.go
View file @
a964aa5c
...
...
@@ -51,7 +51,7 @@ func zipFilesToTree(files []*zip.File) *MemTree {
t
:=
NewMemTree
()
for
_
,
f
:=
range
files
{
parent
:=
t
comps
:=
strings
.
Split
(
filepath
.
Clean
(
f
.
Name
),
"/"
,
-
1
)
comps
:=
strings
.
Split
(
filepath
.
Clean
(
f
.
Name
),
"/"
)
base
:=
""
// Ugh - zip files have directories separate.
...
...
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