I am rewriting the example filesystem
fusexmp.c by changing the open, read, write
and release system calls.
I modified the open system call to store
the open descriptors in a hash table
and not to close them. So the read and
write system calls will use the descriptor
created by open.
But I am getting the following error:
when I typed cat fd.c
unique: 43, error: 0 (Success), outsize: 136
unique: 44, opcode: OPEN (14), nodeid: 22, insize: 48
OPEN : /root/fd.c //MY PRINTF for debug purposes
Thanks in advance
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
sankar raman wrote:
> But I am getting the following error:
> when I typed cat fd.c
If you use the version 2.2 or above of the interface (as fusexmp distributed
with the latest version of fuse does), open has an additional argument,
with type struct fuse file info *, and in its "fh" field you can store your
handle. A struct of the same type, with the fh field filled with the value
that you provided in open(), will be returned to each read(), write() ecc.
call made from the process which performed the open() call.
However, this will not reuse open files on a per-path basis (which is not
posix-compliant, but you might be interest in doing things that way) - to
do that you have to use an hashtable as you are in fact doing. At this
point, the segfault might be caused by not properly locking the hashtable,
because fuse is multithreaded by default, i.e. there can be a different
thread for each request. Try to use the "-s" option to fusexmp, and see if
the error disappears, or post your code here for more advice.
Please note that I do not read the e-mail address used in the from field but
I read vincenzo_ml at yahoo dot it
Attenzione: non leggo l'indirizzo di posta usato nel campo from, ma leggo
vincenzo_ml at yahoo dot it