diff options
author | Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com> | 2011-01-28 17:11:13 -0500 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2011-03-15 10:57:34 -0400 |
commit | 022cae36551ba805bf82084047945b2901d75f36 (patch) | |
tree | 5d8a8ff0eb2102d0449f58ddfcb8907bd3625682 /net/9p/trans_common.h | |
parent | 6752a1ebd13f69b9d5ff08914fe29ee2813cbeea (diff) |
[net/9p] Preparation and helper functions for zero copy
This patch prepares p9_fcall structure for zero copy. Added
fields send the payload buffer information to the transport layer.
In addition it adds a 'private' field for the transport layer to
store mapped/pinned page information so that it can be freed/unpinned
during req_done.
This patch also creates trans_common.[ch] to house helper functions.
It adds the following helper functions.
p9_release_req_pages - Release pages after the transaction.
p9_nr_pages - Return number of pages needed to accomodate the payload.
payload_gup - Translates user buffer into kernel pages.
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net/9p/trans_common.h')
-rw-r--r-- | net/9p/trans_common.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/net/9p/trans_common.h b/net/9p/trans_common.h new file mode 100644 index 00000000000..04977e0ad93 --- /dev/null +++ b/net/9p/trans_common.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * Copyright IBM Corporation, 2010 | ||
3 | * Author Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms of version 2.1 of the GNU Lesser General Public License | ||
7 | * as published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope that it would be useful, but | ||
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | /** | ||
16 | * struct trans_rpage_info - To store mapped page information in PDU. | ||
17 | * @rp_alloc:Set if this structure is allocd, not a reuse unused space in pdu. | ||
18 | * @rp_nr_pages: Number of mapped pages | ||
19 | * @rp_data: Array of page pointers | ||
20 | */ | ||
21 | struct trans_rpage_info { | ||
22 | u8 rp_alloc; | ||
23 | int rp_nr_pages; | ||
24 | struct page *rp_data[0]; | ||
25 | }; | ||
26 | |||
27 | void p9_release_req_pages(struct trans_rpage_info *); | ||
28 | int p9_payload_gup(struct p9_req_t *, size_t *, int *, int, u8); | ||
29 | int p9_nr_pages(struct p9_req_t *); | ||