Closed skypodolsky closed 1 year ago
So the tests have demonstrated that the amount of data that needs to be written cannot be estimated in cow_sync_and_close
. Hence, I decided to write some predefined amount of data. I suppose that 4 MB should be enough for that.
Main changes:
real_fallocate
function (the one that actually makes allocation fast)Explanation on the last one: this covers the case when the module is removed in the dormant state. In such a case, the direct write to the COW file takes place to write the rest of bio requests which have not been processed yet. However, it may (and likely will) happen that the COW file extents, which are being used for the direct write, aren't initialized by the FS. Hence, if we simply write there, there's no chance this data will be available at the next volume mount. To make this possible, we write some data ahead to ensure the extent is valid during the direct write operation.
Closes #260