]> git.karo-electronics.de Git - linux-beck.git/commitdiff
RDS: rds_inc_path_init() helper function for MP capable transports
authorSowmini Varadhan <sowmini.varadhan@oracle.com>
Mon, 13 Jun 2016 16:44:29 +0000 (09:44 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Jun 2016 06:50:42 +0000 (23:50 -0700)
t_mp_capable transports can use rds_inc_path_init to initialize
all fields in struct rds_incoming, including the i_conn_path.

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rds/rds.h
net/rds/recv.c

index 7c85b2d792b6f7e8319404080e2492fec79e776f..c3b14ccd703703f1673d21ce1b07bcd4de5a7ae7 100644 (file)
@@ -764,6 +764,8 @@ void rds_page_exit(void);
 /* recv.c */
 void rds_inc_init(struct rds_incoming *inc, struct rds_connection *conn,
                  __be32 saddr);
+void rds_inc_path_init(struct rds_incoming *inc, struct rds_conn_path *conn,
+                      __be32 saddr);
 void rds_inc_put(struct rds_incoming *inc);
 void rds_recv_incoming(struct rds_connection *conn, __be32 saddr, __be32 daddr,
                       struct rds_incoming *inc, gfp_t gfp);
index e36652cfbd35ac0e0332820918e0873e4e2c4683..6d7bd63121fcccc75348a79b758149cd20cba170 100644 (file)
@@ -53,6 +53,20 @@ void rds_inc_init(struct rds_incoming *inc, struct rds_connection *conn,
 }
 EXPORT_SYMBOL_GPL(rds_inc_init);
 
+void rds_inc_path_init(struct rds_incoming *inc, struct rds_conn_path *cp,
+                      __be32 saddr)
+{
+       atomic_set(&inc->i_refcount, 1);
+       INIT_LIST_HEAD(&inc->i_item);
+       inc->i_conn = cp->cp_conn;
+       inc->i_conn_path = cp;
+       inc->i_saddr = saddr;
+       inc->i_rdma_cookie = 0;
+       inc->i_rx_tstamp.tv_sec = 0;
+       inc->i_rx_tstamp.tv_usec = 0;
+}
+EXPORT_SYMBOL_GPL(rds_inc_path_init);
+
 static void rds_inc_addref(struct rds_incoming *inc)
 {
        rdsdebug("addref inc %p ref %d\n", inc, atomic_read(&inc->i_refcount));