Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 214393
b: refs/heads/master
c: d37c935
h: refs/heads/master
i:
  214391: 4cfb768
v: v3
  • Loading branch information
Andy Grover committed Sep 9, 2010
1 parent 3a202ea commit 1a6ba38
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 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: c8de3f1005e8359ea07083e37f3f993646e1adba
refs/heads/master: d37c9359056f4f07b37e59810f0ece1031e280b2
15 changes: 13 additions & 2 deletions trunk/net/rds/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ static int rds_loop_xmit(struct rds_connection *conn, struct rds_message *rm,
BUG_ON(hdr_off || sg || off);

rds_inc_init(&rm->m_inc, conn, conn->c_laddr);
rds_message_addref(rm); /* for the inc */
/* For the embedded inc. Matching put is in loop_inc_free() */
rds_message_addref(rm);

rds_recv_incoming(conn, conn->c_laddr, conn->c_faddr, &rm->m_inc,
GFP_KERNEL, KM_USER0);
Expand All @@ -77,6 +78,16 @@ static int rds_loop_xmit(struct rds_connection *conn, struct rds_message *rm,
return sizeof(struct rds_header) + be32_to_cpu(rm->m_inc.i_hdr.h_len);
}

/*
* See rds_loop_xmit(). Since our inc is embedded in the rm, we
* make sure the rm lives at least until the inc is done.
*/
static void rds_loop_inc_free(struct rds_incoming *inc)
{
struct rds_message *rm = container_of(inc, struct rds_message, m_inc);
rds_message_put(rm);
}

static int rds_loop_xmit_cong_map(struct rds_connection *conn,
struct rds_cong_map *map,
unsigned long offset)
Expand Down Expand Up @@ -176,6 +187,6 @@ struct rds_transport rds_loop_transport = {
.conn_connect = rds_loop_conn_connect,
.conn_shutdown = rds_loop_conn_shutdown,
.inc_copy_to_user = rds_message_inc_copy_to_user,
.inc_free = rds_message_inc_free,
.inc_free = rds_loop_inc_free,
.t_name = "loopback",
};
6 changes: 0 additions & 6 deletions trunk/net/rds/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,6 @@ void rds_message_put(struct rds_message *rm)
}
EXPORT_SYMBOL_GPL(rds_message_put);

void rds_message_inc_free(struct rds_incoming *inc)
{
struct rds_message *rm = container_of(inc, struct rds_message, m_inc);
rds_message_put(rm);
}

void rds_message_populate_header(struct rds_header *hdr, __be16 sport,
__be16 dport, u64 seq)
{
Expand Down

0 comments on commit 1a6ba38

Please sign in to comment.