Method and system for traversing linked list record based upon write-once predetermined bit value of secondary pointers

- Microsoft

A method and apparatus for storing files on a computer file storage device. The files are organized into an hierarchical directory structure. The directory structure comprises directory entries and file entries. The file entries and directory each contain a primary and a secondary pointer. The secondary pointer is initially set to a predefined value. When an entry is to be updated, the secondary pointer is overridden with a value that points to the superseding entry. This directory structure is especially suitable to be used in a write-once computer memory.

Skip to:  ·  Claims  ·  References Cited  · Patent History  ·  Patent History

Claims

2. The method of claim 1 including the additional step of setting the primary pointer in the allocated record equal to the primary pointer of the located record.

3. The method of claim 1 or 2 wherein the file storage device is a flash, erasable programmable read only memory.

4. The method of claim 1 wherein the file storage device is logically a stack device, the stack having a top, and the allocated records are allocated on the top of the stack.

5. A computer file storage system for organizing files based on a hierarchical directory structure, the directory structure having a plurality of directory entries, the system comprising:

a computer having a memory for storing directory entries, the memory comprising a plurality of bits such that once a bit is changed from a predefined bit value to another bit value the changed bit cannot be individually changed back to the predefined bit value;
means for allocating a portion of the memory for storing a directory entry, the directory entry having a primary pointer, a secondary pointer, and a sibling pointer, the pointers having a plurality of bits initially being set to the predefined bit value;
means for storing directory data in the directory entry;
means for setting the sibling pointer of the directory entry to point to another directory entry at the same level in the directory structure to form a linked list of sibling directory entries;
means for setting the primary pointer of the directory entry to point to another directory entry at the next level lower in the directory structure;
means for determining whether each bit of the secondary pointer of the directory entry is set to the predefined bit value to indicate that the directory data of the directory entry has superseded; and
means for setting the secondary pointer of the directory entry to point to a superseding directory entry, the superseding directory entry to contain updated data for the directory entry by changing at least one bit of the secondary pointer from the predefined bit value to the other bit value.

6. The computer file storage system of claim 5 further comprising:

means for setting the primary pointer of the superseding directory entry equal to the primary pointer of the directory entry; and
mean for setting the sibling pointer of the superseding directory entry equal to the sibling pointer of the directory entry.

7. The computer file storage system of claim 5 further comprising:

means for allocating a portion of the memory for storing a file entry, the file entry to contain information relating to a file; and
means for setting the primary pointer of the directory entry to point to the file entry.

8. The computer file storage system of claim 7 wherein the file entry contains a primary pointer, a secondary pointer, and a sibling pointer, the file entry pointers having a plurality of bits initially being set to the predefined bit value, including:

means for setting the sibling pointer of the file entry to point to another file entry to form a linked list of file entries; and
means for setting the secondary pointer of the file entry to point to a superseding file entry, the superseding file entry to contain updated data for the file entry.

9. The computer file storage system of claim 8 further comprising:

means for setting the primary pointer of the superseding file entry equal to the primary pointer of the file entry; and
means for setting the sibling pointer of the superseding file entry equal to the sibling pointer of the file entry.

10. The computer file storage system of claim 7 further comprising:

means for allocating a portion of the memory for storing a file information entry, the file information entry to contain information relating to a file extent; and
means for setting the primary pointer of the file entry to point to the file information entry.

11. The computer file storage system of claim 10 wherein the file information entry contains a primary pointer and secondary pointer, the file information entry pointers having a plurality of bits initially being set to the predefined bit value, further comprising:

means for setting the primary pointer of the file information entry to point to another file information entry associated with the same file to form a linked list of file information entries for that same file; and
means for setting the secondary pointer of the file information entry to point to a superseding file information entry, the superseding file information entry to contain updated data for the file information entry.

12. The computer file storage system of claim 11 further comprising:

means for setting the primary pointer of the superseding file information entry equal to the primary pointer of the file information entry.

13. The computer file storage system of claim 5, 6, 7, 8, 9, 10, 11, or 12 wherein the memory is a flash, erasable, programmable read-only memory.

15. The computer file storage system of claim 14 further comprising:

means for setting the primary pointer of the superseding file entry equal to the primary pointer of the file entry; and
means for setting the sibling pointer of the superseding file entry equal to the sibling pointer of the file entry.

16. The computer file storage system of claim 14 including:

means for allocating a portion of the memory for storing a file information entry, the file information entry to contain information relating to a file extent of a file, the file information entry containing a primary pointer and a secondary pointer, each of the file information entry pointers having a plurality of bits initially being set to the predefined bit value;
means for setting the primary pointer of the file entry to point to the file information entry;
means for setting the primary pointer of a file information entry to point to another file information entry associated with the same file to form a linked list of file information entries for the same file; and
means for setting the secondary pointer of the file information entry to point to a superseding file information entry, the superseding file information entry to contain updated information for the file information entry.

17. The computer file storage system of claim 16 further comprising:

means for setting the primary pointer of the superseding file information entry equal to the primary pointer of the file information entry.

18. The computer file storage system of claim 14, 15, 16, or 17 wherein the memory is a flash, erasable, programmable read-only memory.

20. The method of claim 19 wherein the step of setting the secondary pointer includes setting a flag in the located record to indicate at the secondary pointer has been changed from the a predefined bit value.

21. The method of claim 19 or 20 wherein the computer memory device is a flash, erasable, programmable read-only memory.

22. The method of claim 19 wherein the step of locating a record includes determining an address of a first unallocated portion in the memory.

23. The method of claim 22 wherein the device has a plurality of locations, each location identified by an address, the addresses being sequential, the device having a beginning location and an ending location, the device having an allocated portion of contiguous locations and an unallocated portion of contiguous locations, the allocated portion being positioned starting at the beginning address, the unallocated portion being positioned ending at the ending address, each bit of each location in the allocated portion being set to the predefined bit value, and wherein the step for determining an address of a first unallocated location includes the steps of:

(a) setting a search pointer equal to the address of the ending location;
(b) retrieving data stored at the location pointed to by the search pointer;
(c) comparing each bit of the retrieved data with the predefined bit value;
(d) if each bit of the retrieved data is equal to the predefined bit value, adjusting the search pointer to point to the next contiguous location;
(e) repeating steps (b), (c), and (d) until at least one bit of the retrieved data is not equal to the predefined bit value; and
(f) if at least one bit of the retrieved data is not equal to the predefined bit value, setting the address of the first unallocated location equal to the address of the last location from which each bit of the retrieved data was equal to the predefined bit value.

24. The method of claim 23 wherein the allocated portion of contiguous locations has a last location, including the step of:

ensuring that at least one bit of the last location in the allocated portion of contiguous locations contains a bit value other than the predefined bit value.

25. The method of claim 22, 23, or 24 wherein the memory device is a flash, erasable, programmable read-only memory.

26. A method for determining an address of a first unallocated location in a memory device, the device having a plurality of locations, each location identified by an associated address, the addresses being sequential, the device having a beginning location and a ending location, the device having an allocated portion of contiguous locations and an unallocated portion of contiguous locations, the allocated portion being positioned starting at the beginning address, the unallocated portion being positioned ending at the ending address, each bit of the unallocated portion being set to a predefined value, the method comprising the steps of:

(a) setting a search pointer equal to the address of the ending location;
(b) retrieving the bits stored at the location pointed to by the search pointer, the location comprising a plurality of bits such that once a bit is changed from the predefined value to another value the changed bit cannot be individually changed back to the predefined value;
(c) comparing the retrieved bits with the predefined value;
(d) if each of the retrieved bits is equal to the predefined value, adjusting the search pointer to point to the next contiguous location;
(e) repeating steps (b), (c), and (d) until at least one of the retrieved bits is not equal to the predefined value; and
(f) if at least one of the retrieved bits is not equal to the predefined value, setting the address of the first unallocated location equal to the address of the last location from which each of the retrieved bits was equal to the predefined value.

27. The method of claim 26, wherein the allocated portion of contiguous locations has a last location, including the additional step of:

ensuring that at least one bit of the last location in the allocated portion of the contiguous locations contains a value other than the predefined value.

28. The method of claim 26 or 27 wherein the memory device is a flash, erasable, programmable read-only memory.

29. A method of updating a logically contiguous set of data with updated data, the data comprising a plurality of extents, each extent comprising a logically contiguous subset of the set of data, each extent having an associated extent header, the extent header having a primary pointer, a secondary pointer, and an extent pointer, the primary pointers linking the extent headers in a linked list, the extent pointers pointing to the extent associated with the header, the method comprising the steps of:

locating an extent header associated with an extent to be updated, the located extent header comprising a plurality of bits such that once a bit is changed from a predefined bit value to another bit value the changed bit cannot be individually changed back to the predefined bit value, the secondary bit pointer of the located extent header having each bit set to the predefined bit value;
allocating an extent header, the allocated extent header comprising a plurality of bits such that once a bit is changed from the predefined bit value to another bit value the changed bit cannot be individually changed back to the predefined bit value, each bit of the allocated extent header being set to the predefined bit value;
setting the secondary pointer in the located extent header to point to the allocated extent header by changing at least one bit of the secondary pointer from the predefined bit value to the other bit value;
setting the primary pointer in the allocated extent header equal to the primary pointer of the located extent header by changing at least one bit of the primary pointer from the predefined bit value to the other bit value;
allocating an extent to store the updated data;
storing the updated data in the allocated extent; and
setting the extent pointer in the allocated extent header to point to the allocated extent by changing at least one bit of the extent pointer from the predefined bit value to the other bit value.

30. The method of claim 29 comprising the additional steps of:

setting the primary pointer in the allocated extent header to point to another allocated extent header, when updating only a portion of the data in the extent to be updated; and
setting the extent pointer in the other allocated extent to point to a portion of data in the extent to be updated, wherein the portion of data is not to be updated.

31. The method of claim 29 or 30 wherein the memory device is a flash, erasable, programmable read-only memory.

Referenced Cited
U.S. Patent Documents
4408273 October 4, 1983 Plow
4507752 March 26, 1985 McKenna et al.
4584644 April 22, 1986 Larner
4606002 August 12, 1986 Waisman et al.
4630234 December 16, 1986 Holly
4704678 November 3, 1987 May
4953080 August 28, 1990 Dysart et al.
4953122 August 28, 1990 Williams
4989132 January 29, 1991 Mellender et al.
5025367 June 18, 1991 Gurd et al.
5060147 October 22, 1991 Mattheyses
5115504 May 19, 1992 Belove et al.
5392427 February 21, 1995 Barrett et al.
Other references
  • Kruse, "Data Structures & Program Design", by Prentice-Hall 1984, pp. 40-83. Cooper et al., "OH| Pascal", 1982; pp. 475-523.
Patent History
Patent number: RE35881
Type: Grant
Filed: Sep 21, 1995
Date of Patent: Aug 25, 1998
Assignee: Microsoft Corporation (Redmond, WA)
Inventors: Phillip L. Barrett (Redmond, WA), Scott D. Quinn (Issaquah, WA), Ralph A. Lipe (Woodinville, WA)
Primary Examiner: Krisna Lim
Law Firm: Seed and Berry LLP
Application Number: 8/531,460
Classifications
Current U.S. Class: 707/1; 707/3; 707/205
International Classification: G06F 1540;