Shared locking for storage centric exclusive locks
AssigneeRed Hat Israel, Ltd.
InventorsAyal Baron, Federico Simoncelli, Eduardo Warszawski
Life of this patent
Estimating the term…
Abstract
A computing device receives a request from a host for a shared lock on a resource. The computing device obtains an exclusive lock on the resource using a locking data structure that is stored on the storage domain. The computing device subsequently obtains a shared lock on the resource for the host by writing a flag to the locking data structure, wherein the flag indicates that the host has the shared lock on the resource. The computing device then releases the exclusive lock on the resource.
Claims20
A method comprising:
- generating, by a processing device, a first locking data structure and a second locking data structure on a storage device accessed by a host over a network, the first locking data structure providing locks to one or more host identifiers and the second locking data structure providing locks to one or more resources;
- acquiring, by the processing device, a lock for the host to one of the host identifiers in response to the host modifying the first locking data structure;
- receiving, by the processing device, a request from the host for a shared lock on the resource;
- obtaining, by the processing device, an exclusive lock on the resource for the host using the second locking data structure;
- subsequently obtaining, by the processing device, the shared lock on the resource for the host by writing a flag to the second locking data structure, wherein the flag indicates the host that has the shared lock on the resource;
- and
- releasing the exclusive lock on the resource after obtaining the shared lock.
A non-transitory computer readable storage medium comprising instructions that, when executed by a processing device, cause the processing device to:
- generate, by the processing device, a first locking data structure and a second locking data structure on a storage device accessed by a host over a network, the first locking data structure providing locks to one or more host identifiers and the second locking data structure providing locks to one or more resources;
- acquire, by the processing device, a lock for the host to one of the host identifiers in response to the host modifying the first locking data structure;
- receive, by the processing device, a request from the host for a shared lock on the resource;
- obtain, by the processing device, an exclusive lock on the resource for the host using the second locking data structure;
- subsequently obtain, by the processing device, the shared lock on the resource for the host by writing a flag to the second locking data structure, wherein the flag indicates the host that has the shared lock on the resource;
- and
- release the exclusive lock on the resource after obtaining the shared lock.
An apparatus comprising:
- a memory;
- and
- a processing device operatively coupled to the memory, wherein the processing device is to:
- generate a first locking data structure and a second locking data structure on a storage device accessed by a host over a network, the first locking data structure providing locks to one or more host identifiers and the second locking data structure providing locks to one or more resources;
- acquire a lock for the host to one of the host identifiers in response to the host modifying the first locking data structure;
- receive a request from the host for a shared lock on the resource;
- obtain an exclusive lock on the resource for the host using the second locking data structure;
- subsequently obtain the shared lock on the resource for the host by writing a flag to the second locking data structure, wherein the flag indicates the host that has the shared lock on the resource, wherein the exclusive lock is a read-write lock that prevents other hosts from reading from or writing to the resource;
- and
- release the exclusive lock on the resource after obtaining the shared lock.
Dependencies are inferred from the claim text.