Skip to content

Commit d3dc366

Browse files
committed
Merge branch 'for-3.18/core' of git://git.kernel.dk/linux-block
Pull core block layer changes from Jens Axboe: "This is the core block IO pull request for 3.18. Apart from the new and improved flush machinery for blk-mq, this is all mostly bug fixes and cleanups. - blk-mq timeout updates and fixes from Christoph. - Removal of REQ_END, also from Christoph. We pass it through the ->queue_rq() hook for blk-mq instead, freeing up one of the request bits. The space was overly tight on 32-bit, so Martin also killed REQ_KERNEL since it's no longer used. - blk integrity updates and fixes from Martin and Gu Zheng. - Update to the flush machinery for blk-mq from Ming Lei. Now we have a per hardware context flush request, which both cleans up the code should scale better for flush intensive workloads on blk-mq. - Improve the error printing, from Rob Elliott. - Backing device improvements and cleanups from Tejun. - Fixup of a misplaced rq_complete() tracepoint from Hannes. - Make blk_get_request() return error pointers, fixing up issues where we NULL deref when a device goes bad or missing. From Joe Lawrence. - Prep work for drastically reducing the memory consumption of dm devices from Junichi Nomura. This allows creating clone bio sets without preallocating a lot of memory. - Fix a blk-mq hang on certain combinations of queue depths and hardware queues from me. - Limit memory consumption for blk-mq devices for crash dump scenarios and drivers that use crazy high depths (certain SCSI shared tag setups). We now just use a single queue and limited depth for that" * 'for-3.18/core' of git://git.kernel.dk/linux-block: (58 commits) block: Remove REQ_KERNEL blk-mq: allocate cpumask on the home node bio-integrity: remove the needless fail handle of bip_slab creating block: include func name in __get_request prints block: make blk_update_request print prefix match ratelimited prefix blk-merge: don't compute bi_phys_segments from bi_vcnt for cloned bio block: fix alignment_offset math that assumes io_min is a power-of-2 blk-mq: Make bt_clear_tag() easier to read blk-mq: fix potential hang if rolling wakeup depth is too high block: add bioset_create_nobvec() block: use bio_clone_fast() in blk_rq_prep_clone() block: misplaced rq_complete tracepoint sd: Honor block layer integrity handling flags block: Replace strnicmp with strncasecmp block: Add T10 Protection Information functions block: Don't merge requests if integrity flags differ block: Integrity checksum flag block: Relocate bio integrity flags block: Add a disk flag to block integrity profile block: Add prefix to block integrity profile flags ...
2 parents 511c41d + e19a8a0 commit d3dc366

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1210
-1172
lines changed

Documentation/ABI/testing/sysfs-block

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ Description:
5353
512 bytes of data.
5454

5555

56+
What: /sys/block/<disk>/integrity/device_is_integrity_capable
57+
Date: July 2014
58+
Contact: Martin K. Petersen <[email protected]>
59+
Description:
60+
Indicates whether a storage device is capable of storing
61+
integrity metadata. Set if the device is T10 PI-capable.
62+
63+
5664
What: /sys/block/<disk>/integrity/write_generate
5765
Date: June 2008
5866
Contact: Martin K. Petersen <[email protected]>

Documentation/block/data-integrity.txt

Lines changed: 5 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@ interface for this is being worked on.
129129
4.1 BIO
130130

131131
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
133-
to a struct bip which contains the bio integrity payload. Essentially
134-
a bip is a trimmed down struct bio which holds a bio_vec containing
135-
the integrity metadata and the required housekeeping information (bvec
136-
pool, vector count, etc.)
132+
CONFIG_BLK_DEV_INTEGRITY is enabled. bio_integrity(bio) returns a
133+
pointer to a struct bip which contains the bio integrity payload.
134+
Essentially a bip is a trimmed down struct bio which holds a bio_vec
135+
containing the integrity metadata and the required housekeeping
136+
information (bvec pool, vector count, etc.)
137137

138138
A kernel subsystem can enable data integrity protection on a bio by
139139
calling bio_integrity_alloc(bio). This will allocate and attach the
@@ -192,16 +192,6 @@ will require extra work due to the application tag.
192192
supported by the block device.
193193

194194

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-
205195
int bio_integrity_prep(bio);
206196

207197
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.
216206
bio_integrity_enabled() returned 1.
217207

218208

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-
249209
5.3 PASSING EXISTING INTEGRITY METADATA
250210

251211
Filesystems that either generate their own integrity metadata or
@@ -298,8 +258,6 @@ will require extra work due to the application tag.
298258
.name = "STANDARDSBODY-TYPE-VARIANT-CSUM",
299259
.generate_fn = my_generate_fn,
300260
.verify_fn = my_verify_fn,
301-
.get_tag_fn = my_get_tag_fn,
302-
.set_tag_fn = my_set_tag_fn,
303261
.tuple_size = sizeof(struct my_tuple_size),
304262
.tag_size = <tag bytes per hw sector>,
305263
};
@@ -321,7 +279,5 @@ will require extra work due to the application tag.
321279
are available per hardware sector. For DIF this is either 2 or
322280
0 depending on the value of the Control Mode Page ATO bit.
323281

324-
See 6.2 for a description of get_tag_fn and set_tag_fn.
325-
326282
----------------------------------------------------------------------
327283
2007-12-24 Martin K. Petersen <[email protected]>

block/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ config BLK_DEV_BSGLIB
7777

7878
config BLK_DEV_INTEGRITY
7979
bool "Block layer data integrity support"
80+
select CRC_T10DIF if BLK_DEV_INTEGRITY
8081
---help---
8182
Some storage devices allow extra information to be
8283
stored/retrieved to help protect the data. The block layer

block/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ obj-$(CONFIG_IOSCHED_DEADLINE) += deadline-iosched.o
2020
obj-$(CONFIG_IOSCHED_CFQ) += cfq-iosched.o
2121

2222
obj-$(CONFIG_BLOCK_COMPAT) += compat_ioctl.o
23-
obj-$(CONFIG_BLK_DEV_INTEGRITY) += blk-integrity.o
2423
obj-$(CONFIG_BLK_CMDLINE_PARSER) += cmdline-parser.o
25-
obj-$(CONFIG_BLK_DEV_INTEGRITY) += bio-integrity.o
24+
obj-$(CONFIG_BLK_DEV_INTEGRITY) += bio-integrity.o blk-integrity.o t10-pi.o
25+

0 commit comments

Comments
 (0)