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
b3bdd01d
Commit
b3bdd01d
authored
Mar 18, 2012
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement BATCH_FORGET. Bump kernel interface to 7.16.
parent
72dbac68
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
176 additions
and
133 deletions
+176
-133
fuse/api.go
fuse/api.go
+1
-1
fuse/defaultraw.go
fuse/defaultraw.go
+1
-1
fuse/fsconnector.go
fuse/fsconnector.go
+0
-1
fuse/fsops.go
fuse/fsops.go
+3
-3
fuse/lockingfs.go
fuse/lockingfs.go
+2
-2
fuse/misc.go
fuse/misc.go
+1
-1
fuse/mount.go
fuse/mount.go
+1
-1
fuse/mountstate.go
fuse/mountstate.go
+2
-4
fuse/opcode.go
fuse/opcode.go
+147
-119
fuse/typeprint.go
fuse/typeprint.go
+8
-0
fuse/types.go
fuse/types.go
+10
-0
No files found.
fuse/api.go
View file @
b3bdd01d
...
...
@@ -248,7 +248,7 @@ type DefaultFile struct{}
// Include DefaultRawFileSystem to inherit a null implementation.
type
RawFileSystem
interface
{
Lookup
(
header
*
InHeader
,
name
string
)
(
out
*
EntryOut
,
status
Status
)
Forget
(
header
*
InHeader
,
input
*
ForgetIn
)
Forget
(
nodeid
,
nlookup
uint64
)
// Attributes.
GetAttr
(
header
*
InHeader
,
input
*
GetAttrIn
)
(
out
*
AttrOut
,
code
Status
)
...
...
fuse/defaultraw.go
View file @
b3bdd01d
...
...
@@ -11,7 +11,7 @@ func (me *DefaultRawFileSystem) Lookup(h *InHeader, name string) (out *EntryOut,
return
nil
,
ENOSYS
}
func
(
me
*
DefaultRawFileSystem
)
Forget
(
h
*
InHeader
,
input
*
ForgetIn
)
{
func
(
me
*
DefaultRawFileSystem
)
Forget
(
nodeID
,
nlookup
uint64
)
{
}
func
(
me
*
DefaultRawFileSystem
)
GetAttr
(
header
*
InHeader
,
input
*
GetAttrIn
)
(
out
*
AttrOut
,
code
Status
)
{
...
...
fuse/fsconnector.go
View file @
b3bdd01d
...
...
@@ -137,7 +137,6 @@ func (me *FileSystemConnector) forgetUpdate(node *Inode, forgetCount int) {
me
.
recursiveConsiderDropInode
(
node
)
}
// InodeCount returns the number of inodes registered with the kernel.
func
(
me
*
FileSystemConnector
)
InodeHandleCount
()
int
{
return
me
.
inodeMap
.
Count
()
...
...
fuse/fsops.go
View file @
b3bdd01d
...
...
@@ -73,9 +73,9 @@ func (me *FileSystemConnector) Lookup(header *InHeader, name string) (out *Entry
return
out
,
OK
}
func
(
me
*
FileSystemConnector
)
Forget
(
h
*
InHeader
,
input
*
ForgetIn
)
{
node
:=
me
.
toInode
(
h
.
NodeId
)
me
.
forgetUpdate
(
node
,
int
(
input
.
N
lookup
))
func
(
me
*
FileSystemConnector
)
Forget
(
nodeID
,
nlookup
uint64
)
{
node
:=
me
.
toInode
(
nodeID
)
me
.
forgetUpdate
(
node
,
int
(
n
lookup
))
}
func
(
me
*
FileSystemConnector
)
GetAttr
(
header
*
InHeader
,
input
*
GetAttrIn
)
(
out
*
AttrOut
,
code
Status
)
{
...
...
fuse/lockingfs.go
View file @
b3bdd01d
...
...
@@ -163,9 +163,9 @@ func (me *LockingRawFileSystem) Lookup(h *InHeader, name string) (out *EntryOut,
return
me
.
RawFileSystem
.
Lookup
(
h
,
name
)
}
func
(
me
*
LockingRawFileSystem
)
Forget
(
h
*
InHeader
,
input
*
ForgetIn
)
{
func
(
me
*
LockingRawFileSystem
)
Forget
(
nodeID
uint64
,
nlookup
uint64
)
{
defer
me
.
locked
()()
me
.
RawFileSystem
.
Forget
(
h
,
input
)
me
.
RawFileSystem
.
Forget
(
nodeID
,
nlookup
)
}
func
(
me
*
LockingRawFileSystem
)
GetAttr
(
header
*
InHeader
,
input
*
GetAttrIn
)
(
out
*
AttrOut
,
code
Status
)
{
...
...
fuse/misc.go
View file @
b3bdd01d
...
...
@@ -44,7 +44,7 @@ func ToStatus(err error) Status {
case
os
.
ErrInvalid
:
return
EINVAL
}
switch
t
:=
err
.
(
type
)
{
case
syscall
.
Errno
:
return
Status
(
t
)
...
...
fuse/mount.go
View file @
b3bdd01d
...
...
@@ -59,7 +59,7 @@ func mount(mountPoint string, options string) (f *os.File, finalMountPoint strin
if
err
!=
nil
{
return
}
w
,
err
:=
proc
.
Wait
()
if
err
!=
nil
{
return
...
...
fuse/mountstate.go
View file @
b3bdd01d
...
...
@@ -248,10 +248,8 @@ func (me *MountState) handleRequest(req *request) {
}
func
(
me
*
MountState
)
write
(
req
*
request
)
Status
{
// If we try to write OK, nil, we will get
// error: writer: Writev [[16 0 0 0 0 0 0 0 17 0 0 0 0 0 0 0]]
// failed, err: writev: no such file or directory
if
req
.
inHeader
.
opcode
==
_OP_FORGET
{
// Forget does not wait for reply.
if
req
.
inHeader
.
opcode
==
_OP_FORGET
||
req
.
inHeader
.
opcode
==
_OP_BATCH_FORGET
{
return
OK
}
...
...
fuse/opcode.go
View file @
b3bdd01d
This diff is collapsed.
Click to expand it.
fuse/typeprint.go
View file @
b3bdd01d
...
...
@@ -231,3 +231,11 @@ func (me *WithFlags) String() string {
me
.
File
,
me
.
Description
,
flagString
(
openFlagNames
,
int
(
me
.
OpenFlags
),
"O_RDONLY"
),
flagString
(
fuseOpenFlagNames
,
int
(
me
.
FuseFlags
),
""
))
}
func
(
me
*
ForgetIn
)
String
()
string
{
return
fmt
.
Sprintf
(
"{%d}"
,
me
.
Nlookup
)
}
func
(
me
*
BatchForgetIn
)
String
()
string
{
return
fmt
.
Sprintf
(
"{%d}"
,
me
.
Count
)
}
fuse/types.go
View file @
b3bdd01d
...
...
@@ -127,6 +127,16 @@ type ForgetIn struct {
Nlookup
uint64
}
type
ForgetOne
struct
{
NodeId
uint64
Nlookup
uint64
}
type
BatchForgetIn
struct
{
Count
uint32
Dummy
uint32
}
const
(
// Mask for GetAttrIn.Flags. If set, GetAttrIn has a file handle set.
FUSE_GETATTR_FH
=
(
1
<<
0
)
...
...
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