diff options
| author | Jiri Kosina <jkosina@suse.cz> | 2011-04-26 04:22:15 -0400 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2011-04-26 04:22:59 -0400 |
| commit | 07f9479a40cc778bc1462ada11f95b01360ae4ff (patch) | |
| tree | 0676cf38df3844004bb3ebfd99dfa67a4a8998f5 /net/9p/trans_common.c | |
| parent | 9d5e6bdb3013acfb311ab407eeca0b6a6a3dedbf (diff) | |
| parent | cd2e49e90f1cae7726c9a2c54488d881d7f1cd1c (diff) | |
Merge branch 'master' into for-next
Fast-forwarded to current state of Linus' tree as there are patches to be
applied for files that didn't exist on the old branch.
Diffstat (limited to 'net/9p/trans_common.c')
| -rw-r--r-- | net/9p/trans_common.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/net/9p/trans_common.c b/net/9p/trans_common.c index d62b9aa58df8..e883172f9aa2 100644 --- a/net/9p/trans_common.c +++ b/net/9p/trans_common.c | |||
| @@ -36,14 +36,14 @@ p9_release_req_pages(struct trans_rpage_info *rpinfo) | |||
| 36 | EXPORT_SYMBOL(p9_release_req_pages); | 36 | EXPORT_SYMBOL(p9_release_req_pages); |
| 37 | 37 | ||
| 38 | /** | 38 | /** |
| 39 | * p9_nr_pages - Return number of pages needed to accomodate the payload. | 39 | * p9_nr_pages - Return number of pages needed to accommodate the payload. |
| 40 | */ | 40 | */ |
| 41 | int | 41 | int |
| 42 | p9_nr_pages(struct p9_req_t *req) | 42 | p9_nr_pages(struct p9_req_t *req) |
| 43 | { | 43 | { |
| 44 | int start_page, end_page; | 44 | unsigned long start_page, end_page; |
| 45 | start_page = (unsigned long long)req->tc->pubuf >> PAGE_SHIFT; | 45 | start_page = (unsigned long)req->tc->pubuf >> PAGE_SHIFT; |
| 46 | end_page = ((unsigned long long)req->tc->pubuf + req->tc->pbuf_size + | 46 | end_page = ((unsigned long)req->tc->pubuf + req->tc->pbuf_size + |
| 47 | PAGE_SIZE - 1) >> PAGE_SHIFT; | 47 | PAGE_SIZE - 1) >> PAGE_SHIFT; |
| 48 | return end_page - start_page; | 48 | return end_page - start_page; |
| 49 | } | 49 | } |
| @@ -55,7 +55,7 @@ EXPORT_SYMBOL(p9_nr_pages); | |||
| 55 | * @req: Request to be sent to server. | 55 | * @req: Request to be sent to server. |
| 56 | * @pdata_off: data offset into the first page after translation (gup). | 56 | * @pdata_off: data offset into the first page after translation (gup). |
| 57 | * @pdata_len: Total length of the IO. gup may not return requested # of pages. | 57 | * @pdata_len: Total length of the IO. gup may not return requested # of pages. |
| 58 | * @nr_pages: number of pages to accomodate the payload | 58 | * @nr_pages: number of pages to accommodate the payload |
| 59 | * @rw: Indicates if the pages are for read or write. | 59 | * @rw: Indicates if the pages are for read or write. |
| 60 | */ | 60 | */ |
| 61 | int | 61 | int |
| @@ -66,11 +66,11 @@ p9_payload_gup(struct p9_req_t *req, size_t *pdata_off, int *pdata_len, | |||
| 66 | uint32_t pdata_mapped_pages; | 66 | uint32_t pdata_mapped_pages; |
| 67 | struct trans_rpage_info *rpinfo; | 67 | struct trans_rpage_info *rpinfo; |
| 68 | 68 | ||
| 69 | *pdata_off = (size_t)req->tc->pubuf & (PAGE_SIZE-1); | 69 | *pdata_off = (__force size_t)req->tc->pubuf & (PAGE_SIZE-1); |
| 70 | 70 | ||
| 71 | if (*pdata_off) | 71 | if (*pdata_off) |
| 72 | first_page_bytes = min((PAGE_SIZE - *pdata_off), | 72 | first_page_bytes = min(((size_t)PAGE_SIZE - *pdata_off), |
| 73 | req->tc->pbuf_size); | 73 | req->tc->pbuf_size); |
| 74 | 74 | ||
| 75 | rpinfo = req->tc->private; | 75 | rpinfo = req->tc->private; |
| 76 | pdata_mapped_pages = get_user_pages_fast((unsigned long)req->tc->pubuf, | 76 | pdata_mapped_pages = get_user_pages_fast((unsigned long)req->tc->pubuf, |
