Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 172895
b: refs/heads/master
c: d0634c4
h: refs/heads/master
i:
  172893: b2dbff1
  172891: 921655a
  172887: 1409377
  172879: 6fd5b98
  172863: 1cabe66
v: v3
  • Loading branch information
Martin K. Petersen authored and Jeff Garzik committed Dec 3, 2009
1 parent f5ea373 commit a793348
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e78db4dfb1355a895f7ea50133b702b55b8ed184
refs/heads/master: d0634c4aea0b80447cbdc4c0db285004b860c455
2 changes: 1 addition & 1 deletion trunk/drivers/ata/libata-scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2972,7 +2972,7 @@ static unsigned int ata_scsi_write_same_xlat(struct ata_queued_cmd *qc)
goto invalid_fld;

buf = page_address(sg_page(scsi_sglist(scmd)));
size = ata_set_lba_range_entries(buf, 512 / 8, block, n_block);
size = ata_set_lba_range_entries(buf, 512, block, n_block);

tf->protocol = ATA_PROT_DMA;
tf->hob_feature = 0;
Expand Down
20 changes: 10 additions & 10 deletions trunk/include/linux/ata.h
Original file line number Diff line number Diff line change
Expand Up @@ -982,17 +982,17 @@ static inline void ata_id_to_hd_driveid(u16 *id)
}

/*
* Write up to 'max' LBA Range Entries to the buffer that will cover the
* extent from sector to sector + count. This is used for TRIM and for
* ADD LBA(S) TO NV CACHE PINNED SET.
* Write LBA Range Entries to the buffer that will cover the extent from
* sector to sector + count. This is used for TRIM and for ADD LBA(S)
* TO NV CACHE PINNED SET.
*/
static inline unsigned ata_set_lba_range_entries(void *_buffer, unsigned max,
u64 sector, unsigned long count)
static inline unsigned ata_set_lba_range_entries(void *_buffer,
unsigned buf_size, u64 sector, unsigned long count)
{
__le64 *buffer = _buffer;
unsigned i = 0;
unsigned i = 0, used_bytes;

while (i < max) {
while (i < buf_size / 8 ) { /* 6-byte LBA + 2-byte range per entry */
u64 entry = sector |
((u64)(count > 0xffff ? 0xffff : count) << 48);
buffer[i++] = __cpu_to_le64(entry);
Expand All @@ -1002,9 +1002,9 @@ static inline unsigned ata_set_lba_range_entries(void *_buffer, unsigned max,
sector += 0xffff;
}

max = ALIGN(i * 8, 512);
memset(buffer + i, 0, max - i * 8);
return max;
used_bytes = ALIGN(i * 8, 512);
memset(buffer + i, 0, used_bytes - i * 8);
return used_bytes;
}

static inline int is_multi_taskfile(struct ata_taskfile *tf)
Expand Down

0 comments on commit a793348

Please sign in to comment.