Claims
- 1. In a computer that uses a flash medium to store data, a method for detecting a power failure, comprising:
storing meta-information at a location on a flash medium indicated by a write pointer if the computer shuts-down according to a normal shutdown mode; during initialization of the computer, checking whether the meta-information is present in the location on the flash medium indicated by the write pointer; concluding that the computer shutdown according to the normal shutdown mode if the meta-information is present; and concluding that the computer did not shutdown according to the normal shutdown mode if the meta-information is not present.
- 2. The method as recited in claim 1, wherein the meta-information is a bit stored in a spare section of a physical sector of the flash medium.
- 3. The method as recited in claim 1, wherein the write pointer advances through physical sector addresses of the flash medium in a circular fashion.
- 4. The method as recited in claim 1, wherein the meta-information is a bit that is marked active each time the computer shuts-down according to the normal shutdown mode.
- 5. The method as recited in claim 1, wherein the meta-information is a bit that remains inactive if the computer does not shutdown according to the normal shutdown mode.
- 6. The method as recited in claim 1, wherein the location in the flash medium is a physical sector address.
- 7. The method as recited in claim 1, wherein the method is performed by a file system operating on a processor in the computer.
- 8. The method as recited in claim 1, wherein the method is performed by a software module operating on a processor in the computer.
- 9. One or more computer-readable media comprising computer executable instructions that, when executed, direct a computer to:
store meta-information at a location on a flash medium indicated by a write pointer if the computer shuts-down according to a normal shutdown mode; during initialization of the computer, check whether the meta-information is present in the location on the flash medium indicated by the write pointer; and conclude that the computer shutdown according to the normal shutdown mode if the meta-information is present.
- 10. One or more computer-readable media as recited in claim 9, further comprising computer executable instructions that, when executed, direct the computer to conclude that the computer did not shutdown according to the normal shutdown mode if the meta-information is not present.
- 11. One or more computer-readable media as recited in claim 9, wherein the write pointer advances through physical sector addresses of the flash medium in a circular fashion.
- 12. One or more computer-readable media as recited in claim 9, wherein the meta-information is a bit that is marked active each time the computer shuts-down according to the normal shutdown mode.
- 13. One or more computer-readable media as recited in claim 9, wherein the meta-information is a bit that remains inactive if the computer does not shutdown according to the normal shutdown mode.
- 14. One or more computer-readable media as recited in claim 9, wherein the location in the flash medium is a physical sector address.
- 15. One or more computer-readable media as recited in claim 9, wherein the computer executable instructions are components of a file system.
- 16. A system for ensuring data integrity in a flash medium, comprising:
a write pointer configured to advance through a circular sequence of memory locations in the flash medium indicating a memory location that is free to receive data as the write pointer advances; and a power failure manager configured to store metadata in the memory location indicated by the write pointer after completion of a write operation.
- 17. The system as recited in claim 16, wherein the power failure manager is further configured to search the memory location indicated by the write pointer for the metadata when the system is initialized.
- 18. The system as recited in claim 16, wherein the power failure manager is further configured to (i) search the memory location indicated by the write pointer for the metadata when the system is initialized; (ii) conclude that a power-failure event occurred if the metadata is not found; and (iii) mark the memory location indicated by the write pointer dirty.
- 19. The system as recited in claim 16, wherein the metadata is a bit in the memory location that is marked active at completion of the write operation.
- 20. The system as recited in claim 16, wherein the write pointer and power failure manager are components of a file system.
- 21. The system as recited in claim 16, wherein the memory locations are physical sector addresses.
- 22. The system as recited in claim 16, wherein the write pointer contains at least one counter that is incremented to advance the write pointer at least one memory location at a time at completion of a write operation.
- 23. The system as recited in claim 16, further comprising a sector manager that maintains the write pointer and provides a next memory location address to store data, upon receiving a write request.
- 24. A file system, comprising:
a sector manager, configured to organize a flash memory medium as if memory locations of the flash memory form a continuous circle, wherein the lowest and highest memory locations are contiguous; the sector manager comprising a write pointer that indicates a memory location that is free to receive new data, the write pointer configured to advance through the continuous circle a memory location at a time as data is written to the flash memory medium; and a power failure manager configured to store data valid information in each memory location indicated by the write pointer at completion of writing data into each memory location.
- 25. The file system as recited in claim 24, wherein the power failure manager is further configured to search the memory location, indicated by the write pointer, for the data valid information when the file system is initialized to ascertain whether the data valid information exists in the memory location.
- 26. The file system as recited in claim 24, wherein the power failure manager is further configured to (i) search the memory location indicated by the write pointer for the data valid information when the file system is initialized; and (ii) mark the memory location dirty, if the data valid information is not found.
- 27. The file system as recited in claim 24, wherein the memory locations are physical sector addresses.
- 28. The file system as recited in claim 24, wherein the memory locations are physical sector addresses and the write pointer advances at least a physical sector address each time data is written on the flash memory medium.
- 29. The file system as recited in claim 24, wherein the sector manager contains at least one counter that is incremented to advance the write pointer from the lowest memory location to the highest memory location and repeat counting once the highest memory location is reached.
- 30. The file system as recited in claim 24, wherein the sector manager contains at least one counter that is decremented to advance the write pointer from the highest memory location to the lowest memory location and repeat decrementing once the lowest memory location is reached.
- 31. In a computer having a flash medium, a method for maintaining data integrity in the event of a power failure, comprising:
maintaining a write pointer to advance through a circular sequence of memory locations in the flash medium indicating a memory location that is available to receive data as the write pointer advances; writing data into the memory location indicated by the write pointer; and writing metadata into the memory location indicated by the write pointer if the writing of data into the memory location is completed.
- 32. The method as recited in claim 31, further comprising searching the memory location indicated by the write pointer to determine whether the metadata exists in the memory location upon initializing the computer.
- 33. The method as recited in claim 31, further comprising:
searching the memory location indicated by the write pointer to determine whether the metadata exists in the memory location upon initializing the computer; and concluding that a power-failure event occurred to the computer prior to completing the writing of data, if the metadata is not found by the searching.
- 34. The method as recited in claim 31, further comprising:
searching the memory location indicated by the write pointer to determine whether the metadata exists in the memory location upon initializing the computer; and marking the memory location indicated by the write pointer dirty, if the metadata is does not exist in the memory location.
- 35. The method as recited in claim 31, wherein the metadata is a bit in the memory location that is marked active each time writing of data into a memory location is completed and remains inactive each time the writing of data into a memory location is interrupted by a power-failure event.
- 36. The method as recited in claim 31, wherein the memory locations are physical sector addresses.
- 37. One or more computer-readable media comprising computer executable instructions that, when executed, direct a computer to:
organize a flash memory medium as if memory locations of the flash memory form a continuous circle, wherein the lowest and highest memory locations are contiguous; maintain a write pointer to indicate a memory location that is free to receive new data, the write pointer configured to advance through the continuous circle a memory location as data is written to the flash memory medium; and store meta-information in each memory location indicated by the write pointer at completion of a write operation to the memory location indicated by the write pointer.
- 38. One or more computer-readable media as recited in claim 37, further comprising computer executable instructions that, when executed, direct the computer to search the memory location indicated by the write pointer when the file system is initialized to ascertain whether the meta-information exists in the memory location.
- 39. One or more computer-readable media as recited in claim 37, further comprising computer executable instructions that, when executed, direct the computer to (i) search the memory location indicated by the write pointer when the file system is initialized to ascertain whether the meta-information exists in the memory location; (ii) conclude that a power-failure event occurred, if the meta-information is not found in the memory location; and (iii) mark the memory location indicated by the write pointer dirty if a power-failure event is concluded.
- 40. One or more computer-readable media as recited in claim 37, wherein the memory locations are physical sector addresses.
- 41. A computer, comprising:
one or more processors and a file system, the file system comprising: a sector manager, configured to organize a flash memory medium as if memory locations of the flash memory form a continuous circle, wherein the lowest and highest memory locations are contiguous; the sector manager comprising a write pointer that indicates a memory location that is free to receive new data, the write pointer configured to advance through the continuous circle a memory location as data is written on the flash memory medium; and a power failure manager configured to store a data valid bit in each memory location indicated by the write pointer at completion of writing data to the memory location indicated by the write pointer.
- 42. The computer as recited in claim 41, wherein the power failure manager is further configured to read the memory location indicated by the write pointer when the file system is initialized to ascertain whether the data valid bit exists in the memory location.
- 43. The file system as recited in claim 41, wherein the power failure manager is further configured to (i) search the memory location indicated by the write pointer when the file system is initialized to ascertain whether the data valid bit exists in the memory location; and (ii) conclude that a power-failure event occurred, if the data valid bit is not found in the memory location.
- 44. The file system as recited in claim 41, wherein the power failure manager is further configured to (i) search the memory location indicated by the write pointer when the file system is initialized to ascertain whether the data valid bit exists in the memory location; (ii) conclude that a power-failure event occurred, if the data valid bit is not found in the memory location; and (iii) mark the memory location dirty if the power-failure event occurred.
- 45. A computer, comprising:
one or more processors and a file system operating in conjunction with the one or more processors, the file system comprising: a sector manager, configured to (i) store meta-information at a location on a flash medium indicated by a write pointer if the computer shuts-down according to a normal shutdown mode; (ii) during initialization of the computer, check whether the meta-information is present in the location on the flash medium indicated by the write pointer; and (iii) conclude that the computer shutdown according to the normal shutdown mode if the meta-information is present.
- 46. The computer as recited in claim 45, wherein the file system is further configured to conclude that the computer did not shutdown according to the normal shutdown mode if the meta-information is not present.
- 47. The computer as recited in claim 45, wherein the write pointer advances through physical sector addresses of the flash medium in a circular fashion.
- 48. The computer as recited in claim 45, wherein the meta-information is a bit that is marked active each time the computer shuts-down according to the normal shutdown mode.
- 49. The computer as recited in claim 45, wherein the meta-information is a bit that remains inactive if the computer does not shutdown according to the normal shutdown mode.
- 50. The computer as recited in claim 45, wherein the location in the flash medium is a physical sector address.
CROSS-REFERENCE TO RELATED APPLICATIONS
[0001] The present patent application is a Continuation-In-Part of U.S. patent application Ser. No. 10/087,672, entitled “Open Architecture Flash Driver,” by Aasheim, et al., having a filing date of Feb. 27, 2002, and is commonly assigned herewith (hereinafter referred to as “Aasheim '672”). The contents of the aforementioned application are fully incorporated herein by reference.
Continuation in Parts (1)
|
Number |
Date |
Country |
Parent |
10087672 |
Feb 2002 |
US |
Child |
10301535 |
Nov 2002 |
US |