Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 98894
b: refs/heads/master
c: 7ba1ba1
h: refs/heads/master
v: v3
  • Loading branch information
Martin K. Petersen authored and Jens Axboe committed Jul 3, 2008
1 parent fa85335 commit 72ce219
Show file tree
Hide file tree
Showing 14 changed files with 1,356 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 51d654e1d885607a6edd02b337105fa5c28b6d33
refs/heads/master: 7ba1ba12eeef0aa7113beb16410ef8b7c748e18b
12 changes: 12 additions & 0 deletions trunk/block/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ config BLK_DEV_BSG

If unsure, say N.

config BLK_DEV_INTEGRITY
bool "Block layer data integrity support"
---help---
Some storage devices allow extra information to be
stored/retrieved to help protect the data. The block layer
data integrity option provides hooks which can be used by
filesystems to ensure better data integrity.

Say yes here if you have a storage device that provides the
T10/SCSI Data Integrity Field or the T13/ATA External Path
Protection. If in doubt, say N.

endif # BLOCK

config BLOCK_COMPAT
Expand Down
1 change: 1 addition & 0 deletions trunk/block/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ obj-$(CONFIG_IOSCHED_CFQ) += cfq-iosched.o

obj-$(CONFIG_BLK_DEV_IO_TRACE) += blktrace.o
obj-$(CONFIG_BLOCK_COMPAT) += compat_ioctl.o
obj-$(CONFIG_BLK_DEV_INTEGRITY) += blk-integrity.o
7 changes: 7 additions & 0 deletions trunk/block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ static void req_bio_endio(struct request *rq, struct bio *bio,

bio->bi_size -= nbytes;
bio->bi_sector += (nbytes >> 9);

if (bio_integrity(bio))
bio_integrity_advance(bio, nbytes);

if (bio->bi_size == 0)
bio_endio(bio, error);
} else {
Expand Down Expand Up @@ -1381,6 +1385,9 @@ static inline void __generic_make_request(struct bio *bio)
*/
blk_partition_remap(bio);

if (bio_integrity_enabled(bio) && bio_integrity_prep(bio))
goto end_io;

if (old_sector != -1)
blk_add_trace_remap(q, bio, old_dev, bio->bi_sector,
old_sector);
Expand Down
Loading

0 comments on commit 72ce219

Please sign in to comment.