Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1459323

Re: [PATCH v5 1/2] Use kmap_atomic when rewriting attached page

From Shaun Tancheff <shaun.tancheff@seagate.com>
Newsgroups linux.kernel
Subject Re: [PATCH v5 1/2] Use kmap_atomic when rewriting attached page
Date 2016-08-10 20:10 +0200
Message-ID <s4G71-8uN-93@gated-at.bofh.it> (permalink)
References <s4qbT-6NI-5@gated-at.bofh.it> <s4qbT-6NI-15@gated-at.bofh.it> <s4G71-8uN-95@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Aug 10, 2016 at 5:56 AM, Tom Yan <tom.ty89@gmail.com> wrote:
> On 10 August 2016 at 09:00, Shaun Tancheff <shaun@tancheff.com> wrote:
>>  static unsigned int ata_scsi_write_same_xlat(struct ata_queued_cmd *qc)
>>  {
>>         struct ata_taskfile *tf = &qc->tf;
>>         struct scsi_cmnd *scmd = qc->scsicmd;
>>         struct ata_device *dev = qc->dev;
>>         const u8 *cdb = scmd->cmnd;
>> +       struct scatterlist *sg;
>>         u64 block;
>>         u32 n_block;
>> +       const u32 trmax = ATA_MAX_TRIM_RNUM;
>>         u32 size;
>> -       void *buf;
>>         u16 fp;
>>         u8 bp = 0xff;
>>
>> @@ -3319,10 +3363,9 @@ static unsigned int ata_scsi_write_same_xlat(struct ata_queued_cmd *qc)
>>         if (!scsi_sg_count(scmd))
>>                 goto invalid_param_len;
>>
>> -       buf = page_address(sg_page(scsi_sglist(scmd)));
>> -
>> -       if (n_block <= 65535 * ATA_MAX_TRIM_RNUM) {
>> -               size = ata_set_lba_range_entries(buf, ATA_MAX_TRIM_RNUM, block, n_block);
>> +       sg = scsi_sglist(scmd);
>> +       if (n_block <= 0xffff * cmax) {
>
> Although this got moved and corrected in the next patch, but perhaps
> you should still correct the `cmax` here, which should be `trmax`.

You are correct. I will fix this up. Thanks!

>> +               size = ata_format_dsm_trim_descr(sg, trmax, block, n_block);
>>         } else {
>>                 fp = 2;
>>                 goto invalid_fld;



-- 
Shaun Tancheff

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v5 0/2] Add support for SCT Write Same Shaun Tancheff <shaun@tancheff.com> - 2016-08-10 03:10 +0200
  [PATCH v5 1/2] Use kmap_atomic when rewriting attached page Shaun Tancheff <shaun@tancheff.com> - 2016-08-10 03:10 +0200
    Re: [PATCH v5 1/2] Use kmap_atomic when rewriting attached page Shaun Tancheff <shaun.tancheff@seagate.com> - 2016-08-10 20:10 +0200
    Re: [PATCH v5 1/2] Use kmap_atomic when rewriting attached page Tom Yan <tom.ty89@gmail.com> - 2016-08-10 21:40 +0200

csiph-web