From: Stef B. <st...@gm...> - 2010-06-01 15:09:09
|
I do not know it's possible, but I'm not an expert. It looks a bit like multi session mounts of cifs. Look at the website of cifs-utils and maillist. Maybe usefull. Stef 2010/5/30 Tomasz Jankowski <to...@gm...>: > Hello! > > I'm new to FUSE (and it's API) and I'm a bit confused about it. Want I want > to do is to implement simple network file system. One of main goals is to > handle each mounted resource (fuse mountpoint) in separated thread. However > I'm not sure how to set up FUSE library properly and handle I/O requests in > thread-safe way. > > Please verify my pseudo code: > > For each new shared folder I have to run: > > channel = fuse_mount(...); > > handle = fuse_new(channel, ...); > > > And then I can run a new thread: > > session = fuse_get_session(handle); > channel = fuse_session_next_chan(session); // According to API reference > fuse_session can handle only one channel now > buffer = malloc(fuse_chan_bufsize(channel)); > descriptor = fuse_chan_fd(channel); > while(fuse_session_exited(session) == 0) > { > > return_value = select(..., descriptor + TCP socket related to this > mountpoint, ...); > > if (return_calue > 0) > > { > > // Handle FUSE request > > fuse_chan_recv(channel,buffer,...); > > fuse_session_process(session, ...,buffer, ..., channel); > > // Handle other descriptors > ... > > } > > } > free(buffer) > fuse_session_exit(session); > fuse_umount(..., channel); > fuse_destroy(handle); > ------------------------------------------------------------------------------ > > _______________________________________________ > fuse-devel mailing list > fus...@li... > https://lists.sourceforge.net/lists/listinfo/fuse-devel > |