Re: [PATCH v3 2/3] block: move dif_prepare/dif_complete functions to block layer

2018-07-25 Thread Keith Busch
On Wed, Jul 25, 2018 at 01:22:47PM +0200, Christoph Hellwig wrote: > > + pmap = kmap_atomic(iv.bv_page) + iv.bv_offset; > > + p = pmap; > > Maybe: > > pmap = p = kmap_atomic(iv.bv_page) + iv.bv_offset; Max pointed out that even with this,

Re: [PATCH v3 2/3] block: move dif_prepare/dif_complete functions to block layer

2018-07-25 Thread Max Gurtovoy
On 7/25/2018 2:22 PM, Christoph Hellwig wrote: + pmap = kmap_atomic(iv.bv_page) + iv.bv_offset; + p = pmap; Maybe: pmap = p = kmap_atomic(iv.bv_page) + iv.bv_offset; + for (j = 0; j < iv.bv_len; j +=

Re: [PATCH v3 2/3] block: move dif_prepare/dif_complete functions to block layer

2018-07-25 Thread Christoph Hellwig
> + pmap = kmap_atomic(iv.bv_page) + iv.bv_offset; > + p = pmap; Maybe: pmap = p = kmap_atomic(iv.bv_page) + iv.bv_offset; > + for (j = 0; j < iv.bv_len; j += tuple_sz) { > + pi = (str

[PATCH v3 2/3] block: move dif_prepare/dif_complete functions to block layer

2018-07-25 Thread Max Gurtovoy
Currently these functions are implemented in the scsi layer, but their actual place should be the block layer since T10-PI is a general data integrity feature that is used in the nvme protocol as well. Also, use the tuple size from the integrity profile since it may vary between integrity types. S