From: maciver <ro...@gm...> - 2013-01-11 07:34:10
|
With lots of support regarding FUSE (Filesystem in Userspace) with high level operations classified in fuse_operations Struct, together with it is tons of examples that relates how fuse_operations works. However, what I am trying to achieve required the use of: void(* lookup )(fuse_req_t req, fuse_ino_t parent, const char *name) void(* mknod )(fuse_req_t req, fuse_ino_t parent, const char *name, mode_t mode, dev_t rdev) in fuse_lowlevel_ops Struct. I am not trying to the change the function of this two method, but just to intercept the meta data that passes through and store them in a cache. >From sample traces, for a new file creation, I see that LOOKUP() is always called first to identify if a file node exist, if it does, it will be returned. Else ERROR will be returned and MKNOD() will be called to create the file node then OPEN() and so on. So what I am trying to achieve is to have my filesystem maintaining a cache record. MKNOD will continue to do it normal operation while I'll just intercept the meta data record and store it in my cache. When LOOKUP is called for file node lookup, I'll check with my cache to see if it is available, if it is, I'll return. Else it will go on to check using it normal operation. Now the problem is, I couldn't find any documentation regarding the implementation of low-level MKNOD() where file nodes are created and LOOKUP() where file nodes are retrieved. So when the function call is passed from VFS to my mounted filesystem, I am not sure where I should create my file node to (based on normal filesystem operation). And what are the conditions to meet. I will be glad if someone can direct me to the correct direction and established examples that I can refer to. Thanks. -- View this message in context: http://old.nabble.com/Intercepting-regular-low-level-mknod-operations-in-FUSE-tp34886596p34886596.html Sent from the Fuse - Dev mailing list archive at Nabble.com. |