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
f89cd0c4
Commit
f89cd0c4
authored
Aug 19, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove incorrect TestInodeNotifyRemoval() test.
parent
1e311fd7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
31 deletions
+13
-31
fuse/api.go
fuse/api.go
+9
-2
fuse/notify_test.go
fuse/notify_test.go
+4
-29
No files found.
fuse/api.go
View file @
f89cd0c4
...
...
@@ -183,8 +183,15 @@ type DefaultRawFileSystem struct{}
// Talk back to FUSE.
//
// TODO - implement EntryNotify. Currently, EntryNotify causes a
// kernel error.
// InodeNotify invalidates the information associated with the inode
// (ie. data cache, attributes, etc.)
//
// EntryNotify should be used if the existence status of an entry changes,
// (ie. to notify of creation or deletion of the file).
//
// Somewhat confusingly, InodeNotify for a file that stopped to exist
// will give the correct result for Lstat (ENOENT), but the kernel
// will still issue file Open() on the inode.
type
RawFsInit
struct
{
InodeNotify
func
(
*
NotifyInvalInodeOut
)
Status
EntryNotify
func
(
parent
uint64
,
name
string
)
Status
...
...
fuse/notify_test.go
View file @
f89cd0c4
...
...
@@ -27,6 +27,10 @@ func (me *NotifyFs) GetAttr(name string) (*os.FileInfo, Status) {
return
nil
,
ENOENT
}
func
(
me
*
NotifyFs
)
Open
(
name
string
,
f
uint32
)
(
File
,
Status
)
{
return
NewReadOnlyFile
([]
byte
{
42
}),
OK
}
type
NotifyTest
struct
{
fs
*
NotifyFs
connector
*
FileSystemConnector
...
...
@@ -94,35 +98,6 @@ func TestInodeNotify(t *testing.T) {
}
}
func
TestInodeNotifyRemoval
(
t
*
testing
.
T
)
{
test
:=
NewNotifyTest
()
defer
test
.
Clean
()
fs
:=
test
.
fs
dir
:=
test
.
dir
fs
.
exist
=
true
fi
,
err
:=
os
.
Lstat
(
dir
+
"/dir/file"
)
CheckSuccess
(
err
)
if
!
fi
.
IsRegular
()
{
t
.
Error
(
"IsRegular"
,
fi
)
}
fs
.
exist
=
false
fi
,
err
=
os
.
Lstat
(
dir
+
"/dir/file"
)
CheckSuccess
(
err
)
code
:=
test
.
connector
.
FileNotify
(
"dir/file"
,
-
1
,
0
)
if
!
code
.
Ok
()
{
t
.
Error
(
code
)
}
fi
,
err
=
os
.
Lstat
(
dir
+
"/dir/file"
)
if
fi
!=
nil
{
t
.
Error
(
"should have been removed"
,
fi
)
}
}
func
TestEntryNotify
(
t
*
testing
.
T
)
{
test
:=
NewNotifyTest
()
defer
test
.
Clean
()
...
...
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