You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a filesystem implementation with this, rather nice, library!
The thing i'm stuck on is the concept of how to properly implement fsnotify support.
When i look at the two [1, 2] provided examples then the current way seems to be:
Run a filesystem update loop in a set interval (1 second)
Send filesystem updates in that loop
When you have a file that changes every second (like the examples demonstrate) then this logic probably works just fine.
But that's not a realistic scenario.
What i did find out, or i'm wrong, is that fsnotify events should be send outside the code path of where you create/update/delete files themselves to prevent deadlocks. So executing a create call immediately followed by an fsnotify notifier.inval_entry (notifier comes from the Session object) is a big no-no. Thus a serial approach of create -> notify event does not seem to be an option.
This makes me think/assume that i should:
Build a queue of filesystem events
Have a separate thread where that queue is read and send to the kernel
Is that the intended approach of fsnotify support?
If not, what is the intended approach?
For reference, i'm making a filesystem that essentially exposes external data (think of a web api) to a local filesystem. I'm receiving events from that external source which i need to map to fsnotify events.
Hi,
I'm working on a filesystem implementation with this, rather nice, library!
The thing i'm stuck on is the concept of how to properly implement fsnotify support.
When i look at the two [1, 2] provided examples then the current way seems to be:
When you have a file that changes every second (like the examples demonstrate) then this logic probably works just fine.
But that's not a realistic scenario.
What i did find out, or i'm wrong, is that fsnotify events should be send outside the code path of where you create/update/delete files themselves to prevent deadlocks. So executing a create call immediately followed by an fsnotify
notifier.inval_entry
(notifier
comes from theSession
object) is a big no-no. Thus a serial approach ofcreate -> notify event
does not seem to be an option.This makes me think/assume that i should:
Is that the intended approach of fsnotify support?
If not, what is the intended approach?
For reference, i'm making a filesystem that essentially exposes external data (think of a web api) to a local filesystem. I'm receiving events from that external source which i need to map to fsnotify events.
[1] https://github.com/cberner/fuser/blob/master/examples/notify_inval_entry.rs
[2] https://github.com/cberner/fuser/blob/master/examples/notify_inval_inode.rs
The text was updated successfully, but these errors were encountered: