Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-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
jacobsa-fuse
Commits
f0fb8be9
Commit
f0fb8be9
authored
Jul 23, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some fuseshim build errors.
parent
4bc4c238
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
17 deletions
+21
-17
internal/fuseshim/fuse.go
internal/fuseshim/fuse.go
+19
-17
internal/fuseshim/options.go
internal/fuseshim/options.go
+2
-0
No files found.
internal/fuseshim/fuse.go
View file @
f0fb8be9
...
...
@@ -111,6 +111,8 @@ import (
"syscall"
"time"
"unsafe"
"github.com/jacobsa/fuse/internal/fusekernel"
)
// A Conn represents a connection to a mounted FUSE file system.
...
...
@@ -129,7 +131,7 @@ type Conn struct {
rio
sync
.
RWMutex
// Protocol version negotiated with InitRequest/InitResponse.
proto
Protocol
proto
fusekernel
.
Protocol
}
// Mount mounts a new FUSE connection on the named directory
...
...
@@ -171,8 +173,8 @@ func Mount(dir string, options ...MountOption) (*Conn, error) {
}
type
OldVersionError
struct
{
Kernel
Protocol
LibraryMin
Protocol
Kernel
fusekernel
.
Protocol
LibraryMin
fusekernel
.
Protocol
}
func
(
e
*
OldVersionError
)
Error
()
string
{
...
...
@@ -192,7 +194,7 @@ func initMount(c *Conn, conf *mountConfig) error {
return
fmt
.
Errorf
(
"missing init, got: %T"
,
req
)
}
min
:=
Protocol
{
protoVersionMinMajor
,
protoVersionMinMinor
}
min
:=
fusekernel
.
Protocol
{
protoVersionMinMajor
,
protoVersionMinMinor
}
if
r
.
Kernel
.
LT
(
min
)
{
req
.
RespondError
(
Errno
(
syscall
.
EPROTO
))
c
.
Close
()
...
...
@@ -202,7 +204,7 @@ func initMount(c *Conn, conf *mountConfig) error {
}
}
proto
:=
Protocol
{
protoVersionMaxMajor
,
protoVersionMaxMinor
}
proto
:=
fusekernel
.
Protocol
{
protoVersionMaxMajor
,
protoVersionMaxMinor
}
if
r
.
Kernel
.
LT
(
proto
)
{
// Kernel doesn't support the latest version we have.
proto
=
r
.
Kernel
...
...
@@ -518,7 +520,7 @@ func (c *Conn) fd() int {
return
int
(
c
.
dev
.
Fd
())
}
func
(
c
*
Conn
)
Protocol
()
Protocol
{
func
(
c
*
Conn
)
Protocol
()
fusekernel
.
Protocol
{
return
c
.
proto
}
...
...
@@ -603,7 +605,7 @@ loop:
case
opGetattr
:
switch
{
case
c
.
proto
.
LT
(
Protocol
{
7
,
9
})
:
case
c
.
proto
.
LT
(
fusekernel
.
Protocol
{
7
,
9
})
:
req
=
&
GetattrRequest
{
Header
:
m
.
Header
(),
}
...
...
@@ -698,7 +700,7 @@ loop:
Rdev
:
in
.
Rdev
,
Name
:
string
(
name
),
}
if
c
.
proto
.
GE
(
Protocol
{
7
,
12
})
{
if
c
.
proto
.
GE
(
fusekernel
.
Protocol
{
7
,
12
})
{
r
.
Umask
=
fileMode
(
in
.
Umask
)
&
os
.
ModePerm
}
req
=
r
...
...
@@ -722,7 +724,7 @@ loop:
// code branch; enforce type to directory
Mode
:
fileMode
((
in
.
Mode
&^
syscall
.
S_IFMT
)
|
syscall
.
S_IFDIR
),
}
if
c
.
proto
.
GE
(
Protocol
{
7
,
12
})
{
if
c
.
proto
.
GE
(
fusekernel
.
Protocol
{
7
,
12
})
{
r
.
Umask
=
fileMode
(
in
.
Umask
)
&
os
.
ModePerm
}
req
=
r
...
...
@@ -788,7 +790,7 @@ loop:
Offset
:
int64
(
in
.
Offset
),
Size
:
int
(
in
.
Size
),
}
if
c
.
proto
.
GE
(
Protocol
{
7
,
9
})
{
if
c
.
proto
.
GE
(
fusekernel
.
Protocol
{
7
,
9
})
{
r
.
Flags
=
ReadFlags
(
in
.
ReadFlags
)
r
.
LockOwner
=
in
.
LockOwner
r
.
FileFlags
=
openFlags
(
in
.
Flags
)
...
...
@@ -806,7 +808,7 @@ loop:
Offset
:
int64
(
in
.
Offset
),
Flags
:
WriteFlags
(
in
.
WriteFlags
),
}
if
c
.
proto
.
GE
(
Protocol
{
7
,
9
})
{
if
c
.
proto
.
GE
(
fusekernel
.
Protocol
{
7
,
9
})
{
r
.
LockOwner
=
in
.
LockOwner
r
.
FileFlags
=
openFlags
(
in
.
Flags
)
}
...
...
@@ -930,7 +932,7 @@ loop:
}
req
=
&
InitRequest
{
Header
:
m
.
Header
(),
Kernel
:
Protocol
{
in
.
Major
,
in
.
Minor
},
Kernel
:
fusekernel
.
Protocol
{
in
.
Major
,
in
.
Minor
},
MaxReadahead
:
in
.
MaxReadahead
,
Flags
:
InitFlags
(
in
.
Flags
),
}
...
...
@@ -969,7 +971,7 @@ loop:
Mode
:
fileMode
(
in
.
Mode
),
Name
:
string
(
name
[
:
i
]),
}
if
c
.
proto
.
GE
(
Protocol
{
7
,
12
})
{
if
c
.
proto
.
GE
(
fusekernel
.
Protocol
{
7
,
12
})
{
r
.
Umask
=
fileMode
(
in
.
Umask
)
&
os
.
ModePerm
}
req
=
r
...
...
@@ -1151,7 +1153,7 @@ func (c *Conn) InvalidateEntry(parent NodeID, name string) error {
// An InitRequest is the first request sent on a FUSE file system.
type
InitRequest
struct
{
Header
`json:"-"`
Kernel
Protocol
Kernel
fusekernel
.
Protocol
// Maximum readahead in bytes that the kernel plans to use.
MaxReadahead
uint32
Flags
InitFlags
...
...
@@ -1165,7 +1167,7 @@ func (r *InitRequest) String() string {
// An InitResponse is the response to an InitRequest.
type
InitResponse
struct
{
Library
Protocol
Library
fusekernel
.
Protocol
// Maximum readahead in bytes that the kernel can use. Ignored if
// greater than InitRequest.MaxReadahead.
MaxReadahead
uint32
...
...
@@ -1287,7 +1289,7 @@ func unix(t time.Time) (sec uint64, nsec uint32) {
return
}
func
(
a
*
Attr
)
attr
(
out
*
attr
,
proto
Protocol
)
{
func
(
a
*
Attr
)
attr
(
out
*
attr
,
proto
fusekernel
.
Protocol
)
{
out
.
Ino
=
a
.
Inode
out
.
Size
=
a
.
Size
out
.
Blocks
=
a
.
Blocks
...
...
@@ -1325,7 +1327,7 @@ func (a *Attr) attr(out *attr, proto Protocol) {
out
.
Gid
=
a
.
Gid
out
.
Rdev
=
a
.
Rdev
out
.
SetFlags
(
a
.
Flags
)
if
proto
.
GE
(
Protocol
{
7
,
9
})
{
if
proto
.
GE
(
fusekernel
.
Protocol
{
7
,
9
})
{
out
.
Blksize
=
a
.
BlockSize
}
...
...
internal/fuseshim/options.go
View file @
f0fb8be9
...
...
@@ -3,6 +3,8 @@ package fuseshim
import
(
"errors"
"strings"
"github.com/jacobsa/fuse/internal/fusekernel"
)
func
dummyOption
(
conf
*
mountConfig
)
error
{
...
...
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