aboutsummaryrefslogtreecommitdiffstats
path: root/net/rds/rds.h
diff options
context:
space:
mode:
authorAndy Grover <andy.grover@oracle.com>2010-01-12 15:56:06 -0500
committerAndy Grover <andy.grover@oracle.com>2010-09-08 21:11:36 -0400
commitfc445084f185cdd877bec323bfe724a361e2292a (patch)
treeeda014c09872cbbacc411ea3b89f359291ccb577 /net/rds/rds.h
parent3ef13f3c22aaea28aff383cb0883481d24885456 (diff)
RDS: Explicitly allocate rm in sendmsg()
r_m_copy_from_user used to allocate the rm as well as kernel buffers for the data, and then copy the data in. Now, sendmsg() allocates the rm, although the data buffer alloc still happens in r_m_copy_from_user. SGs are still allocated with rm, but now r_m_alloc_sgs() is used to reserve them. This allows multiple SG lists to be allocated from the one rm -- this is important once we also want to alloc our rdma sgl from this pool. Signed-off-by: Andy Grover <andy.grover@oracle.com>
Diffstat (limited to 'net/rds/rds.h')
-rw-r--r--net/rds/rds.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/rds/rds.h b/net/rds/rds.h
index 07a750b3fb31..d29c71aabbd4 100644
--- a/net/rds/rds.h
+++ b/net/rds/rds.h
@@ -268,9 +268,11 @@ struct rds_message {
268 struct { 268 struct {
269 unsigned int m_nents; 269 unsigned int m_nents;
270 unsigned int m_count; 270 unsigned int m_count;
271 struct scatterlist m_sg[0]; 271 struct scatterlist *m_sg;
272 } data; 272 } data;
273 }; 273 };
274 unsigned int m_used_sgs;
275 unsigned int m_total_sgs;
274}; 276};
275 277
276/* 278/*
@@ -573,7 +575,8 @@ rds_conn_connecting(struct rds_connection *conn)
573 575
574/* message.c */ 576/* message.c */
575struct rds_message *rds_message_alloc(unsigned int nents, gfp_t gfp); 577struct rds_message *rds_message_alloc(unsigned int nents, gfp_t gfp);
576struct rds_message *rds_message_copy_from_user(struct iovec *first_iov, 578struct scatterlist *rds_message_alloc_sgs(struct rds_message *rm, int nents);
579int rds_message_copy_from_user(struct rds_message *rm, struct iovec *first_iov,
577 size_t total_len); 580 size_t total_len);
578struct rds_message *rds_message_map_pages(unsigned long *page_addrs, unsigned int total_len); 581struct rds_message *rds_message_map_pages(unsigned long *page_addrs, unsigned int total_len);
579void rds_message_populate_header(struct rds_header *hdr, __be16 sport, 582void rds_message_populate_header(struct rds_header *hdr, __be16 sport,