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
f52a93f2
Commit
f52a93f2
authored
Sep 15, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run gofmt.
parent
ae23e54c
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
17 additions
and
27 deletions
+17
-27
fuse/fsconnector.go
fuse/fsconnector.go
+1
-3
fuse/fsmount.go
fuse/fsmount.go
+1
-2
fuse/fsops.go
fuse/fsops.go
+0
-1
fuse/handle.go
fuse/handle.go
+1
-4
fuse/handle_test.go
fuse/handle_test.go
+2
-3
fuse/inode.go
fuse/inode.go
+4
-5
fuse/loopback_test.go
fuse/loopback_test.go
+3
-3
fuse/pathfs.go
fuse/pathfs.go
+4
-4
unionfs/unionfs.go
unionfs/unionfs.go
+0
-1
unionfs/unionfs_test.go
unionfs/unionfs_test.go
+1
-1
No files found.
fuse/fsconnector.go
View file @
f52a93f2
...
...
@@ -34,7 +34,7 @@ type FileSystemConnector struct {
Debug
bool
// Callbacks for talking back to the kernel.
fsInit
RawFsInit
fsInit
RawFsInit
// Translate between uint64 handles and *Inode.
inodeMap
HandleMap
...
...
@@ -77,7 +77,6 @@ func (me *FileSystemConnector) verify() {
root
.
verify
(
me
.
rootNode
.
mountPoint
)
}
// createChild() creates a child for given as FsNode as child of 'parent'. The
// resulting inode will have its lookupCount incremented.
func
(
me
*
FileSystemConnector
)
createChild
(
parent
*
Inode
,
name
string
,
fi
*
os
.
FileInfo
,
fsi
FsNode
)
(
out
*
EntryOut
)
{
...
...
@@ -124,7 +123,6 @@ func (me *FileSystemConnector) lookupUpdate(node *Inode) {
node
.
lookupCount
+=
1
}
// Must run outside treeLock.
//
// TODO - reconcile api for lookupUpdate() and forgetUpdate().
...
...
fuse/fsmount.go
View file @
f52a93f2
...
...
@@ -18,7 +18,6 @@ type openedFile struct {
dir
rawDir
}
type
fileSystemMount
struct
{
// The file system we mounted here.
fs
NodeFileSystem
...
...
@@ -39,7 +38,7 @@ type fileSystemMount struct {
// Manage filehandles of open files.
openFiles
HandleMap
Debug
bool
Debug
bool
}
// Must called with lock for parent held.
...
...
fuse/fsops.go
View file @
f52a93f2
...
...
@@ -59,7 +59,6 @@ func (me *FileSystemConnector) internalLookup(parent *Inode, name string, contex
return
me
.
postLookup
(
fi
,
fsNode
,
code
,
getattrNode
,
lookupNode
,
name
)
}
// Prepare for lookup: we are either looking for getattr of an
// existing node, or lookup a new one. Here we decide which of those
func
(
me
*
FileSystemConnector
)
preLookup
(
parent
*
Inode
,
name
string
)
(
lookupNode
*
Inode
,
attrNode
*
Inode
)
{
...
...
fuse/handle.go
View file @
f52a93f2
...
...
@@ -39,7 +39,7 @@ const _ALREADY_MSG = "Object already has a handle"
type
portableHandleMap
struct
{
sync
.
RWMutex
nextFree
uint32
handles
map
[
uint64
]
*
Handled
handles
map
[
uint64
]
*
Handled
}
func
(
me
*
portableHandleMap
)
Register
(
obj
*
Handled
,
asInt
interface
{})
uint64
{
...
...
@@ -79,7 +79,6 @@ func (me *portableHandleMap) Decode(h uint64) *Handled {
return
me
.
handles
[
h
]
}
func
(
me
*
portableHandleMap
)
Forget
(
h
uint64
)
*
Handled
{
me
.
Lock
()
defer
me
.
Unlock
()
...
...
@@ -95,7 +94,6 @@ func (me *portableHandleMap) Has(h uint64) bool {
return
me
.
handles
[
h
]
!=
nil
}
// 32 bits version of HandleMap
type
int32HandleMap
struct
{
mutex
sync
.
Mutex
...
...
@@ -132,7 +130,6 @@ func (me *int32HandleMap) Forget(handle uint64) *Handled {
return
val
}
func
(
me
*
int32HandleMap
)
Decode
(
handle
uint64
)
*
Handled
{
val
:=
(
*
Handled
)(
unsafe
.
Pointer
(
uintptr
(
handle
&
((
1
<<
32
)
-
1
))))
return
val
...
...
fuse/handle_test.go
View file @
f52a93f2
...
...
@@ -87,9 +87,9 @@ func TestHandleMapBasic(t *testing.T) {
t
.
Fatal
(
"Still has handle"
)
}
if
v
.
check
!=
0
{
t
.
Errorf
(
"forgotten object still has a check."
)
t
.
Errorf
(
"forgotten object still has a check."
)
}
}
}
}
func
TestHandleMapMultiple
(
t
*
testing
.
T
)
{
...
...
@@ -119,4 +119,3 @@ func TestHandleMapCheckFail(t *testing.T) {
hm
.
Decode
(
h
|
(
uint64
(
1
)
<<
63
))
t
.
Error
(
"Borked decode did not panic"
)
}
fuse/inode.go
View file @
f52a93f2
...
...
@@ -24,7 +24,7 @@ type Inode struct {
// pointer is constant during the lifetime, except upon
// Unmount() when it is set to nil.
mount
*
fileSystemMount
// treeLock is a pointer to me.mount.treeLock. We store it
// here for convenience. Constant during lifetime of the
// inode.
...
...
@@ -44,7 +44,7 @@ type Inode struct {
// it is zero, it means the kernel does not know about this
// Inode. nodeIds are chosen by FileSystemConnector.inodeMap.
nodeId
uint64
// lookupCount registers how often the kernel got this inode
// back for a Lookup operation. This number is a reference
// count, and the Forget operation lists how many references to drop.
...
...
@@ -56,7 +56,7 @@ type Inode struct {
// This is to prevent lookupCount==0 node from being dropped.
synthetic
bool
// Non-nil if this inode is a mountpoint, ie. the Root of a
// NodeFileSystem.
mountPoint
*
fileSystemMount
...
...
@@ -128,13 +128,12 @@ func (me *Inode) IsDir() bool {
return
me
.
children
!=
nil
}
// CreateChild() creates node for synthetic use
func
(
me
*
Inode
)
CreateChild
(
name
string
,
isDir
bool
,
fsi
FsNode
)
*
Inode
{
me
.
treeLock
.
Lock
()
defer
me
.
treeLock
.
Unlock
()
ch
:=
me
.
createChild
(
name
,
isDir
,
fsi
)
ch
:=
me
.
createChild
(
name
,
isDir
,
fsi
)
ch
.
synthetic
=
true
return
ch
}
...
...
fuse/loopback_test.go
View file @
f52a93f2
...
...
@@ -736,12 +736,12 @@ func TestUmask(t *testing.T) {
defer
ts
.
Cleanup
()
// Make sure system setting does not affect test.
fn
:=
ts
.
mnt
+
"/file"
fn
:=
ts
.
mnt
+
"/file"
mask
:=
020
cmd
:=
exec
.
Command
(
"/bin/sh"
,
"-c"
,
cmd
:=
exec
.
Command
(
"/bin/sh"
,
"-c"
,
fmt
.
Sprintf
(
"umask %o && mkdir %s"
,
mask
,
fn
))
cmd
.
Run
()
fi
,
err
:=
os
.
Lstat
(
fn
)
CheckSuccess
(
err
)
...
...
fuse/pathfs.go
View file @
f52a93f2
...
...
@@ -35,7 +35,7 @@ type PathNodeFs struct {
// This map lists all the parent links known for a given
// nodeId.
clientInodeMap
map
[
uint64
][]
*
clientInodePath
clientInodeMap
map
[
uint64
][]
*
clientInodePath
}
func
(
me
*
PathNodeFs
)
Mount
(
path
string
,
nodeFs
NodeFileSystem
,
opts
*
FileSystemOptions
)
Status
{
...
...
@@ -154,9 +154,9 @@ func (me *PathNodeFs) Root() FsNode {
// the inode). This structure is used to implement glue for FSes where
// there is a one-to-one mapping of paths and inodes.
type
pathInode
struct
{
pathFs
*
PathNodeFs
fs
FileSystem
Name
string
pathFs
*
PathNodeFs
fs
FileSystem
Name
string
// This is nil at the root of the mount.
Parent
*
pathInode
...
...
unionfs/unionfs.go
View file @
f52a93f2
...
...
@@ -952,4 +952,3 @@ func (me *UnionFsFile) GetAttr() (*os.FileInfo, fuse.Status) {
}
return
fi
,
code
}
unionfs/unionfs_test.go
View file @
f52a93f2
...
...
@@ -993,7 +993,7 @@ func TestStatFs(t *testing.T) {
defer
clean
()
s1
:=
syscall
.
Statfs_t
{}
err
:=
syscall
.
Statfs
(
wd
+
"/mount"
,
&
s1
)
err
:=
syscall
.
Statfs
(
wd
+
"/mount"
,
&
s1
)
if
err
!=
0
{
t
.
Fatal
(
"statfs mnt"
,
err
)
}
...
...
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