Handling copy on first write data for snapshot purposes
First Claim
1. In an electronic apparatus having cache memory, a method of performing a write operation, the method comprising:
- after a snapshot of a file system is taken, receiving a write instruction to write new data to a particular portion of the file system;
in response to the write instruction, reading metadata to determine whether the new data is a first update of the particular portion of the file system since the snapshot was taken, the metadata being constructed and arranged to identify portions of the file system which have changed since the snapshot was taken;
when the metadata indicates that the new data is not a first update of the particular portion of the file system since the snapshot was taken, updating original data in the cache memory with the new data, the original data corresponding to the particular portion of the file system; and
when the metadata indicates that the new data is a first update of the particular portion of the file system since the snapshot was taken, copying the original data from the cache memory to snapshot storage which is separate from the cache memory and, after the original data is copied from the cache memory to the snapshot storage, updating the original data in the cache memory with the new data;
wherein the portions of the file system are data blocks;
wherein the metadata includes a first update table having a set of first update entries, each first update entry corresponding to a respective data block of the file system;
wherein the write instruction identifies a particular data block; and
wherein reading the metadata to determine whether the new data is a first update of the particular portion of the file system since the snapshot was taken includes reading, from the first update table, contents of a particular first update entry corresponding to the particular data block identified by the write instruction, the new data (i) not being a first update of the particular portion of the file system since the snapshot was taken when the contents of the particular first update entry define a first value, and (ii) being a first update of the particular portion of the file system since the snapshot was taken when the contents of the particular first update entry define a second value which is different than the first value.
9 Assignments
0 Petitions
Accused Products
Abstract
A technique performs a write operation. The technique involves receiving, after a snapshot of a file system is taken, a write instruction to write new data to a particular portion of the file system. The technique further involves includes reading, in response to the write instruction, metadata to determine whether the new data is a first update of the particular portion since the snapshot was taken. The metadata identifies portions of the file system which have changed since the snapshot was taken. The technique further involves, when the new data is a first update of the particular portion since the snapshot was taken, copying the original data from cache memory (i.e., from the file system buffer cache) to snapshot storage (i.e., to a dedicated save area) and, after the original data is copied, updating the original data in the cache memory with the new data.
53 Citations
15 Claims
-
1. In an electronic apparatus having cache memory, a method of performing a write operation, the method comprising:
-
after a snapshot of a file system is taken, receiving a write instruction to write new data to a particular portion of the file system; in response to the write instruction, reading metadata to determine whether the new data is a first update of the particular portion of the file system since the snapshot was taken, the metadata being constructed and arranged to identify portions of the file system which have changed since the snapshot was taken; when the metadata indicates that the new data is not a first update of the particular portion of the file system since the snapshot was taken, updating original data in the cache memory with the new data, the original data corresponding to the particular portion of the file system; and when the metadata indicates that the new data is a first update of the particular portion of the file system since the snapshot was taken, copying the original data from the cache memory to snapshot storage which is separate from the cache memory and, after the original data is copied from the cache memory to the snapshot storage, updating the original data in the cache memory with the new data; wherein the portions of the file system are data blocks; wherein the metadata includes a first update table having a set of first update entries, each first update entry corresponding to a respective data block of the file system; wherein the write instruction identifies a particular data block; and wherein reading the metadata to determine whether the new data is a first update of the particular portion of the file system since the snapshot was taken includes reading, from the first update table, contents of a particular first update entry corresponding to the particular data block identified by the write instruction, the new data (i) not being a first update of the particular portion of the file system since the snapshot was taken when the contents of the particular first update entry define a first value, and (ii) being a first update of the particular portion of the file system since the snapshot was taken when the contents of the particular first update entry define a second value which is different than the first value. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
-
-
12. An electronic apparatus, comprising:
-
cache memory; snapshot storage which is separate from the cache memory; and a control circuit coupled to the cache memory and the snapshot storage, the control circuit being constructed and arranged to; after a snapshot of a file system is taken, receive a write instruction to write new data to a particular portion of the file system, in response to the write instruction, read metadata to determine whether the new data is a first update of the particular portion of the file system since the snapshot was taken, the metadata being constructed and arranged to identify portions of the file system which have changed since the snapshot was taken, when the metadata indicates that the new data is not a first update of the particular portion of the file system since the snapshot was taken, update original data in the cache memory with the new data, the original data corresponding to the particular portion of the file system, and when the metadata indicates that the new data is a first update of the particular portion of the file system since the snapshot was taken, copy the original data from the cache memory to the snapshot storage and, after the original data is copied from the cache memory to the snapshot storage, update the original data in the cache memory with the new data; wherein the portions of the file system are data blocks; wherein the metadata includes a snapshot bitmap having a set of bitmap entries, each bitmap entry corresponding to a respective data block of the file system; wherein the write instruction identifies a particular data block; and wherein the control circuit, when reading the metadata to determine whether the new data is a first update of the particular portion of the file system since the snapshot was taken, is constructed and arranged to read, from the snapshot bitmap, contents of a particular bitmap entry corresponding to the particular data block identified by the write instruction, the new data (i) not being a first update of the particular portion of the file system since the snapshot was taken when the contents of the particular bitmap entry define a first value, and (ii) being a first update of the particular portion of the file system since the snapshot was taken when the contents of the particular bitmap entry define a second value which is different than the first value. - View Dependent Claims (13)
-
-
14. A computer program product which includes a non-transitory computer readable medium storing containing code to perform a write operation, the code directing a computerized device to:
-
receive, after a snapshot of a file system is taken, a write instruction to write new data to a particular portion of the file system; in response to the write instruction, read metadata to determine whether the new data is a first update of the particular portion of the file system since the snapshot was taken, the metadata being constructed and arranged to identify portions of the file system which have changed since the snapshot was taken; when the metadata indicates that the new data is not a first update of the particular portion of the file system since the snapshot was taken, update original data in cache memory with the new data, the original data corresponding to the particular portion of the file system; and when the metadata indicates that the new data is a first update of the particular portion of the file system since the snapshot was taken, copy the original data from the cache memory to snapshot storage and, after the original data is copied from the cache memory to the snapshot storage, update the original data in the cache memory with the new data; wherein the portions of the file system are data blocks; wherein the metadata includes a snapshot bitmap having a set of bitmap entries, each bitmap entry corresponding to a respective data block of the file system; wherein the write instruction identifies a particular data block; and wherein reading the metadata to determine whether the new data is a first update of the particular portion of the file system since the snapshot was taken includes reading, from the snapshot bitmap, contents of a particular bitmap entry corresponding to the particular data block identified by the write instruction, the new data (i) not being a first update of the particular portion of the file system since the snapshot was taken when the contents of the particular bitmap entry define a first value, and (ii) being a first update of the particular portion of the file system since the snapshot was taken when the contents of the particular bitmap entry define a second value which is different than the first value. - View Dependent Claims (15)
-
Specification