Protocols for locking sharable files and methods for carrying out the protocols
First Claim
1. A method for locking a file, the method comprising:
- checking for open instances of the file;
determining whether open instances have a bit of a bitmap associated with the open instances set to true;
if no open instance has the bit set to true, the method includes, setting an exclusive bit in a bitmap of the file to true to prevent another open of the file;
setting the exclusive bit in each bitmap of the open instances to true to prevent another open of the file;
whereby the setting of the exclusive bit in each bitmap of the open instances to true has the effect of locking the instances of the file while still enabling access to the file that initiated the setting of the exclusive bit; and
if an open instance does have the bit set to true, the setting of the exclusive bit in a bitmap of the file to true will fail, thus preventing locking of the file.
1 Assignment
0 Petitions
Accused Products
Abstract
Methods for locking a file managed by a file system are provided. One example, a file consistency protocol is associated with an operating system (O/S). The file consistency protocol is configured to maintain file consistency between instances of the file associated with the file system using a set of file consistency protocol bits. The method includes determining whether any instance of the file is open, and if no instance of the file is open, the method further includes setting an exclusive bit of the file, the exclusive bit being one of the set of file consistency protocol bits. The setting of the exclusive bit is configured to lock the file from being accessed as another instance.
-
Citations
14 Claims
-
1. A method for locking a file, the method comprising:
-
checking for open instances of the file;
determining whether open instances have a bit of a bitmap associated with the open instances set to true;
if no open instance has the bit set to true, the method includes, setting an exclusive bit in a bitmap of the file to true to prevent another open of the file;
setting the exclusive bit in each bitmap of the open instances to true to prevent another open of the file;
whereby the setting of the exclusive bit in each bitmap of the open instances to true has the effect of locking the instances of the file while still enabling access to the file that initiated the setting of the exclusive bit; and
if an open instance does have the bit set to true, the setting of the exclusive bit in a bitmap of the file to true will fail, thus preventing locking of the file. - View Dependent Claims (2, 3, 4, 5, 6)
modifying the file while the file has its exclusive bit set to true;
closing the file; and
resetting the exclusive bit to false.
-
-
5. A method for locking a file as recited in claim 4, further comprising:
-
setting the “
M”
bit for the file to true;
determining if there are open instances of the file; and
setting the “
I”
bit to true in any other open instances of the file.
-
-
6. A method for locking a file as recited in claim 5, further comprising:
-
updating any of the open instances having the “
I”
bit set to true with the modification; and
resetting the “
M”
bit of the file to false and the “
I”
bit of any of the open instances to false upon incorporation of the modification to the instances.
-
-
7. A method for locking a file managed by a file system, the method comprising:
-
associating a file consistency protocol with an operating system (O/S), the file consistency protocol maintaining file consistency between instances of the file associated with the file system using a set of file consistency protocol bits;
determining whether any instance of the file is open;
if no instance of the file is open, the method includes, setting an exclusive bit of the set of file consistency protocol bits, the setting of the exclusive bit being configured to lock the file from being accessed as another instance; and
if an instance of the file is open, the setting of the exclusive bit of the set of file consistency protocol bits will fail, thus preventing locking of the file. - View Dependent Claims (8, 9, 10)
changing one of data and attributes of the file while the exclusive bit is set;
resetting the exclusive bit; and
closing the file.
-
-
9. A method for locking a file managed by a file system as recited in claim 8, further comprising:
-
determining whether an instance of the file has been opened since the close of the file;
setting a modified bit for the file, the modified bit being indicative of the change to the file; and
setting an invalid bit for the instance opened since the last close.
-
-
10. A method for locking a file managed by a file system as recited in claim 9, further comprising:
-
communicating the change to the instance;
resetting the invalid bit at the instance; and
resetting the modified bit at the file.
-
-
11. A method for locking a file managed by a file system, the method comprising:
-
determining whether another instance of the file is open;
if no other instance of the file is open, the method includes, setting an exclusive bit for the file, the setting of the exclusive bit being configured to lock the file from being accessed as another instance; and
if an instance of the file is open, the setting of the exclusive bit will fail, thus preventing locking of the file. - View Dependent Claims (12, 13, 14)
changing one of data and attributes of the file while the exclusive bit is set; and
resetting the exclusive bit; and
closing the file.
-
-
13. A method for locking a file managed by a file system as recited in claim 12, further comprising:
-
determining whether another instance of the file has been opened since the close of the file;
setting a modified bit for the file, the modified bit being indicative of the change to the file; and
setting an invalid bit for the instance opened since the last close of the file having the exclusive bit set.
-
-
14. A method for locking a file managed by a file system as recited in claim 11, wherein the file is associated with a bitmap of bits, the bitmap of bits include a modify indicator bit, an attribute indicator bit, an exclusive indicator bit, a shared indicator bit, and an invalid indicator bit.
Specification