Control of concurrent access to a partitioned data file
AssigneeXilinx, Inc.
InventorEmil S. Ochotta
Life of this patent
Estimating the term…
Abstract
Method and apparatus for controlling concurrent access to a data file. The data file is organized into a plurality of partitions, and a lock file that is accessible to the client applications is persistently stored. The lock file includes lock objects that correspond to the plurality of partitions, and each lock object indicates a lock status of the corresponding partition. The client applications perform an atomic file system operation on a persistent file system object when exclusive access is sought to the lock file. Successful completion of the atomic file system operation indicates that a client application has exclusive control over the lock file, and the lock file may thereafter be updated, the atomic operation undone, and access made to a selected partition.
Claims14
A computer-implemented method for controlling access to a data file that is shared amongst a plurality of client applications, comprising:
- organizing the data file into a plurality of partitions;
- persistently storing a lock file that is accessible to the plurality of client applications, the lock file including lock objects corresponding to the plurality of partitions and each lock object indicating a lock status of a corresponding partition of the plurality of partitions;
- a client application of the plurality of client applications attempting to perform a first atomic file system operation on a persistent file system object when the client application seeks exclusive access to the lock file;
- wherein the first atomic file system operation is to create a predetermined file system object and indicates an attempt to obtain a semaphore used to control exclusive access to the lock file, and each of the plurality of clients is configured to create the predetermined file system object for seeking to obtain the semaphore;
- and
- if the first atomic file system operation is successful, the client application testing the lock status of a lock object that corresponds to a selected partition of the plurality of partitions, and responsive to the lock status being compatible with access sought to the selected partition, updating the lock status, whereby the selected partition is designated as locked, deleting the predetermined file system object after updating the lock object, and accessing the selected partition, and responsive to the lock status being incompatible with the access sought deleting the predetermined file system object and refraining from updating the lock status and from accessing the selected partition;
- and
- wherein the first atomic file system operation being successful indicates that the client application obtained the semaphore, and deleting the predetermined file system object releases the semaphore;
- and
- in response to the first atomic file system operation being unsuccessful, the client application selecting an alternative operation to the updating of the lock status.
An apparatus for controlling access to a data file that is shared amongst a plurality of client applications, comprising:
- means for organizing the data file into a plurality of partitions;
- means for persistently storing a lock file that is accessible to the client applications, the lock file including lock objects corresponding to the plurality of partitions and each lock object indicating a lock status of the corresponding partition;
- a client application of the plurality of client applications including means for attempting to perform a first atomic file system operation on a persistent file system object when the client application seeks exclusive access to the lock file;
- wherein the first atomic file system operation is to create a predetermined file system object and indicates an attempt to obtain a semaphore used to control exclusive access to the lock file, and each of the plurality of clients is configured to create the predetermined file system object for seeking to obtain the semaphore;
- the client application further including means for, if the atomic file system operation is successful, testing the lock status of a lock object that corresponds to a selected partition of the plurality of partitions, and responsive to the lock status being compatible with access sought to the selected partition updating the lock status whereby the selected partition is designated as locked, deleting the predetermined file system object after updating the lock object, and accessing the selected partition, and responsive to the lock status being incompatible with the access sought deleting the predetermined file system object and refraining from updating the lock status and from accessing the selected partition;
- and
- wherein the first atomic file system operation being successful indicates that the client application obtained the semaphore, and deleting the predetermined file system object releases the semaphore;
- and
- the client application further including means, responsive to the first atomic file system operation being unsuccessful, for selecting an alternative operation to the updating of the lock status.
An article of manufacture, comprising:
- a computer-readable storage medium configured with instructions for causing a computer to perform the steps of,
- organizing the data file into a plurality of partitions;
- persistently storing a lock file that is accessible to the client applications, the lock file including lock objects corresponding to the plurality of partitions and each lock object indicating a lock status of the corresponding partition;
- each client application attempting to perform a first atomic file system operation on a persistent file system object when the client application seeks exclusive access to the lock file;
- wherein the first atomic file system operation is to create a predetermined file system object and indicates an attempt to obtain a semaphore used to control exclusive access to the lock file, and each of the plurality of clients is configured to create the predetermined file system object for seeking to obtain the semaphore;
- and
- if the atomic file system operation is successful, the client application testing the lock status of a lock object that corresponds to a selected partition of the plurality of partitions, and responsive to the lock status being compatible with access sought to the selected partition, updating the lock status whereby the selected partition is designated as locked, deleting the predetermined file system object after updating the lock object, and accessing the selected partition, and responsive to the lock status being incompatible with the access sought deleting the predetermined file system object and refraining from updating the lock status and from accessing the selected partition;
- and
- wherein the first atomic file system operation being successful indicates that the client application obtained the semaphore, and deleting the predetermined file system object releases the semaphore;
- and
- in response to the first atomic file system operation being unsuccessful, the client application selecting an alternative operation to the updating of the lock status.
Dependencies are inferred from the claim text.