Re: [PATCH v5 2/2] libata-scsi: avoid repeated calculation of number of TRIM ranges

2016-07-12 Thread Tejun Heo
Hello, On Thu, Jul 07, 2016 at 01:19:06AM +0800, tom.t...@gmail.com wrote: > @@ -1071,7 +1072,7 @@ static inline unsigned ata_set_lba_range_entries(void > *_buffer, > __le64 *buffer = _buffer; > unsigned i = 0, used_bytes; > > - while (i < buf_size / 8 ) { /* 6-byte LBA + 2-byte

[PATCH v5 2/2] libata-scsi: avoid repeated calculation of number of TRIM ranges

2016-07-06 Thread tom . ty89
From: Tom Yan Currently libata statically allows only 1-block (512-byte) payload for each TRIM command. Each payload can carry 64 TRIM ranges since each range requires 8 bytes. It is silly to keep doing the calculation (512 / 8) in different places. Hence, define the new ATA_MAX_TRIM_RNUM for th