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
86b0092e
Commit
86b0092e
authored
Mar 14, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use filepath throughout.
parent
d2454936
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
67 additions
and
68 deletions
+67
-68
examplelib/multizip.go
examplelib/multizip.go
+6
-6
examplelib/stackfs_test.go
examplelib/stackfs_test.go
+10
-10
examplelib/zipfs.go
examplelib/zipfs.go
+3
-3
fuse/fuse.go
fuse/fuse.go
+1
-1
fuse/loopback.go
fuse/loopback.go
+2
-2
fuse/loopback_test.go
fuse/loopback_test.go
+22
-22
fuse/misc.go
fuse/misc.go
+3
-4
fuse/mount.go
fuse/mount.go
+5
-5
fuse/pathfilesystem.go
fuse/pathfilesystem.go
+15
-15
No files found.
examplelib/multizip.go
View file @
86b0092e
...
...
@@ -14,7 +14,7 @@ import (
"github.com/hanwen/go-fuse/fuse"
"log"
"os"
"path"
"path
/filepath
"
"sync"
"strings"
)
...
...
@@ -51,7 +51,7 @@ func (me *zipCreateFile) Write(input *fuse.WriteIn, nameBytes []byte) (uint32, f
return
0
,
fuse
.
ENOSYS
}
code
:=
me
.
zfs
.
Connector
.
Mount
(
"/"
+
path
.
Base
(
me
.
Basename
),
fs
)
code
:=
me
.
zfs
.
Connector
.
Mount
(
"/"
+
file
path
.
Base
(
me
.
Basename
),
fs
)
if
code
!=
fuse
.
OK
{
return
0
,
code
...
...
@@ -142,7 +142,7 @@ func (me *MultiZipFs) GetAttr(name string) (*fuse.Attr, fuse.Status) {
return
a
,
fuse
.
OK
}
dir
,
base
:=
path
.
Split
(
name
)
dir
,
base
:=
file
path
.
Split
(
name
)
if
dir
!=
""
&&
dir
!=
CONFIG_PREFIX
{
return
nil
,
fuse
.
ENOENT
}
...
...
@@ -169,7 +169,7 @@ func (me *MultiZipFs) GetAttr(name string) (*fuse.Attr, fuse.Status) {
}
func
(
me
*
MultiZipFs
)
Unlink
(
name
string
)
(
code
fuse
.
Status
)
{
dir
,
basename
:=
path
.
Split
(
name
)
dir
,
basename
:=
file
path
.
Split
(
name
)
if
dir
==
CONFIG_PREFIX
{
me
.
lock
.
Lock
()
defer
me
.
lock
.
Unlock
()
...
...
@@ -190,7 +190,7 @@ func (me *MultiZipFs) Open(name string, flags uint32) (file fuse.RawFuseFile, co
return
nil
,
fuse
.
EPERM
}
dir
,
basename
:=
path
.
Split
(
name
)
dir
,
basename
:=
file
path
.
Split
(
name
)
if
dir
==
CONFIG_PREFIX
{
me
.
lock
.
RLock
()
defer
me
.
lock
.
RUnlock
()
...
...
@@ -207,7 +207,7 @@ func (me *MultiZipFs) Open(name string, flags uint32) (file fuse.RawFuseFile, co
}
func
(
me
*
MultiZipFs
)
Create
(
name
string
,
flags
uint32
,
mode
uint32
)
(
file
fuse
.
RawFuseFile
,
code
fuse
.
Status
)
{
dir
,
base
:=
path
.
Split
(
name
)
dir
,
base
:=
file
path
.
Split
(
name
)
if
dir
!=
CONFIG_PREFIX
{
return
nil
,
fuse
.
EPERM
}
...
...
examplelib/stackfs_test.go
View file @
86b0092e
...
...
@@ -5,7 +5,7 @@ import (
"fmt"
"log"
"os"
"path"
"path
/filepath
"
"strings"
"testing"
)
...
...
@@ -33,9 +33,9 @@ func (me *stackFsTestCase) Setup(t *testing.T) {
me
.
tester
=
t
me
.
testDir
=
fuse
.
MakeTempDir
()
me
.
origDir1
=
path
.
Join
(
me
.
testDir
,
"orig1"
)
me
.
origDir2
=
path
.
Join
(
me
.
testDir
,
"orig2"
)
me
.
mountDir
=
path
.
Join
(
me
.
testDir
,
"mount"
)
me
.
origDir1
=
file
path
.
Join
(
me
.
testDir
,
"orig1"
)
me
.
origDir2
=
file
path
.
Join
(
me
.
testDir
,
"orig2"
)
me
.
mountDir
=
file
path
.
Join
(
me
.
testDir
,
"mount"
)
os
.
Mkdir
(
me
.
origDir1
,
0700
)
os
.
Mkdir
(
me
.
origDir2
,
0700
)
...
...
@@ -107,12 +107,12 @@ func (me *stackFsTestCase) testReaddir() {
func
(
me
*
stackFsTestCase
)
testSubFs
()
{
fmt
.
Println
(
"testSubFs... "
)
for
i
:=
1
;
i
<=
2
;
i
++
{
// orig := path.Join(me.testDir, fmt.Sprintf("orig%d", i))
mount
:=
path
.
Join
(
me
.
mountDir
,
fmt
.
Sprintf
(
"sub%d"
,
i
))
// orig :=
file
path.Join(me.testDir, fmt.Sprintf("orig%d", i))
mount
:=
file
path
.
Join
(
me
.
mountDir
,
fmt
.
Sprintf
(
"sub%d"
,
i
))
name
:=
"testFile"
mountFile
:=
path
.
Join
(
mount
,
name
)
mountFile
:=
file
path
.
Join
(
mount
,
name
)
f
,
err
:=
os
.
Open
(
mountFile
,
os
.
O_WRONLY
,
0
)
if
err
==
nil
{
...
...
@@ -130,7 +130,7 @@ func (me *stackFsTestCase) testSubFs() {
CheckSuccess
(
err
)
fi
,
err
:=
os
.
Lstat
(
mountFile
)
CheckSuccess
(
err
)
CheckSuccess
(
err
)
if
fi
.
Mode
&
0777
!=
magicMode
{
me
.
tester
.
Errorf
(
"Mode %o"
,
fi
.
Mode
)
}
...
...
@@ -166,7 +166,7 @@ func (me *stackFsTestCase) testAddRemove() {
}
conn
.
Init
(
new
(
fuse
.
InHeader
),
new
(
fuse
.
InitIn
))
fi
,
err
:=
os
.
Lstat
(
path
.
Join
(
me
.
mountDir
,
"third"
))
fi
,
err
:=
os
.
Lstat
(
file
path
.
Join
(
me
.
mountDir
,
"third"
))
CheckSuccess
(
err
)
if
!
fi
.
IsDirectory
()
{
...
...
@@ -186,7 +186,7 @@ func (me *stackFsTestCase) testAddRemove() {
}
dir
.
Close
()
_
,
err
=
os
.
Open
(
path
.
Join
(
me
.
mountDir
,
"third"
),
os
.
O_RDONLY
,
0
)
_
,
err
=
os
.
Open
(
file
path
.
Join
(
me
.
mountDir
,
"third"
),
os
.
O_RDONLY
,
0
)
if
err
==
nil
{
me
.
tester
.
Errorf
(
"expect enoent %v"
,
err
)
}
...
...
examplelib/zipfs.go
View file @
86b0092e
...
...
@@ -6,7 +6,7 @@ import (
"fmt"
"os"
"strings"
"path"
"path
/filepath
"
"log"
)
...
...
@@ -44,7 +44,7 @@ func (me *ZipDirTree) Lookup(name string) (*ZipDirTree, *zip.File) {
return
me
,
nil
}
parent
:=
me
comps
:=
strings
.
Split
(
path
.
Clean
(
name
),
"/"
,
-
1
)
comps
:=
strings
.
Split
(
file
path
.
Clean
(
name
),
"/"
,
-
1
)
for
_
,
c
:=
range
comps
[
:
len
(
comps
)
-
1
]
{
parent
=
parent
.
subdirs
[
c
]
if
parent
==
nil
{
...
...
@@ -82,7 +82,7 @@ func zipFilesToTree(files []*zip.File) *ZipDirTree {
t
:=
NewZipDirTree
()
for
_
,
f
:=
range
files
{
parent
:=
t
comps
:=
strings
.
Split
(
path
.
Clean
(
f
.
Name
),
"/"
,
-
1
)
comps
:=
strings
.
Split
(
file
path
.
Clean
(
f
.
Name
),
"/"
,
-
1
)
base
:=
""
// Ugh - zip files have directories separate.
...
...
fuse/fuse.go
View file @
86b0092e
...
...
@@ -16,7 +16,7 @@ import (
const
(
// bufSize should be a power of two to minimize lossage in
// BufferPool.
bufSize
=
(
1
<<
1
6
)
bufSize
=
(
1
<<
1
8
)
maxRead
=
bufSize
-
PAGESIZE
)
...
...
fuse/loopback.go
View file @
86b0092e
...
...
@@ -7,7 +7,7 @@ package fuse
import
(
"fmt"
"os"
"path"
"path
/filepath
"
"syscall"
)
...
...
@@ -27,7 +27,7 @@ func NewLoopbackFileSystem(root string) (out *LoopbackFileSystem) {
}
func
(
me
*
LoopbackFileSystem
)
GetPath
(
relPath
string
)
string
{
return
path
.
Join
(
me
.
root
,
relPath
)
return
file
path
.
Join
(
me
.
root
,
relPath
)
}
func
(
me
*
LoopbackFileSystem
)
GetAttr
(
name
string
)
(
*
Attr
,
Status
)
{
...
...
fuse/loopback_test.go
View file @
86b0092e
...
...
@@ -5,7 +5,7 @@ import (
"fmt"
"log"
"os"
"path"
"path
/filepath
"
"strings"
"testing"
"syscall"
...
...
@@ -46,12 +46,12 @@ func (me *testCase) Setup(t *testing.T) {
me
.
origDir
=
MakeTempDir
()
me
.
mountPoint
=
MakeTempDir
()
me
.
mountFile
=
path
.
Join
(
me
.
mountPoint
,
name
)
me
.
mountSubdir
=
path
.
Join
(
me
.
mountPoint
,
subdir
)
me
.
mountSubfile
=
path
.
Join
(
me
.
mountSubdir
,
"subfile"
)
me
.
origFile
=
path
.
Join
(
me
.
origDir
,
name
)
me
.
origSubdir
=
path
.
Join
(
me
.
origDir
,
subdir
)
me
.
origSubfile
=
path
.
Join
(
me
.
origSubdir
,
"subfile"
)
me
.
mountFile
=
file
path
.
Join
(
me
.
mountPoint
,
name
)
me
.
mountSubdir
=
file
path
.
Join
(
me
.
mountPoint
,
subdir
)
me
.
mountSubfile
=
file
path
.
Join
(
me
.
mountSubdir
,
"subfile"
)
me
.
origFile
=
file
path
.
Join
(
me
.
origDir
,
name
)
me
.
origSubdir
=
file
path
.
Join
(
me
.
origDir
,
subdir
)
me
.
origSubfile
=
file
path
.
Join
(
me
.
origSubdir
,
"subfile"
)
pfs
:=
NewLoopbackFileSystem
(
me
.
origDir
)
me
.
connector
=
NewPathFileSystemConnector
(
pfs
)
...
...
@@ -108,7 +108,7 @@ func (me *testCase) writeOrigFile() {
// Tests.
func
(
me
*
testCase
)
testOpenUnreadable
()
{
_
,
err
:=
os
.
Open
(
path
.
Join
(
me
.
mountPoint
,
"doesnotexist"
),
os
.
O_RDONLY
,
0
)
_
,
err
:=
os
.
Open
(
file
path
.
Join
(
me
.
mountPoint
,
"doesnotexist"
),
os
.
O_RDONLY
,
0
)
if
err
==
nil
{
me
.
tester
.
Errorf
(
"open non-existent should raise error"
)
}
...
...
@@ -241,13 +241,13 @@ func (me *testCase) testSymlink() {
linkFile
:=
"symlink-file"
orig
:=
"hello.txt"
err
:=
os
.
Symlink
(
orig
,
path
.
Join
(
me
.
mountPoint
,
linkFile
))
defer
os
.
Remove
(
path
.
Join
(
me
.
mountPoint
,
linkFile
))
err
:=
os
.
Symlink
(
orig
,
file
path
.
Join
(
me
.
mountPoint
,
linkFile
))
defer
os
.
Remove
(
file
path
.
Join
(
me
.
mountPoint
,
linkFile
))
defer
me
.
removeMountFile
()
CheckSuccess
(
err
)
origLink
:=
path
.
Join
(
me
.
origDir
,
linkFile
)
origLink
:=
file
path
.
Join
(
me
.
origDir
,
linkFile
)
fi
,
err
:=
os
.
Lstat
(
origLink
)
CheckSuccess
(
err
)
...
...
@@ -256,7 +256,7 @@ func (me *testCase) testSymlink() {
return
}
read
,
err
:=
os
.
Readlink
(
path
.
Join
(
me
.
mountPoint
,
linkFile
))
read
,
err
:=
os
.
Readlink
(
file
path
.
Join
(
me
.
mountPoint
,
linkFile
))
CheckSuccess
(
err
)
if
read
!=
orig
{
...
...
@@ -368,7 +368,7 @@ func (me *testCase) testFSync() {
func
(
me
*
testCase
)
testLargeRead
()
{
me
.
tester
.
Log
(
"Testing large read."
)
name
:=
path
.
Join
(
me
.
origDir
,
"large"
)
name
:=
file
path
.
Join
(
me
.
origDir
,
"large"
)
f
,
err
:=
os
.
Open
(
name
,
os
.
O_WRONLY
|
os
.
O_CREATE
,
0777
)
CheckSuccess
(
err
)
...
...
@@ -387,7 +387,7 @@ func (me *testCase) testLargeRead() {
CheckSuccess
(
err
)
// Read in one go.
g
,
err
:=
os
.
Open
(
path
.
Join
(
me
.
mountPoint
,
"large"
),
os
.
O_RDONLY
,
0
)
g
,
err
:=
os
.
Open
(
file
path
.
Join
(
me
.
mountPoint
,
"large"
),
os
.
O_RDONLY
,
0
)
CheckSuccess
(
err
)
readSlice
:=
make
([]
byte
,
len
(
slice
))
m
,
err
:=
g
.
Read
(
readSlice
)
...
...
@@ -405,7 +405,7 @@ func (me *testCase) testLargeRead() {
g
.
Close
()
// Read in chunks
g
,
err
=
os
.
Open
(
path
.
Join
(
me
.
mountPoint
,
"large"
),
os
.
O_RDONLY
,
0
)
g
,
err
=
os
.
Open
(
file
path
.
Join
(
me
.
mountPoint
,
"large"
),
os
.
O_RDONLY
,
0
)
CheckSuccess
(
err
)
readSlice
=
make
([]
byte
,
4096
)
total
:=
0
...
...
@@ -444,7 +444,7 @@ func (me *testCase) testLargeDirRead() {
names
:=
make
([]
string
,
created
)
subdir
:=
path
.
Join
(
me
.
origDir
,
"readdirSubdir"
)
subdir
:=
file
path
.
Join
(
me
.
origDir
,
"readdirSubdir"
)
os
.
Mkdir
(
subdir
,
0700
)
longname
:=
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
...
...
@@ -453,7 +453,7 @@ func (me *testCase) testLargeDirRead() {
// Should vary file name length.
base
:=
fmt
.
Sprintf
(
"file%d%s"
,
i
,
randomLengthString
(
len
(
longname
)))
name
:=
path
.
Join
(
subdir
,
base
)
name
:=
file
path
.
Join
(
subdir
,
base
)
nameSet
[
base
]
=
true
...
...
@@ -465,7 +465,7 @@ func (me *testCase) testLargeDirRead() {
names
[
i
]
=
name
}
dir
,
err
:=
os
.
Open
(
path
.
Join
(
me
.
mountPoint
,
"readdirSubdir"
),
os
.
O_RDONLY
,
0
)
dir
,
err
:=
os
.
Open
(
file
path
.
Join
(
me
.
mountPoint
,
"readdirSubdir"
),
os
.
O_RDONLY
,
0
)
CheckSuccess
(
err
)
// Chunked read.
total
:=
0
...
...
@@ -524,7 +524,7 @@ func TestRecursiveMount(t *testing.T) {
ts
:=
new
(
testCase
)
ts
.
Setup
(
t
)
f
,
err
:=
os
.
Open
(
path
.
Join
(
ts
.
mountPoint
,
"hello.txt"
),
f
,
err
:=
os
.
Open
(
file
path
.
Join
(
ts
.
mountPoint
,
"hello.txt"
),
os
.
O_WRONLY
|
os
.
O_CREATE
,
0777
)
CheckSuccess
(
err
)
...
...
@@ -537,7 +537,7 @@ func TestRecursiveMount(t *testing.T) {
t
.
Error
(
"expect EINVAL"
,
code
)
}
submnt
:=
path
.
Join
(
ts
.
mountPoint
,
"mnt"
)
submnt
:=
file
path
.
Join
(
ts
.
mountPoint
,
"mnt"
)
err
=
os
.
Mkdir
(
submnt
,
0777
)
CheckSuccess
(
err
)
code
=
ts
.
connector
.
Mount
(
"/mnt"
,
pfs2
)
...
...
@@ -547,10 +547,10 @@ func TestRecursiveMount(t *testing.T) {
_
,
err
=
os
.
Lstat
(
submnt
)
CheckSuccess
(
err
)
_
,
err
=
os
.
Lstat
(
path
.
Join
(
submnt
,
"hello.txt"
))
_
,
err
=
os
.
Lstat
(
file
path
.
Join
(
submnt
,
"hello.txt"
))
CheckSuccess
(
err
)
f
,
err
=
os
.
Open
(
path
.
Join
(
submnt
,
"hello.txt"
),
os
.
O_RDONLY
,
0
)
f
,
err
=
os
.
Open
(
file
path
.
Join
(
submnt
,
"hello.txt"
),
os
.
O_RDONLY
,
0
)
CheckSuccess
(
err
)
code
=
ts
.
connector
.
Unmount
(
"/mnt"
)
if
code
!=
EBUSY
{
...
...
fuse/misc.go
View file @
86b0092e
...
...
@@ -9,7 +9,7 @@ import (
"os"
"time"
"fmt"
"path"
"path
/filepath
"
"math"
"regexp"
"syscall"
...
...
@@ -24,7 +24,7 @@ func MakeTempDir() string {
number
:=
source
.
Int63
()
&
0xffff
name
:=
fmt
.
Sprintf
(
"tmp%d"
,
number
)
fullName
:=
path
.
Join
(
os
.
TempDir
(),
name
)
fullName
:=
file
path
.
Join
(
os
.
TempDir
(),
name
)
err
:=
os
.
Mkdir
(
fullName
,
0700
)
if
err
!=
nil
{
panic
(
"Mkdir() should always succeed: "
+
fullName
)
...
...
@@ -49,7 +49,7 @@ func OsErrorToFuseError(err os.Error) Status {
if
ok
{
return
OsErrorToFuseError
(
asPathErr
.
Error
)
}
// Should not happen. Should we log an error somewhere?
return
ENOSYS
}
...
...
@@ -270,7 +270,6 @@ func Writev(fd int, packet [][]byte) (n int, err os.Error) {
if
errno
!=
0
{
err
=
os
.
NewSyscallError
(
"writev"
,
errno
)
return
}
return
}
...
...
fuse/mount.go
View file @
86b0092e
...
...
@@ -4,7 +4,7 @@ package fuse
import
(
"fmt"
"os"
"path"
"path
/filepath
"
"syscall"
"unsafe"
)
...
...
@@ -42,13 +42,13 @@ func mount(mountPoint string) (f *os.File, finalMountPoint string, err os.Error)
defer
local
.
Close
()
defer
remote
.
Close
()
mountPoint
=
path
.
Clean
(
mountPoint
)
if
!
path
.
IsAbs
(
mountPoint
)
{
mountPoint
=
file
path
.
Clean
(
mountPoint
)
if
!
file
path
.
IsAbs
(
mountPoint
)
{
cwd
,
err
:=
os
.
Getwd
()
if
err
!=
nil
{
return
}
mountPoint
=
path
.
Clean
(
path
.
Join
(
cwd
,
mountPoint
))
mountPoint
=
filepath
.
Clean
(
file
path
.
Join
(
cwd
,
mountPoint
))
}
proc
,
err
:=
os
.
StartProcess
(
"/bin/fusermount"
,
[]
string
{
"/bin/fusermount"
,
mountPoint
},
...
...
@@ -73,7 +73,7 @@ func mount(mountPoint string) (f *os.File, finalMountPoint string, err os.Error)
}
func
unmount
(
mountPoint
string
)
(
err
os
.
Error
)
{
dir
,
_
:=
path
.
Split
(
mountPoint
)
dir
,
_
:=
file
path
.
Split
(
mountPoint
)
proc
,
err
:=
os
.
StartProcess
(
"/bin/fusermount"
,
[]
string
{
"/bin/fusermount"
,
"-u"
,
mountPoint
},
nil
,
...
...
fuse/pathfilesystem.go
View file @
86b0092e
...
...
@@ -4,7 +4,7 @@ import (
"bytes"
"fmt"
"log"
"path"
"path
/filepath
"
"strings"
"sync"
)
...
...
@@ -15,7 +15,7 @@ type mountData struct {
// Protects the variables below.
mutex
sync
.
RWMutex
// If yes, we are looking to unmount the mounted fs.
unmountPending
bool
...
...
@@ -277,7 +277,7 @@ func (me *PathFileSystemConnector) unlinkUpdate(nodeid uint64, name string) {
// Walk the file system starting from the root.
func
(
me
*
PathFileSystemConnector
)
findInode
(
fullPath
string
)
*
inodeData
{
fullPath
=
strings
.
TrimLeft
(
path
.
Clean
(
fullPath
),
"/"
)
fullPath
=
strings
.
TrimLeft
(
file
path
.
Clean
(
fullPath
),
"/"
)
comps
:=
strings
.
Split
(
fullPath
,
"/"
,
-
1
)
me
.
lock
.
RLock
()
...
...
@@ -334,7 +334,7 @@ func (me *PathFileSystemConnector) Mount(mountPoint string, fs PathFilesystem) S
var
node
*
inodeData
if
mountPoint
!=
"/"
{
dirParent
,
base
:=
path
.
Split
(
mountPoint
)
dirParent
,
base
:=
file
path
.
Split
(
mountPoint
)
dirParentNode
:=
me
.
findInode
(
dirParent
)
// Make sure we know the mount point.
...
...
@@ -393,7 +393,7 @@ func (me *PathFileSystemConnector) Unmount(path string) Status {
if
me
.
Debug
{
log
.
Println
(
"Unmount: "
,
mount
)
}
if
node
.
RefCount
>
0
{
mount
.
fs
.
Unmount
()
mount
.
unmountPending
=
true
...
...
@@ -435,7 +435,7 @@ func (me *PathFileSystemConnector) internalLookup(nodeid uint64, name string, lo
if
mount
==
nil
{
return
NegativeEntry
(
me
.
options
.
NegativeTimeout
),
OK
}
fullPath
=
path
.
Join
(
fullPath
,
name
)
fullPath
=
file
path
.
Join
(
fullPath
,
name
)
attr
,
err
:=
mount
.
fs
.
GetAttr
(
fullPath
)
...
...
@@ -570,7 +570,7 @@ func (me *PathFileSystemConnector) Mknod(header *InHeader, input *MknodIn, name
if
mount
==
nil
{
return
nil
,
ENOENT
}
fullPath
=
path
.
Join
(
fullPath
,
name
)
fullPath
=
file
path
.
Join
(
fullPath
,
name
)
err
:=
mount
.
fs
.
Mknod
(
fullPath
,
input
.
Mode
,
uint32
(
input
.
Rdev
))
if
err
!=
OK
{
return
nil
,
err
...
...
@@ -583,7 +583,7 @@ func (me *PathFileSystemConnector) Mkdir(header *InHeader, input *MkdirIn, name
if
mount
==
nil
{
return
nil
,
ENOENT
}
err
:=
mount
.
fs
.
Mkdir
(
path
.
Join
(
fullPath
,
name
),
input
.
Mode
)
err
:=
mount
.
fs
.
Mkdir
(
file
path
.
Join
(
fullPath
,
name
),
input
.
Mode
)
if
err
!=
OK
{
return
nil
,
err
}
...
...
@@ -596,7 +596,7 @@ func (me *PathFileSystemConnector) Unlink(header *InHeader, name string) (code S
if
mount
==
nil
{
return
ENOENT
}
code
=
mount
.
fs
.
Unlink
(
path
.
Join
(
fullPath
,
name
))
code
=
mount
.
fs
.
Unlink
(
file
path
.
Join
(
fullPath
,
name
))
// Like fuse.c, we update our internal tables.
me
.
unlinkUpdate
(
header
.
NodeId
,
name
)
...
...
@@ -609,7 +609,7 @@ func (me *PathFileSystemConnector) Rmdir(header *InHeader, name string) (code St
if
mount
==
nil
{
return
ENOENT
}
code
=
mount
.
fs
.
Rmdir
(
path
.
Join
(
fullPath
,
name
))
code
=
mount
.
fs
.
Rmdir
(
file
path
.
Join
(
fullPath
,
name
))
me
.
unlinkUpdate
(
header
.
NodeId
,
name
)
return
code
}
...
...
@@ -619,7 +619,7 @@ func (me *PathFileSystemConnector) Symlink(header *InHeader, pointedTo string, l
if
mount
==
nil
{
return
nil
,
ENOENT
}
err
:=
mount
.
fs
.
Symlink
(
pointedTo
,
path
.
Join
(
fullPath
,
linkName
))
err
:=
mount
.
fs
.
Symlink
(
pointedTo
,
file
path
.
Join
(
fullPath
,
linkName
))
if
err
!=
OK
{
return
nil
,
err
}
...
...
@@ -638,8 +638,8 @@ func (me *PathFileSystemConnector) Rename(header *InHeader, input *RenameIn, old
return
EXDEV
}
oldPath
=
path
.
Join
(
oldPath
,
oldName
)
newPath
=
path
.
Join
(
newPath
,
newName
)
oldPath
=
file
path
.
Join
(
oldPath
,
oldName
)
newPath
=
file
path
.
Join
(
newPath
,
newName
)
code
=
mount
.
fs
.
Rename
(
oldPath
,
newPath
)
if
code
!=
OK
{
return
...
...
@@ -666,7 +666,7 @@ func (me *PathFileSystemConnector) Link(header *InHeader, input *LinkIn, filenam
if
mount
!=
newMount
{
return
nil
,
EXDEV
}
newName
=
path
.
Join
(
newName
,
filename
)
newName
=
file
path
.
Join
(
newName
,
filename
)
err
:=
mount
.
fs
.
Link
(
orig
,
newName
)
if
err
!=
OK
{
...
...
@@ -689,7 +689,7 @@ func (me *PathFileSystemConnector) Create(header *InHeader, input *CreateIn, nam
if
mount
==
nil
{
return
0
,
nil
,
nil
,
ENOENT
}
fullPath
:=
path
.
Join
(
directory
,
name
)
fullPath
:=
file
path
.
Join
(
directory
,
name
)
f
,
err
:=
mount
.
fs
.
Create
(
fullPath
,
uint32
(
input
.
Flags
),
input
.
Mode
)
if
err
!=
OK
{
...
...
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