Copy on write file system consistency and block usage
First Claim
1. A method for recording a plurality of data about a plurality of blocks of data stored in a storage system, comprising the step of maintaining multiple usage bits for each of said plurality of blocks;
- wherein one bit of said multiple usage bits for each of said plurality of blocks indicates a block'"'"'s membership in an active file system and plural bits of said multiple usage bits for each of said plurality of blocks indicate membership in plural read-only copies of a file system; and
wherein said multiple usage bits for each of said plurality of blocks are maintained in said active file system.
0 Assignments
0 Petitions
Accused Products
Abstract
The present invention provides a method for keeping a file system in a consistent state and for creating read-only copies of a file system. Changes to the file system are tightly controlled. The file system progresses from one self-consistent state to another self-consistent state. The set of self-consistent blocks on disk that is rooted by the root inode is referred to as a consistency point. To implement consistency points, new data is written to unallocated blocks on disk. A new consistency point occurs when the fsinfo block is updated by writing a new root inode for the inode file into it. Thus, as long as the root inode is not updated, the state of the file system represented on disk does not change. The present invention also creates snapshots that are read-only copies of the file system. A snapshot uses no disk space when it is initially created. It is designed so that many different snapshots can be created for the same file system. Unlike prior art file systems that create a clone by duplicating the entire inode file and all of the indirect blocks, the present invention duplicates only the inode that describes the inode file. A multi-bit free-block map file is used to prevent data from being overwritten on disk.
154 Citations
22 Claims
-
1. A method for recording a plurality of data about a plurality of blocks of data stored in a storage system, comprising the step of maintaining multiple usage bits for each of said plurality of blocks;
-
wherein one bit of said multiple usage bits for each of said plurality of blocks indicates a block'"'"'s membership in an active file system and plural bits of said multiple usage bits for each of said plurality of blocks indicate membership in plural read-only copies of a file system; and
wherein said multiple usage bits for each of said plurality of blocks are maintained in said active file system. - View Dependent Claims (2)
-
-
3. A method for generating a consistency point for a storage system, comprising the steps of:
-
marking a plurality of inodes pointing to a plurality of modified blocks in a file system stored on said storage system as being in a consistency point;
flushing regular files to said storage system;
flushing special files to said storage system;
flushing at least one block of file system information to said storage system; and
queuing dirty inodes after said step of marking and before said step of flushing at least one block of file system information;
wherein said step of flushing said special files to said storage system further comprises the steps of;
pre-flushing an inode for a blockmap file to an inode file;
allocating space on said storage system for all dirty blocks in said inode and said blockmap files;
flushing said inode for said blockmap file again updating a plurality of entries in said blockmap file wherein each entry of said plurality of entries represents a block in said storage system; and
writing all dirty blocks in said blockmap file and said inode file to said storage system.
-
-
4. A method of maintaining data in a storage system, comprising the steps of:
-
maintaining a root inode and inodes for a file system in the storage system, the root inode pointing directly or indirectly to the inodes, and each inode storing file data, pointing to one or more blocks in the storage system that store file data, or pointing to other inodes, with different levels of indirection possible for the inodes to point to the blocks; and
maintaining an inode map and a block map for the file;
wherein when said inodes are maintained in the storage system, each inode only points to blocks in the storage system having a same level of indirection as other blocks pointed to by that inode. - View Dependent Claims (5, 6, 7)
-
-
8. A memory storing information including instructions, the instructions executable by a processor to record a plurality of data about a plurality of blocks of data stored in a storage system, the instructions comprising the step of maintaining multiple usage bits for each of said plurality of blocks;
-
wherein one bit of said multiple usage bits for each of said plurality of blocks indicates a block'"'"'s membership in an active file system and plural bits of said multiple usage bits for each of said plurality of blocks indicate membership in plural read-only copies of a file system; and
wherein said multiple usage bits for each of said plurality of blocks are maintained in said active file system. - View Dependent Claims (9)
-
-
10. A memory storing information including instructions, the instructions executable by a processor to generate a consistency point for a storage system, the instructions comprising the steps of:
-
marking a plurality of inodes pointing to a plurality of modified blocks in a file system stored on said storage system as being in a consistency point;
flushing regular files to said storage system;
flushing special files to said storage system;
flushing at least one block of file system information to said storage system;
sandqueuing dirty inodes after said step of marking and before said step of flushing at least one block of file system information;
wherein said step of flushing said special files to said storage system further comprises the steps of;
pre-flushing, an inode for a blockmap file to an inode file;
allocating space on said storage system for all dirty blocks in said mode and said blockmap files;
flushing said inode for said blockmap file again;
updating a plurality of entries in said blockmap file wherein each entry of said plurality of entries represents a block in said storage system; and
writing all dirty blocks in said blockmap file and said inode file to said storage system.
-
-
11. A memory storing information including instructions, the instructions executable by a processor to maintain data in a storage system, the instructions comprising the steps of:
-
maintaining a root inode mode and inodes for a file system in the storage system, the root inode pointing directly or indirectly to the inodes, and each inode storing file data, pointing to one or more blocks in the storage system that store file data, or pointing to other inodes, with different levels of indirection possible for the anodes to point to the blocks; and
maintaining an inode map and a block map for the file system;
wherein when said inodes are maintained in the storage system, each inode only points to blocks in the storage system having a same level of indirection as other blocks pointed to by that inode. - View Dependent Claims (12, 13, 14)
-
-
15. A system comprising:
-
a processor;
a storage system; and
a memory storing information including instructions, the instructions executable by the processor to record a plurality of data about a plurality of blocks of data stored in the storage system, the instructions comprising step of maintaining multiple usage bits for each of said plurality of blocks;
wherein one bit of said multiple usage bits for each of said plurality of blocks indicates a block'"'"'s membership in an active file system and plural bits of said multiple usage bits for each of said plurality of blocks indicate membership in plural read-only copies of a file system; and
wherein said multiple usage bits for each of said plurality of blocks are maintained in said active file system. - View Dependent Claims (16)
-
-
17. A system comprising:
-
a processor;
a storage system; and
a memory storing information including instruction, the instructions executable by the processor to generate a consistency point for the storage system, the instructions comprising the steps of;
(a) marking a plurality of inodes pointing to a plurality of modified blocks in a file system stored on said storage system as being in a consistency point;
(b) flushing regular files to said storage system;
(c) flushing special files to said storage system;
(d) flushing at least one block of file system information to said storage system; and
(e) queuing dirty inodes after said step of marking and before said step of flushing at last one block of file system information; and
wherein said step of flushing said special files to said storage system further comprises the steps of;
(f) pre-flushing an inode for a blockmap file to an inode file;
(g) allocating space on said storage system for all dirty blocks in said inode and said blockmap files;
(h) flushing said inode for said blockmap file again;
(i) updating a plurality of entries in said blockmap file wherein each entry of said plurality of entries represents a block in said storage system; and
(j) writing all dirty blocks in said blockmap file and said inode file to said storage system.
-
-
18. A system comprising:
-
a processor;
a storage system; and
a memory storing information including instructions, the instructions executable by the processor to maintain data in the storage system, the instructions comprising the steps of;
(a) maintaining a root inode and inodes for a file system in the storage system, the root inode pointing directly or indirectly to the inodes, and each inode storing file data, pointing to one or more blocks in the storage system that store file data, or pointing to other inodes, with different levels of indirection possible for the inodes to point to the blocks; and
(b) maintaining an inode map and a block map for the file system;
wherein when said inodes are maintained in the storage system, each inode only points to blocks in the storage system having a same level of indirection as other blocks pointed to by that inode. - View Dependent Claims (19, 20, 21)
-
-
22. A system for maintaining data in storage means, comprising:
-
means for maintaining a root inode and inodes for a file system in the storage systems, the root inode pointing to inodes, and each inode storing file data, pointing to one or more blocks in the storage means that store file data, or pointing to other inodes; and
means for maintaining an inode map and a block map for the file system;
wherein when said inodes are maintained in the storage system, each inode only points to blocks having a same level of indirection as other blocks pointed to by that inode.
-
Specification