On Sun, Jul 30, 2006, Keith Bennett wrote: > Oh right, now I get it. Our problem is that things like taglib > and the rid generation code need to be passed a filename, which > we don't have since we are only given raw data. > However, lkarmafs itself provides a virtual filename which could > be passed to these function calls instead. > Very cunning. > > Well, we have most of the pathname because it is passed to us > by FUSE. The only thing that is missing is the mountpoint. > I couldnt find any sensible way of getting that via fuse > either. But we can cheat. The mountpoint is passed in as one > of the initial arguments. We just need to determine which one > it is and then store it somewhere for later use. > Bingo. Problem solved. > No messy temporary files. > No distinction between USB and ethernet.
Nope. That doesn't work either. FUSE doesn't add the entry to the filetable until after the release() call has completed. One possible workaround is to add the file to a "properties need updating" list and do the work next time a call is made and/or when destroy() is called. I think that this is even more of a hack than the temporary file method, though. I propose that we just bite the bullet and write the whole file to /dev/shm (with /tmp as fallback) when the ethernet device is in use. To this end, I think that three calls to libkarma need to be added. The first call is lk_rio_can_write_props(karma) which will return zero if the ethernet device is in use and non-zero for USB. If zero is returned then we know that a temporary file is required. The second call is lk_rio_write_props(karma, fid). Internally, this will generate the properties based on the fids0/_00???/??0 file, but lkarmafs need not be aware of this. It will return zero on a successful USB write and a non-zero value if the ethernet device is in use or the USB write failed. Finally, a lk_rio_write_props_file(karma, fid, filename) call which will generate the properties based on the given filename (ie. /dev/shm/whatever). As you mentioned before, the temporary file will need to be passed around with the fuse_file_info structure. Acceptable? Keith. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ linux-karma-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-karma-devel
