I tried to ask on FUSE's mailing list but I haven't received any response so far... I have a couple of questions. I'm going to implement a low-level FUSE file system and watch over fuse_chan
's descriptor with epoll.
I have to fake inodes for all objects in my file system right? Are there any rules about choosing inodes for objects in VFS (e.g. do I have to use only positive values or can I use values in some range)?
Can I make fuse_chan's descriptor
nonblocking? If yes, please tell me
whether I can assume that
fuse_chan_recv()
/fuse_chan_send()
will receive/send a whole request
structure, or do I have to override them
with functions handling partial send
and receive?
What about buffer size
? I see that
in fuse_loop()
a new buffer is
allocated for each call, so I assume
that the buffer size is not fixed.
However maybe there is some maximum
possible buffer size? I can then
allocate a larger buffer and reduce
memory allocation operations.
(1) Inodes are defined as unsigned integers, so in theory, you could use any values. However, since there could be programs which are not careful, I'd play it safe and only use non-zero, positive integers up to INT_MAX.
(2) Fuse uses a special kernel device. While fuse_chan_recv() do not support partial reads, this may not be required, as kernel should not return partial packets anyway.
(3) Filenames in Linux are max 4096 chars. This puts a limit on a buffer size:
$ grep PATH_MAX /usr/include/linux/limits.h
#define PATH_MAX 4096 /* # chars in a path name including nul */
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With