RDS: Add rds_conn_path_error()
authorSowmini Varadhan <sowmini.varadhan@oracle.com>
Mon, 13 Jun 2016 16:44:39 +0000 (09:44 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Jun 2016 06:50:43 +0000 (23:50 -0700)
rds_conn_path_error() is the MP-aware analog of rds_conn_error,
to be used by multipath-capable callers.

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

index 9e0b489aea4135f5db6267558421dae1c4f27e75..57556e615ce257723d2f37ca72141bc77de437ad 100644 (file)
@@ -655,3 +655,15 @@ __rds_conn_error(struct rds_connection *conn, const char *fmt, ...)
 
        rds_conn_drop(conn);
 }
+
+void
+__rds_conn_path_error(struct rds_conn_path *cp, const char *fmt, ...)
+{
+       va_list ap;
+
+       va_start(ap, fmt);
+       vprintk(fmt, ap);
+       va_end(ap);
+
+       rds_conn_path_drop(cp);
+}
index 74fcf5a28723bb72b2afa10dd038be5c5ccaf539..85f98bd88c1cdfa93e08d77c51db376eab81e953 100644 (file)
@@ -669,6 +669,10 @@ void __rds_conn_error(struct rds_connection *conn, const char *, ...);
 #define rds_conn_error(conn, fmt...) \
        __rds_conn_error(conn, KERN_WARNING "RDS: " fmt)
 
+void __rds_conn_path_error(struct rds_conn_path *cp, const char *, ...);
+#define rds_conn_path_error(cp, fmt...) \
+       __rds_conn_path_error(cp, KERN_WARNING "RDS: " fmt)
+
 static inline int
 rds_conn_path_transition(struct rds_conn_path *cp, int old, int new)
 {
index 50d26576dee7acd8f1ad4ed29d384a8a8e778225..94cca66ba5d657bf1686017fbbc91688297d15b0 100644 (file)
@@ -163,7 +163,8 @@ void rds_connect_worker(struct work_struct *work)
                                                     RDS_CONN_DOWN))
                                rds_queue_reconnect(cp);
                        else
-                               rds_conn_error(conn, "RDS: connect failed\n");
+                               rds_conn_path_error(cp,
+                                                   "RDS: connect failed\n");
                }
        }
 }