Whamcloud - gitweb
LU-15160 kernel: kernel update SLES12 SP5 [4.12.14-122.91.2]
[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.bi_idx = i;
14 +               bix.bio = bio;
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.bi_idx = i;
23 +               bix.bio = bio;
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 @@ -1699,7 +1699,9 @@ struct blk_integrity_exchg {
32         sector_t                sector;
33         unsigned int            data_size;
34         unsigned short          sector_size;
35 +       unsigned short          bi_idx;
36         const char              *disk_name;
37 +       struct bio              *bio;
38  };
39  
40  typedef void (integrity_set_tag_fn) (void *, void *, unsigned int);