Claims
- 1. A method for providing a file system snapshot, comprising:
generating a snapshot dataset for a source file in a file system, wherein the snapshot dataset is substantially empty; and copying to a shadow inode in the snapshot dataset an inode corresponding to the source file, when only metadata of the source file is modified, wherein a disk address of a data block corresponding to the source file is not copied to the shadow inode.
- 2. The method of claim 1, further comprising:
copying to the shadow inode in the snapshot dataset the inode corresponding to the source file, when the data block corresponding to the source file is only appended, wherein the disk address of the data block corresponding to the source file is not copied to the shadow inode.
- 3. The method of claim 2, further comprising:
copying to the shadow inode in the snapshot dataset the inode corresponding to the source file and copying to the snapshot dataset the data block corresponding to the source file, when the data block corresponding to the source file is overwritten or deleted, wherein the shadow inode includes a disk address of the data block which was written in the snapshot dataset.
- 4. The method of claim 3, further comprising:
accessing a shadow inode corresponding to a source file; determining whether the shadow inode includes a disk address, wherein if the shadow inode includes a disk address, then reading a data block referenced by the disk address; and wherein if the shadow inode does not include a disk address, then retrieving an inode of the source file and retrieving a data block referenced by a disk address in the inode of the source file.
- 5. The method of claim 3, further comprising:
copying to the shadow inode in the snapshot dataset the inode corresponding to the source file and copying to the snapshot dataset an indirect block corresponding to the source file and at least one data block corresponding to the source file, when at least one of the data blocks corresponding to the source file are overwritten or deleted, wherein the shadow inode includes a disk address of the indirect block which was written in the snapshot dataset and wherein the indirect block includes a disk address of at least one data block which was written in the snapshot dataset.
- 6. The method of claim 5, further comprising:
accessing a shadow inode corresponding to a source file; determining whether the shadow inode includes a disk address, wherein if the shadow inode includes a disk address, then retrieving an indirect block referenced by the disk address and at least one data block defined by at least one disk address in the indirect block; and wherein if the shadow inode does not include a disk address, retrieving an inode of the source file, then retrieving an indirect block referenced by a disk address in the inode of the source file and retrieving at least one data block referenced by at least one disk address in the indirect block.
- 7. A system for providing a file system snapshot, comprising:
means for generating a snapshot dataset for a source file in a file system, wherein the snapshot dataset is substantially empty; and means for copying to a shadow inode in the snapshot dataset an inode corresponding to the source file, when only metadata of the source file is modified, wherein a disk address of a data block corresponding to the source file is not copied to the shadow inode.
- 8. The system of claim 7, further comprising:
means for copying to the shadow inode in the snapshot dataset the inode corresponding to the source file, when the data block corresponding to the source file is only appended, wherein the disk address of the data block corresponding to the source file is not copied to the shadow inode.
- 9. The system of claim 8, further comprising:
means for copying to the shadow inode in the snapshot dataset the inode corresponding to the source file and copying to the snapshot dataset the data block corresponding to the source file, when the data block corresponding to the source file is overwritten or deleted, wherein the shadow inode includes a disk address of the data block which was written in the snapshot dataset.
- 10. The system of claim 9, further comprising:
means for accessing a shadow inode corresponding to a source file; means for determining whether the shadow inode includes a disk address, means for reading a data block referenced by the disk address; and means for retrieving an inode of the source file and retrieving a data block referenced by a disk address in the inode of the source file.
- 11. The system of claim 9, further comprising:
means for copying to the shadow inode in the snapshot dataset the inode corresponding to the source file and copying to the snapshot dataset an indirect block corresponding to the source file and at least one data block corresponding to the source file, when at least one of the data blocks corresponding to the source file are overwritten or deleted, wherein the shadow inode includes a disk address of the indirect block which was written in the snapshot dataset and wherein the indirect block includes a disk address of at least one data block which was written in the snapshot dataset.
- 12. The system of claim 11, further comprising:
means for accessing a shadow inode corresponding to a source file; means for determining whether the shadow inode includes a disk address, means for retrieving an indirect block referenced by the disk address and at least one data block defined by at least one disk address in the indirect block; and means for retrieving an inode of the source file, retrieving an indirect block referenced by a disk address in the inode of the source file and retrieving at least one data block referenced by at least one disk address in the indirect block.
- 13. A computer readable medium including computer instructions for providing a file system snapshot, the computer instructions comprising instructions for:
generating a snapshot dataset for a source file in a file system, wherein the snapshot dataset is substantially empty; and copying to a shadow inode in the snapshot dataset an inode corresponding to the source file, when only metadata of the source file is modified, wherein a disk address of a data block corresponding to the source file is not copied to the shadow inode.
- 14. The computer readable medium of claim 13, the computer instructions further comprising instructions for:
copying to the shadow inode in the snapshot dataset the inode corresponding to the source file, when the data block corresponding to the source file is only appended, wherein the disk address of the data block corresponding to the source file is not copied to the shadow inode.
- 15. The computer readable medium of claim 14, the computer instructions further comprising instructions for:
copying to the shadow inode in the snapshot dataset the inode corresponding to the source file and copying to the snapshot dataset the data block corresponding to the source file, when the data block corresponding to the source file is overwritten or deleted, wherein the shadow inode includes a disk address of the data block which was written in the snapshot dataset.
- 16. The computer readable medium of claim 15, the computer instructions further comprising instructions for:
accessing a shadow inode corresponding to a source file; determining whether the shadow inode includes a disk address, wherein if the shadow inode includes a disk address, then reading a data block referenced by the disk address; and wherein if the shadow inode does not include a disk address, then retrieving an inode of the source file and retrieving a data block referenced by a disk address in the inode of the source file.
- 17. The computer readable medium of claim 15, the computer instructions further comprising instructions for:
copying to the shadow inode in the snapshot dataset the inode corresponding to the source file and copying to the snapshot dataset an indirect block corresponding to the source file and at least one data block corresponding to the source file, when at least one of the data blocks corresponding to the source file are overwritten or deleted, wherein the shadow inode includes a disk address of the indirect block which was written in the snapshot dataset and wherein the indirect block includes a disk address of at least one data block which was written in the snapshot dataset.
- 18. The computer readable medium of claim 17, the computer instructions further comprising instructions for:
accessing a shadow inode corresponding to a source file; determining whether the shadow inode includes a disk address, wherein if the shadow inode includes a disk address, then retrieving an indirect block referenced by the disk address and at least one data block defined by at least one disk address in the indirect block; and wherein if the shadow inode does not include a disk address, then retrieving an inode of the source file, retrieving an indirect block referenced by a disk address in the inode of the source file and retrieving at least one data block referenced by at least one disk address in the indirect block.
- 19. A system for providing a file system snapshot, comprising:
a snapshot dataset for a source file in a file system, wherein the snapshot dataset is substantially empty; and a shadow inode in the snapshot dataset, the shadow inode copied from an inode corresponding to the source file, wherein the shadow inode is generated only when metadata of the source file is modified and wherein a disk address of a data block corresponding to the source file is not included in the shadow inode.
- 20. The system of claim 19, further comprising:
a shadow inode in the snapshot dataset, the shadow inode copied from an inode corresponding to the source file, wherein the shadow inode is generated only when the data block corresponding to the source file is appended and wherein the disk address of the data block corresponding to the source file is not included in the shadow inode.
- 21. The system of claim 20, further comprising:
a data block corresponding to the source file in the snapshot dataset, wherein the data block is copied to the snapshot dataset when the original data block is overwritten; and a shadow inode in the snapshot dataset, the shadow inode copied from an inode corresponding to the source file, wherein the shadow inode is generated when the data block corresponding to the source file is overwritten or deleted and wherein the shadow inode includes a disk address of the data block which was written in the snapshot dataset.
- 22. The system of claim 21, further comprising:
a shadow inode corresponding to a source file; a disk address included in the shadow inode; a data block referenced by the disk address; an inode of the source file; and a data block referenced by a disk address in the inode of the source file.
- 23. The system of claim 21, further comprising:
a shadow inode corresponding to a source file; a disk address included in the shadow inode, an indirect block referenced by the disk address; at least one data block defined by at least one disk address in the indirect block; an inode of the source file; an indirect block referenced by a disk address in the inode of the source file; and at least one data block referenced by at least one disk address in the indirect block.
- 24. A method for deleting a first snapshot of a file system, comprising:
determining the existence of an older snapshot; wherein if there is an older snapshot, determining the existence of a reference in the older snapshot to an inode or a data block in the first snapshot; and wherein if there is no older snapshot, deleting any inode or data block in the first snapshot.
- 25. The method of claim 24, further comprising:
wherein if there is a reference in the older snapshot to an inode or a data block in the first snapshot, copying to the older snapshot the inode or data block being referenced and deleting any inode or data block in the first snapshot; and wherein if there is no reference in the older snapshot to an inode or a data block in the first snapshot, deleting any inode or data block in the first snapshot.
- 26. A method for restoring a first snapshot of a file system, comprising:
wherein if there is a most recent snapshot, the most recent snapshot not being the first snapshot, copying to the most recent snapshot any inode or data block in the file system referenced by the most recent snapshot, which shall be modified by the restoration of the first snapshot; wherein if there is an inode or a data block in the first snapshot, copying the inode or data block in the first snapshot to the file system; and wherein if there is a ditto disk address in the first snapshot, copying the inode or data block referenced by the ditto disk address to the file system.
CROSS-REFERENCE TO RELATED APPLICATIONS
[0001] This application relates to the inventors' concurrently filed and commonly assigned U.S. patent application Ser. No. ______, attorney docket number POU920020009US1; U.S. patent application Ser. No. ______, attorney docket number POU920020011US1; U.S. patent application Ser. No. ______, attorney docket number POU920020012US1; U.S. patent application Ser No. ______ attorney docket number POU920020013US1; and U.S. patent application Ser. No. ______, attorney docket number POU920020014US1. All of these applications were filed on Feb. 15, 2002 and are commonly assigned to International Business Machines Corporation.