Whamcloud - gitweb
LU-10472 osd-ldiskfs: T10PI between RPC and BIO
[fs/lustre-release.git] / lustre / kernel_patches / patches / block-pass-bio-into-integrity_processing_fn-rhel7.patch
1 Having struct bio allows us to do more in the genrate/verify_fn,
2 like copying a known good guard tag already available rather than
3 calculating it.
4
5 Index: linux-3.10.0-862.9.1.el7/fs/bio-integrity.c
6 ===================================================================
7 --- linux-3.10.0-862.9.1.el7.orig/fs/bio-integrity.c
8 +++ linux-3.10.0-862.9.1.el7/fs/bio-integrity.c
9 @@ -334,6 +334,8 @@ static void bio_integrity_generate(struc
10                 bix.data_size = bv->bv_len;
11                 bix.prot_buf = prot_buf;
12                 bix.sector = sector;
13 +               bix.bio = bio;
14 +               bix.bi_idx = i;
15  
16                 generate_fn(&bix);
17  
18 @@ -485,6 +487,8 @@ static int bio_integrity_verify(struct b
19                 bix.data_size = bv->bv_len;
20                 bix.prot_buf = prot_buf;
21                 bix.sector = sector;
22 +               bix.bio = bio;
23 +               bix.bi_idx = i;
24  
25                 ret = verify_fn(&bix);
26  
27 Index: linux-3.10.0-862.9.1.el7/include/linux/blkdev.h
28 ===================================================================
29 --- linux-3.10.0-862.9.1.el7.orig/include/linux/blkdev.h
30 +++ linux-3.10.0-862.9.1.el7/include/linux/blkdev.h
31 @@ -1696,8 +1696,10 @@ static inline uint64_t rq_io_start_time_
32  struct blk_integrity_exchg {
33         void                    *prot_buf;
34         void                    *data_buf;
35 +       struct bio              *bio;
36         sector_t                sector;
37         unsigned int            data_size;
38 +       unsigned int            bi_idx;
39         unsigned short          sector_size;
40         const char              *disk_name;
41  };