Implement CAS writes
From now on, reads will return the server-side object version numbers and writes and deletes will have an additional "version" parameter which, if set to a non-zero value, will be atomically compared with the current version of the object plus 1 and the modification will fail if it doesn't match. This feature opens the road to correct online flattening of snapshot layers and other interesting things.
This commit is contained in:
@@ -31,6 +31,9 @@ struct cluster_op_t
|
||||
uint64_t inode;
|
||||
uint64_t offset;
|
||||
uint64_t len;
|
||||
// for reads and writes within a single object (stripe),
|
||||
// reads can return current version and writes can use "CAS" semantics
|
||||
uint64_t version = 0;
|
||||
int retval;
|
||||
osd_op_buf_list_t iov;
|
||||
std::function<void(cluster_op_t*)> callback;
|
||||
|
||||
Reference in New Issue
Block a user