diff options
Diffstat (limited to 'Documentation/block')
-rw-r--r-- | Documentation/block/data-integrity.txt | 54 |
1 files changed, 5 insertions, 49 deletions
diff --git a/Documentation/block/data-integrity.txt b/Documentation/block/data-integrity.txt index 2d735b0ae383..f56ec97f0d14 100644 --- a/Documentation/block/data-integrity.txt +++ b/Documentation/block/data-integrity.txt | |||
@@ -129,11 +129,11 @@ interface for this is being worked on. | |||
129 | 4.1 BIO | 129 | 4.1 BIO |
130 | 130 | ||
131 | The data integrity patches add a new field to struct bio when | 131 | The data integrity patches add a new field to struct bio when |
132 | CONFIG_BLK_DEV_INTEGRITY is enabled. bio->bi_integrity is a pointer | 132 | CONFIG_BLK_DEV_INTEGRITY is enabled. bio_integrity(bio) returns a |
133 | to a struct bip which contains the bio integrity payload. Essentially | 133 | pointer to a struct bip which contains the bio integrity payload. |
134 | a bip is a trimmed down struct bio which holds a bio_vec containing | 134 | Essentially a bip is a trimmed down struct bio which holds a bio_vec |
135 | the integrity metadata and the required housekeeping information (bvec | 135 | containing the integrity metadata and the required housekeeping |
136 | pool, vector count, etc.) | 136 | information (bvec pool, vector count, etc.) |
137 | 137 | ||
138 | A kernel subsystem can enable data integrity protection on a bio by | 138 | A kernel subsystem can enable data integrity protection on a bio by |
139 | calling bio_integrity_alloc(bio). This will allocate and attach the | 139 | calling bio_integrity_alloc(bio). This will allocate and attach the |
@@ -192,16 +192,6 @@ will require extra work due to the application tag. | |||
192 | supported by the block device. | 192 | supported by the block device. |
193 | 193 | ||
194 | 194 | ||
195 | int bdev_integrity_enabled(block_device, int rw); | ||
196 | |||
197 | bdev_integrity_enabled() will return 1 if the block device | ||
198 | supports integrity metadata transfer for the data direction | ||
199 | specified in 'rw'. | ||
200 | |||
201 | bdev_integrity_enabled() honors the write_generate and | ||
202 | read_verify flags in sysfs and will respond accordingly. | ||
203 | |||
204 | |||
205 | int bio_integrity_prep(bio); | 195 | int bio_integrity_prep(bio); |
206 | 196 | ||
207 | To generate IMD for WRITE and to set up buffers for READ, the | 197 | To generate IMD for WRITE and to set up buffers for READ, the |
@@ -216,36 +206,6 @@ will require extra work due to the application tag. | |||
216 | bio_integrity_enabled() returned 1. | 206 | bio_integrity_enabled() returned 1. |
217 | 207 | ||
218 | 208 | ||
219 | int bio_integrity_tag_size(bio); | ||
220 | |||
221 | If the filesystem wants to use the application tag space it will | ||
222 | first have to find out how much storage space is available. | ||
223 | Because tag space is generally limited (usually 2 bytes per | ||
224 | sector regardless of sector size), the integrity framework | ||
225 | supports interleaving the information between the sectors in an | ||
226 | I/O. | ||
227 | |||
228 | Filesystems can call bio_integrity_tag_size(bio) to find out how | ||
229 | many bytes of storage are available for that particular bio. | ||
230 | |||
231 | Another option is bdev_get_tag_size(block_device) which will | ||
232 | return the number of available bytes per hardware sector. | ||
233 | |||
234 | |||
235 | int bio_integrity_set_tag(bio, void *tag_buf, len); | ||
236 | |||
237 | After a successful return from bio_integrity_prep(), | ||
238 | bio_integrity_set_tag() can be used to attach an opaque tag | ||
239 | buffer to a bio. Obviously this only makes sense if the I/O is | ||
240 | a WRITE. | ||
241 | |||
242 | |||
243 | int bio_integrity_get_tag(bio, void *tag_buf, len); | ||
244 | |||
245 | Similarly, at READ I/O completion time the filesystem can | ||
246 | retrieve the tag buffer using bio_integrity_get_tag(). | ||
247 | |||
248 | |||
249 | 5.3 PASSING EXISTING INTEGRITY METADATA | 209 | 5.3 PASSING EXISTING INTEGRITY METADATA |
250 | 210 | ||
251 | Filesystems that either generate their own integrity metadata or | 211 | Filesystems that either generate their own integrity metadata or |
@@ -298,8 +258,6 @@ will require extra work due to the application tag. | |||
298 | .name = "STANDARDSBODY-TYPE-VARIANT-CSUM", | 258 | .name = "STANDARDSBODY-TYPE-VARIANT-CSUM", |
299 | .generate_fn = my_generate_fn, | 259 | .generate_fn = my_generate_fn, |
300 | .verify_fn = my_verify_fn, | 260 | .verify_fn = my_verify_fn, |
301 | .get_tag_fn = my_get_tag_fn, | ||
302 | .set_tag_fn = my_set_tag_fn, | ||
303 | .tuple_size = sizeof(struct my_tuple_size), | 261 | .tuple_size = sizeof(struct my_tuple_size), |
304 | .tag_size = <tag bytes per hw sector>, | 262 | .tag_size = <tag bytes per hw sector>, |
305 | }; | 263 | }; |
@@ -321,7 +279,5 @@ will require extra work due to the application tag. | |||
321 | are available per hardware sector. For DIF this is either 2 or | 279 | are available per hardware sector. For DIF this is either 2 or |
322 | 0 depending on the value of the Control Mode Page ATO bit. | 280 | 0 depending on the value of the Control Mode Page ATO bit. |
323 | 281 | ||
324 | See 6.2 for a description of get_tag_fn and set_tag_fn. | ||
325 | |||
326 | ---------------------------------------------------------------------- | 282 | ---------------------------------------------------------------------- |
327 | 2007-12-24 Martin K. Petersen <martin.petersen@oracle.com> | 283 | 2007-12-24 Martin K. Petersen <martin.petersen@oracle.com> |