Re: [PATCH 1/7] ѕd: split sd_setup_discard_cmnd

2017-03-30 Thread h...@lst.de
On Tue, Mar 28, 2017 at 08:05:09AM -0600, ax...@kernel.dk wrote: > > Although I know this is an issue in the existing code and not something > > introduced by you: please consider using logical_to_sectors() instead of > > open-coding this function. Otherwise this patch looks fine to me. > > The

Re: [PATCH 1/7] ѕd: split sd_setup_discard_cmnd

2017-03-28 Thread ax...@kernel.dk
On Mon, Mar 27 2017, Bart Van Assche wrote: > On Mon, 2017-03-20 at 16:43 -0400, Christoph Hellwig wrote: > > + u64 sector = blk_rq_pos(rq) >> (ilog2(sdp->sector_size) - 9); > > + u32 nr_sectors = blk_rq_sectors(rq) >> (ilog2(sdp->sector_size) - 9); > > Although I know this is an issue in the

Re: [PATCH 1/7] ѕd: split sd_setup_discard_cmnd

2017-03-27 Thread Bart Van Assche
On Mon, 2017-03-20 at 16:43 -0400, Christoph Hellwig wrote: > + u64 sector = blk_rq_pos(rq) >> (ilog2(sdp->sector_size) - 9); > + u32 nr_sectors = blk_rq_sectors(rq) >> (ilog2(sdp->sector_size) - 9); Although I know this is an issue in the existing code and not something introduced by

[PATCH 1/7] ѕd: split sd_setup_discard_cmnd

2017-03-20 Thread Christoph Hellwig
Split sd_setup_discard_cmnd into one function per provisioning type. While this creates some very slight duplication of boilerplate code it keeps the code modular for additions of new provisioning types, and for reusing the write same functions for the upcoming scsi implementation of the Write