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
bd16024e
Commit
bd16024e
authored
Mar 30, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Plain Diff
Nailed down the semantics of ForgetInodeOp.
For #7.
parents
566fb55e
06bacc17
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
5 deletions
+35
-5
fuseops/ops.go
fuseops/ops.go
+35
-5
No files found.
fuseops/ops.go
View file @
bd16024e
...
@@ -128,6 +128,9 @@ type LookUpInodeOp struct {
...
@@ -128,6 +128,9 @@ type LookUpInodeOp struct {
Name
string
Name
string
// The resulting entry. Must be filled out by the file system.
// The resulting entry. Must be filled out by the file system.
//
// The lookup count for the inode is implicitly incremented. See notes on
// ForgetInodeOp for more information.
Entry
ChildInodeEntry
Entry
ChildInodeEntry
}
}
...
@@ -214,15 +217,36 @@ func (o *SetInodeAttributesOp) Respond(err error) {
...
@@ -214,15 +217,36 @@ func (o *SetInodeAttributesOp) Respond(err error) {
o
.
r
.
(
*
bazilfuse
.
SetattrRequest
)
.
Respond
(
&
resp
)
o
.
r
.
(
*
bazilfuse
.
SetattrRequest
)
.
Respond
(
&
resp
)
}
}
// Forget an inode ID previously issued (e.g. by LookUpInode or MkDir). The
// Decrement the reference count for an inode ID previously issued by the file
// kernel sends this when removing an inode from its internal caches.
// system.
//
// The comments for the ops that implicitly increment the reference
// count contain a note of this. For example, LookUpInodeOp and MkDirOp. The
// authoritative source is the libfuse documentation, which states that any op
// that returns fuse_reply_entry fuse_reply_create implicitly increments (cf.
// http://goo.gl/o5C7Dx).
//
// If the reference count hits zero, the file system can forget about that ID
// entirely, and even re-use it in future responses. The kernel guarantees that
// it will not otherwise use it again.
//
// The reference count corresponds to fuse_inode::nlookup
// (http://goo.gl/ut48S4). Some examples of where the kernel manipulates it:
//
// * (http://goo.gl/vPD9Oh) Any caller to fuse_iget increases the count.
// * (http://goo.gl/B6tTTC) fuse_lookup_name calls fuse_iget.
// * (http://goo.gl/IlcxWv) fuse_create_open calls fuse_iget.
// * (http://goo.gl/VQMQul) fuse_dentry_revalidate increments after
// revalidating.
//
type
ForgetInodeOp
struct
{
type
ForgetInodeOp
struct
{
commonOp
commonOp
// The inode to be forgotten. The kernel guarantees that the node ID will not
// The inode whose reference count should be decremented.
// be used in further calls to the file system (unless it is reissued by the
// file system).
ID
InodeID
ID
InodeID
// The amount to decrement the reference count.
N
int
}
}
func
(
o
*
ForgetInodeOp
)
Respond
(
err
error
)
{
func
(
o
*
ForgetInodeOp
)
Respond
(
err
error
)
{
...
@@ -257,6 +281,9 @@ type MkDirOp struct {
...
@@ -257,6 +281,9 @@ type MkDirOp struct {
Mode
os
.
FileMode
Mode
os
.
FileMode
// Set by the file system: information about the inode that was created.
// Set by the file system: information about the inode that was created.
//
// The lookup count for the inode is implicitly incremented. See notes on
// ForgetInodeOp for more information.
Entry
ChildInodeEntry
Entry
ChildInodeEntry
}
}
...
@@ -300,6 +327,9 @@ type CreateFileOp struct {
...
@@ -300,6 +327,9 @@ type CreateFileOp struct {
Flags
bazilfuse
.
OpenFlags
Flags
bazilfuse
.
OpenFlags
// Set by the file system: information about the inode that was created.
// Set by the file system: information about the inode that was created.
//
// The lookup count for the inode is implicitly incremented. See notes on
// ForgetInodeOp for more information.
Entry
ChildInodeEntry
Entry
ChildInodeEntry
// Set by the file system: an opaque ID that will be echoed in follow-up
// Set by the file system: an opaque ID that will be echoed in follow-up
...
...
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