Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 127879
b: refs/heads/master
c: e623ddb
h: refs/heads/master
i:
  127877: a6bf923
  127875: 348c53d
  127871: 262e8f9
v: v3
  • Loading branch information
FUJITA Tomonori authored and James Bottomley committed Jan 2, 2009
1 parent a771d0b commit 42aef75
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 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: 4f10aae0d1a285df6b16bf6ca5abd366140fd371
refs/heads/master: e623ddb4e940b266adc77ba1cc28a3554aa90e79
26 changes: 14 additions & 12 deletions trunk/fs/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,28 +815,30 @@ struct bio *bio_copy_user_iov(struct request_queue *q,

ret = 0;
i = 0;
if (map_data)
nr_pages = 1 << map_data->page_order;
while (len) {
unsigned int bytes;

if (map_data)
bytes = 1U << (PAGE_SHIFT + map_data->page_order);
else
bytes = PAGE_SIZE;
unsigned int bytes = PAGE_SIZE;

if (bytes > len)
bytes = len;

if (map_data) {
if (i == map_data->nr_entries) {
if (i == map_data->nr_entries * nr_pages) {
ret = -ENOMEM;
break;
}
page = map_data->pages[i++];
} else

page = map_data->pages[i / nr_pages];
page += (i % nr_pages);

i++;
} else {
page = alloc_page(q->bounce_gfp | gfp_mask);
if (!page) {
ret = -ENOMEM;
break;
if (!page) {
ret = -ENOMEM;
break;
}
}

if (bio_add_pc_page(q, bio, page, bytes, 0) < bytes)
Expand Down

0 comments on commit 42aef75

Please sign in to comment.