Sunday, 15 July 2012

c - fuse: How do I get the size of the file that is going to be written before it's written? -


When a file is written, write with the function .write In fuses_operation is called for each file segment

This means that for a large file (for example 12720 bytes), the writing task is 4 times

  1 can be said size = 4096, offset = 0 2. size = 4096, offset = 4096.3 size = 4096, offset = 8192 4. size = 432, offset = 12288   

Because it has 4 segments, maximum segment 4096 bytes with size

Under the write function, I would like to determine when the last segment size is write n I intend to keep all segments in buffer , And to use this last written section to indicate that the buffer is now the whole object, so that it can be placed elsewhere (such as an object store). Knowing the size of the object to be written before writing, I can do just one simple parity test file_size == size + offset to determine when the last section is being written I am

Obviously, I can not After the handler closes, I can just insert the whole object elsewhere (such as an object store).

No comments:

Post a Comment