Commit c29cdc95 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fuse: clarify the calling convention for entry/delete notify.

parent 0937d8d2
...@@ -392,7 +392,8 @@ func (c *FileSystemConnector) FileNotify(node *Inode, off int64, length int64) f ...@@ -392,7 +392,8 @@ func (c *FileSystemConnector) FileNotify(node *Inode, off int64, length int64) f
// EntryNotify makes the kernel forget the entry data from the given // EntryNotify makes the kernel forget the entry data from the given
// name from a directory. After this call, the kernel will issue a // name from a directory. After this call, the kernel will issue a
// new lookup request for the given name when necessary. // new lookup request for the given name when necessary. No filesystem
// related locks should be held when calling this.
func (c *FileSystemConnector) EntryNotify(node *Inode, name string) fuse.Status { func (c *FileSystemConnector) EntryNotify(node *Inode, name string) fuse.Status {
var nId uint64 var nId uint64
if node == c.rootNode { if node == c.rootNode {
...@@ -408,7 +409,8 @@ func (c *FileSystemConnector) EntryNotify(node *Inode, name string) fuse.Status ...@@ -408,7 +409,8 @@ func (c *FileSystemConnector) EntryNotify(node *Inode, name string) fuse.Status
} }
// DeleteNotify signals to the kernel that the named entry in dir for // DeleteNotify signals to the kernel that the named entry in dir for
// the child disappeared. // the child disappeared. No filesystem related locks should be held
// when calling this.
func (c *FileSystemConnector) DeleteNotify(dir *Inode, child *Inode, name string) fuse.Status { func (c *FileSystemConnector) DeleteNotify(dir *Inode, child *Inode, name string) fuse.Status {
var nId uint64 var nId uint64
......
...@@ -401,7 +401,8 @@ func (ms *Server) InodeNotify(node uint64, off int64, length int64) Status { ...@@ -401,7 +401,8 @@ func (ms *Server) InodeNotify(node uint64, off int64, length int64) Status {
// DeleteNotify notifies the kernel that an entry is removed from a // DeleteNotify notifies the kernel that an entry is removed from a
// directory. In many cases, this is equivalent to EntryNotify, // directory. In many cases, this is equivalent to EntryNotify,
// except when the directory is in use, eg. as working directory of // except when the directory is in use, eg. as working directory of
// some process. // some process. You should not hold any FUSE filesystem locks, as that
// can lead to deadlock.
func (ms *Server) DeleteNotify(parent uint64, child uint64, name string) Status { func (ms *Server) DeleteNotify(parent uint64, child uint64, name string) Status {
if ms.kernelSettings.Minor < 18 { if ms.kernelSettings.Minor < 18 {
return ms.EntryNotify(parent, name) return ms.EntryNotify(parent, name)
...@@ -440,7 +441,8 @@ func (ms *Server) DeleteNotify(parent uint64, child uint64, name string) Status ...@@ -440,7 +441,8 @@ func (ms *Server) DeleteNotify(parent uint64, child uint64, name string) Status
} }
// EntryNotify should be used if the existence status of an entry // EntryNotify should be used if the existence status of an entry
// within a directory changes. // within a directory changes. You should not hold any FUSE filesystem
// locks, as that can lead to deadlock.
func (ms *Server) EntryNotify(parent uint64, name string) Status { func (ms *Server) EntryNotify(parent uint64, name string) Status {
req := request{ req := request{
inHeader: &InHeader{ inHeader: &InHeader{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment