Reputation: 821
I have implemented a fuse driver for cache management. I would like to give some hints from the application side to fuse driver using file system calls like open(2)
, e.g., sequential read pattern.
I thought I could use the flags
argument in open(2)
1 and thought it would be passed to the fuse handler 2. I have done some experiments and found the my custom bits are not shown in the fuse's .open
handler in the struct fuse_file_info *
.
I would like to know why but I failed to find any documentation about the flags validation/stripping rules in the linux kernel documentation and libuse documentation. Can anyone point me to the specification or related source code?
Besides, I'm wondering if passing custom (not specified in fcntl.h
) is not possible, is three other approaches where I can pass some hints from the application to the fuse handler?
Thanks in advance!
Upvotes: 0
Views: 402
Reputation: 767
What are the flags you've tried? because doc of open says:
Creation (O_CREAT, O_EXCL, O_NOCTTY) flags will be filtered out / handled by the kernel.
As for alternatives, the standard way for any file system, not necessarily fuse, would be a dedicated ioctl
. In case the hint is per file and not per specific opened descriptor, setxattr
is also an option.
Upvotes: 0