| CPC G06F 16/1873 (2019.01) [G06F 16/1774 (2019.01)] | 17 Claims |

|
1. A data storage method, comprising:
receiving, from a first client, a third lock request requesting to lock a first version of a first file;
locking the first version when the first file is not locked;
starting a lock timing of the first version of the first file;
updating a reference count of a file lock indicating that the first client has a lock on the first version;
sending, to the first client, a fourth lock response indicating that the first version is locked;
receiving, from a second client, a fourth lock request requesting to lock a second version of the first file;
sending a fifth lock response to the second client when the first version is locked and when the second version is the same as the first version, wherein the fifth lock response indicates that the first version is locked;
updating, when the second version is the same as the first version, the reference count of the file lock indicating that the second client has a lock on the first version;
updating, when the second version is the same as the first version, the lock timing of the first version of the first file to restart the lock timing based on an operation time in which the second client locks the first version of the first file;
receiving, from the first client, a first lock request requesting to lock a first data range of the first file, wherein the first data range indicates a data range for the first client to write data;
locking the first data range when the first data range is not locked;
sending, to the first client, a first lock response indicating that the first data range is locked;
receiving, from the second client, a second lock request requesting to lock a second data range of the first file;
when the second data range is not locked, locking the second data range, and sending, to the second client, a second lock response indicating that the second data range is locked; and
when identifying in the second data range requested by the second lock request a third data range that is already locked prior to the second lock request and a fourth data range that is not previously locked based on a previous lock request, locking the fourth data range, and sending, to the second client in response to locking the fourth data range, a third lock response comprising range information of the fourth data range and an indication that the fourth data range is locked.
|