From: Nikolaus R. <Nik...@ra...> - 2017-09-15 14:15:28
|
On Sep 15 2017, Ian van der Neut <iv...@gm...> wrote: > in implementing my VFS I am running into an issue that seems to be that the > getattr() returns the attributes of a file, but in between returning from > getattr and the open() callback being called, the file's attributes (size) > and perhaps content have changed. This causes the client to read the newer > file, but using the size of the older one, causing corruption in binary > files and missing data in ascii files. Now in my back end system it is > still possible to get to the file that the getattr() returned the > attributes of (there is some automatic version control going on), so I > would like to have the subsequent open() return that file as well. > > For this it is needed to store a fileID through which I can lookup the file > in the back end database during the getattr() call so the open() call can > then access the file on the back end directly through its ID in the > database rather than just get the latest file that is stored on the path > determined from the path argument in the call to open. If you are using the low level API, you can simply assign different inodes to the different versions of the file. With the high-level API, I think you are out of luck. Best, -Nikolaus -- GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F »Time flies like an arrow, fruit flies like a Banana.« |