Patent ID: 7606812

Claim:
A method for dynamic intent logging in a file system, comprising: pre-allocating a first log block, wherein the first log block is part of a chain of log blocks and a size of the first log block corresponds to a size of the largest block previously allocated in the chain of log blocks; receiving a request to write a first set of deltas into a dynamic intent log, wherein the first set of deltas is stored in memory; determining, using a processor, whether a size of the first set of deltas is larger than the size of the first log block; if the size of the first set of deltas is not larger than the size of the first log block: storing the first set of deltas in the first log block; pre-allocating a second log block; if the size of the first set of deltas is larger than the size of the first log block: storing a first subset of the first set of deltas in the first log block, wherein a size of the first subset is less than or equal to the size of the first log block; for remaining deltas in the first set of deltas: determining whether a size of the remaining deltas is larger than a maximum log block size; allocating a third log block and storing the remaining deltas in the third log block, if the size of the remaining deltas is not larger than the maximum log block size and wherein a size of the third log block is less than or equal to the maximum log block size; allocating a fourth log block and storing a second subset of the remaining deltas in the forth log block, if the size of the remaining deltas is larger than the maximum log block size, and wherein a size of the fourth log block is the maximum size log block, wherein a size of the second log block is one selected from a group consisting of (a) the size of the first log block if the size of the first set of deltas is not larger than the first log block and (b) a size of one of a second set of deltas waiting in a queue.