Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82614
b: refs/heads/master
c: 9135f19
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Feb 2, 2008
1 parent 9284fa9 commit b96be3e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 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: d59823fa44f7d9babf586b3c705db314aa0f9822
refs/heads/master: 9135f1901ee6449dfe338adf6e40e9c2025b8150
5 changes: 2 additions & 3 deletions trunk/drivers/ieee1394/sbp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1465,10 +1465,9 @@ static void sbp2_prep_command_orb_sg(struct sbp2_command_orb *orb,
orb->misc |= ORB_SET_DIRECTION(orb_direction);

/* special case if only one element (and less than 64KB in size) */
if ((scsi_use_sg == 1) &&
(sg_dma_len(sg) <= SBP2_MAX_SG_ELEMENT_LENGTH)) {
if (scsi_use_sg == 1 && sg->length <= SBP2_MAX_SG_ELEMENT_LENGTH) {

cmd->dma_size = sg_dma_len(sg);
cmd->dma_size = sg->length;
cmd->dma_type = CMD_DMA_PAGE;
cmd->cmd_dma = dma_map_page(hi->host->device.parent,
sg_page(sg), sg->offset,
Expand Down
8 changes: 6 additions & 2 deletions trunk/mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1750,7 +1750,11 @@ static void __iov_iter_advance_iov(struct iov_iter *i, size_t bytes)
const struct iovec *iov = i->iov;
size_t base = i->iov_offset;

while (bytes) {
/*
* The !iov->iov_len check ensures we skip over unlikely
* zero-length segments.
*/
while (bytes || !iov->iov_len) {
int copy = min(bytes, iov->iov_len - base);

bytes -= copy;
Expand Down Expand Up @@ -2268,6 +2272,7 @@ static ssize_t generic_perform_write(struct file *file,

cond_resched();

iov_iter_advance(i, copied);
if (unlikely(copied == 0)) {
/*
* If we were unable to copy any data at all, we must
Expand All @@ -2281,7 +2286,6 @@ static ssize_t generic_perform_write(struct file *file,
iov_iter_single_seg_count(i));
goto again;
}
iov_iter_advance(i, copied);
pos += copied;
written += copied;

Expand Down

0 comments on commit b96be3e

Please sign in to comment.