remote file system

Novgorodsky, Sergey sergeynovgorodsky at InSiteOne.com
Wed Oct 4 00:44:55 GMT 2006


Hi,

I'm working on a software which is using Samba server to receive files for a long-term storage.
The files are replicated to a remote host(I have a separate program that does that); local file system has size limits and  some local files are periodically deleted to free up the space. 
When user makes request to my Samba server to read back some files, I need to check if they are still stored locally and if not, fetch them  from a remote location, after that Samba can work as usual.

My question is - what is the best way to handle read requests in such system ?
Specifically, calls like SMB_VFS_OPENDIR and SMB_VFS_OPEN?
I can write a VFS module and provide my SMB_VFS_OPEN function which will check the file location and send request to remote host to retrieve a file. I understand I'll have to block till file arrives and then do something like
"return SMB_VFS_NEXT_OPEN(...)" ?
What about SMB_VFS_OPENDIR? I don't want to fetch all the the remote files every time I get this request...
Can I somehow make up the SMB_STRUCT_DIR structure to return from OPENDIR without actually copying 
the remote files?

Any suggestions?

Thank you in advance,
Sergey Novgorodsky



More information about the samba-technical mailing list