diff options
Diffstat (limited to 'drivers/staging/lustre/lnet')
24 files changed, 197 insertions, 246 deletions
diff --git a/drivers/staging/lustre/lnet/Makefile b/drivers/staging/lustre/lnet/Makefile index 374212b1555a..f6f03e304d81 100644 --- a/drivers/staging/lustre/lnet/Makefile +++ b/drivers/staging/lustre/lnet/Makefile @@ -1 +1 @@ -obj-$(CONFIG_LNET) := klnds/ lnet/ selftest/ +obj-$(CONFIG_LNET) += lnet/ klnds/ selftest/ diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c index 29a97943e4c7..86397f96b033 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c @@ -702,6 +702,8 @@ kiblnd_get_completion_vector(kib_conn_t *conn, int cpt) return 0; mask = cfs_cpt_cpumask(lnet_cpt_table(), cpt); + if (mask == NULL) + return 0; /* hash NID to CPU id in this partition... */ off = do_div(nid, cpus_weight(*mask)); @@ -2574,8 +2576,8 @@ kiblnd_dev_need_failover(kib_dev_t *dev) rc = rdma_resolve_addr(cmid, (struct sockaddr *)&srcaddr, (struct sockaddr *)&dstaddr, 1); if (rc != 0 || cmid->device == NULL) { - CERROR("Failed to bind %s:%u.%u.%u.%u to device(%p): %d\n", - dev->ibd_ifname, HIPQUAD(dev->ibd_ifip), + CERROR("Failed to bind %s:%pI4h to device(%p): %d\n", + dev->ibd_ifname, &dev->ibd_ifip, cmid->device, rc); rdma_destroy_id(cmid); return rc; @@ -2647,8 +2649,8 @@ kiblnd_dev_failover(kib_dev_t *dev) /* Bind to failover device or port */ rc = rdma_bind_addr(cmid, (struct sockaddr *)&addr); if (rc != 0 || cmid->device == NULL) { - CERROR("Failed to bind %s:%u.%u.%u.%u to device(%p): %d\n", - dev->ibd_ifname, HIPQUAD(dev->ibd_ifip), + CERROR("Failed to bind %s:%pI4h to device(%p): %d\n", + dev->ibd_ifname, &dev->ibd_ifip, cmid->device, rc); rdma_destroy_id(cmid); goto out; diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h index e4626bf82fc7..938df0cf8c64 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h @@ -53,7 +53,6 @@ #include <linux/init.h> #include <linux/fs.h> #include <linux/file.h> -#include <linux/stat.h> #include <linux/list.h> #include <linux/kmod.h> #include <linux/sysctl.h> diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c index cc6232126dd0..086ca3d7241b 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c @@ -1319,9 +1319,9 @@ kiblnd_connect_peer (kib_peer_t *peer) } LASSERT (cmid->device != NULL); - CDEBUG(D_NET, "%s: connection bound to %s:%u.%u.%u.%u:%s\n", + CDEBUG(D_NET, "%s: connection bound to %s:%pI4h:%s\n", libcfs_nid2str(peer->ibp_nid), dev->ibd_ifname, - HIPQUAD(dev->ibd_ifip), cmid->device->name); + &dev->ibd_ifip, cmid->device->name); return; @@ -1802,7 +1802,7 @@ kiblnd_recv (lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg, int delayed, int kiblnd_thread_start(int (*fn)(void *arg), void *arg, char *name) { - task_t *task = kthread_run(fn, arg, name); + struct task_struct *task = kthread_run(fn, arg, name); if (IS_ERR(task)) return PTR_ERR(task); @@ -2209,8 +2209,8 @@ kiblnd_passive_connect (struct rdma_cm_id *cmid, void *priv, int priv_nob) if (*kiblnd_tunables.kib_require_priv_port && ntohs(peer_addr->sin_port) >= PROT_SOCK) { __u32 ip = ntohl(peer_addr->sin_addr.s_addr); - CERROR("Peer's port (%u.%u.%u.%u:%hu) is not privileged\n", - HIPQUAD(ip), ntohs(peer_addr->sin_port)); + CERROR("Peer's port (%pI4h:%hu) is not privileged\n", + &ip, ntohs(peer_addr->sin_port)); goto failed; } @@ -2254,11 +2254,11 @@ kiblnd_passive_connect (struct rdma_cm_id *cmid, void *priv, int priv_nob) if (ni == NULL || /* no matching net */ ni->ni_nid != reqmsg->ibm_dstnid || /* right NET, wrong NID! */ net->ibn_dev != ibdev) { /* wrong device */ - CERROR("Can't accept %s on %s (%s:%d:%u.%u.%u.%u): " + CERROR("Can't accept %s on %s (%s:%d:%pI4h): " "bad dst nid %s\n", libcfs_nid2str(nid), ni == NULL ? "NA" : libcfs_nid2str(ni->ni_nid), ibdev->ibd_ifname, ibdev->ibd_nnets, - HIPQUAD(ibdev->ibd_ifip), + &ibdev->ibd_ifip, libcfs_nid2str(reqmsg->ibm_dstnid)); goto failed; diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c index e21028b72302..92dc5672e2dd 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c @@ -404,7 +404,7 @@ kiblnd_sysctl_init (void) sizeof(ipif_basename_space)); kiblnd_tunables.kib_sysctl = - cfs_register_sysctl_table(kiblnd_top_ctl_table, 0); + register_sysctl_table(kiblnd_top_ctl_table); if (kiblnd_tunables.kib_sysctl == NULL) CWARN("Can't setup /proc tunables\n"); diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c index c826bf9d49ac..6825b452e5fe 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c @@ -334,17 +334,17 @@ ksocknal_associate_route_conn_locked(ksock_route_t *route, ksock_conn_t *conn) if (route->ksnr_myipaddr != conn->ksnc_myipaddr) { if (route->ksnr_myipaddr == 0) { /* route wasn't bound locally yet (the initial route) */ - CDEBUG(D_NET, "Binding %s %u.%u.%u.%u to %u.%u.%u.%u\n", + CDEBUG(D_NET, "Binding %s %pI4h to %pI4h\n", libcfs_id2str(peer->ksnp_id), - HIPQUAD(route->ksnr_ipaddr), - HIPQUAD(conn->ksnc_myipaddr)); + &route->ksnr_ipaddr, + &conn->ksnc_myipaddr); } else { - CDEBUG(D_NET, "Rebinding %s %u.%u.%u.%u from " - "%u.%u.%u.%u to %u.%u.%u.%u\n", + CDEBUG(D_NET, "Rebinding %s %pI4h from " + "%pI4h to %pI4h\n", libcfs_id2str(peer->ksnp_id), - HIPQUAD(route->ksnr_ipaddr), - HIPQUAD(route->ksnr_myipaddr), - HIPQUAD(conn->ksnc_myipaddr)); + &route->ksnr_ipaddr, + &route->ksnr_myipaddr, + &conn->ksnc_myipaddr); iface = ksocknal_ip2iface(route->ksnr_peer->ksnp_ni, route->ksnr_myipaddr); @@ -384,9 +384,9 @@ ksocknal_add_route_locked (ksock_peer_t *peer, ksock_route_t *route) route2 = list_entry(tmp, ksock_route_t, ksnr_list); if (route2->ksnr_ipaddr == route->ksnr_ipaddr) { - CERROR ("Duplicate route %s %u.%u.%u.%u\n", + CERROR("Duplicate route %s %pI4h\n", libcfs_id2str(peer->ksnp_id), - HIPQUAD(route->ksnr_ipaddr)); + &route->ksnr_ipaddr); LBUG(); } } @@ -982,8 +982,8 @@ ksocknal_accept (lnet_ni_t *ni, socket_t *sock) LIBCFS_ALLOC(cr, sizeof(*cr)); if (cr == NULL) { LCONSOLE_ERROR_MSG(0x12f, "Dropping connection request from " - "%u.%u.%u.%u: memory exhausted\n", - HIPQUAD(peer_ip)); + "%pI4h: memory exhausted\n", + &peer_ip); return -ENOMEM; } @@ -1236,10 +1236,10 @@ ksocknal_create_conn (lnet_ni_t *ni, ksock_route_t *route, * code below probably isn't going to work. */ if (active && route->ksnr_ipaddr != conn->ksnc_ipaddr) { - CERROR("Route %s %u.%u.%u.%u connected to %u.%u.%u.%u\n", + CERROR("Route %s %pI4h connected to %pI4h\n", libcfs_id2str(peer->ksnp_id), - HIPQUAD(route->ksnr_ipaddr), - HIPQUAD(conn->ksnc_ipaddr)); + &route->ksnr_ipaddr, + &conn->ksnc_ipaddr); } /* Search for a route corresponding to the new connection and @@ -1297,10 +1297,10 @@ ksocknal_create_conn (lnet_ni_t *ni, ksock_route_t *route, * socket callbacks. */ - CDEBUG(D_NET, "New conn %s p %d.x %u.%u.%u.%u -> %u.%u.%u.%u/%d" + CDEBUG(D_NET, "New conn %s p %d.x %pI4h -> %pI4h/%d" " incarnation:"LPD64" sched[%d:%d]\n", libcfs_id2str(peerid), conn->ksnc_proto->pro_version, - HIPQUAD(conn->ksnc_myipaddr), HIPQUAD(conn->ksnc_ipaddr), + &conn->ksnc_myipaddr, &conn->ksnc_ipaddr, conn->ksnc_port, incarnation, cpt, (int)(sched - &sched->kss_info->ksi_scheds[0])); @@ -1441,7 +1441,7 @@ ksocknal_close_conn_locked (ksock_conn_t *conn, int error) conn->ksnc_route = NULL; -#if 0 /* irrelevent with only eager routes */ +#if 0 /* irrelevant with only eager routes */ /* make route least favourite */ list_del (&route->ksnr_list); list_add_tail (&route->ksnr_list, &peer->ksnp_routes); @@ -1496,7 +1496,7 @@ ksocknal_peer_failed (ksock_peer_t *peer) /* There has been a connection failure or comms error; but I'll only * tell LNET I think the peer is dead if it's to another kernel and - * there are no connections or connection attempts in existance. */ + * there are no connections or connection attempts in existence. */ read_lock(&ksocknal_data.ksnd_global_lock); @@ -1648,10 +1648,10 @@ ksocknal_destroy_conn (ksock_conn_t *conn) last_rcv = conn->ksnc_rx_deadline - cfs_time_seconds(*ksocknal_tunables.ksnd_timeout); CERROR("Completing partial receive from %s[%d]" - ", ip %d.%d.%d.%d:%d, with error, wanted: %d, left: %d, " + ", ip %pI4h:%d, with error, wanted: %d, left: %d, " "last alive is %ld secs ago\n", libcfs_id2str(conn->ksnc_peer->ksnp_id), conn->ksnc_type, - HIPQUAD(conn->ksnc_ipaddr), conn->ksnc_port, + &conn->ksnc_ipaddr, conn->ksnc_port, conn->ksnc_rx_nob_wanted, conn->ksnc_rx_nob_left, cfs_duration_sec(cfs_time_sub(cfs_time_current(), last_rcv))); @@ -1661,25 +1661,25 @@ ksocknal_destroy_conn (ksock_conn_t *conn) case SOCKNAL_RX_LNET_HEADER: if (conn->ksnc_rx_started) CERROR("Incomplete receive of lnet header from %s" - ", ip %d.%d.%d.%d:%d, with error, protocol: %d.x.\n", + ", ip %pI4h:%d, with error, protocol: %d.x.\n", libcfs_id2str(conn->ksnc_peer->ksnp_id), - HIPQUAD(conn->ksnc_ipaddr), conn->ksnc_port, + &conn->ksnc_ipaddr, conn->ksnc_port, conn->ksnc_proto->pro_version); break; case SOCKNAL_RX_KSM_HEADER: if (conn->ksnc_rx_started) CERROR("Incomplete receive of ksock message from %s" - ", ip %d.%d.%d.%d:%d, with error, protocol: %d.x.\n", + ", ip %pI4h:%d, with error, protocol: %d.x.\n", libcfs_id2str(conn->ksnc_peer->ksnp_id), - HIPQUAD(conn->ksnc_ipaddr), conn->ksnc_port, + &conn->ksnc_ipaddr, conn->ksnc_port, conn->ksnc_proto->pro_version); break; case SOCKNAL_RX_SLOP: if (conn->ksnc_rx_started) CERROR("Incomplete receive of slops from %s" - ", ip %d.%d.%d.%d:%d, with error\n", + ", ip %pI4h:%d, with error\n", libcfs_id2str(conn->ksnc_peer->ksnp_id), - HIPQUAD(conn->ksnc_ipaddr), conn->ksnc_port); + &conn->ksnc_ipaddr, conn->ksnc_port); break; default: LBUG (); @@ -2358,7 +2358,7 @@ ksocknal_new_incarnation (void) /* The incarnation number is the time this module loaded and it * identifies this particular instance of the socknal. Hopefully * we won't be able to reboot more frequently than 1MHz for the - * forseeable future :) */ + * foreseeable future :) */ do_gettimeofday(&tv); @@ -2898,5 +2898,7 @@ ksocknal_module_init (void) MODULE_AUTHOR("Sun Microsystems, Inc. <http://www.lustre.org/>"); MODULE_DESCRIPTION("Kernel TCP Socket LND v3.0.0"); MODULE_LICENSE("GPL"); +MODULE_VERSION("3.0.0"); -cfs_module(ksocknal, "3.0.0", ksocknal_module_init, ksocknal_module_fini); +module_init(ksocknal_module_init); +module_exit(ksocknal_module_fini); diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c index ad5e24104238..2c581b7fa8ad 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c @@ -343,7 +343,6 @@ ksocknal_receive (ksock_conn_t *conn) * Caller checks ksnc_rx_nob_wanted to determine * progress/completion. */ int rc; - ENTRY; if (ksocknal_data.ksnd_stall_rx != 0) { cfs_pause(cfs_time_seconds (ksocknal_data.ksnd_stall_rx)); @@ -381,7 +380,7 @@ ksocknal_receive (ksock_conn_t *conn) } ksocknal_connsock_decref(conn); - RETURN (rc); + return rc; } void @@ -389,7 +388,6 @@ ksocknal_tx_done (lnet_ni_t *ni, ksock_tx_t *tx) { lnet_msg_t *lnetmsg = tx->tx_lnetmsg; int rc = (tx->tx_resid == 0 && !tx->tx_zc_aborted) ? 0 : -EIO; - ENTRY; LASSERT(ni != NULL || tx->tx_conn != NULL); @@ -402,8 +400,6 @@ ksocknal_tx_done (lnet_ni_t *ni, ksock_tx_t *tx) ksocknal_free_tx (tx); if (lnetmsg != NULL) /* KSOCK_MSG_NOOP go without lnetmsg */ lnet_finalize (ni, lnetmsg, rc); - - EXIT; } void @@ -553,21 +549,21 @@ ksocknal_process_transmit (ksock_conn_t *conn, ksock_tx_t *tx) if (!conn->ksnc_closing) { switch (rc) { case -ECONNRESET: - LCONSOLE_WARN("Host %u.%u.%u.%u reset our connection " + LCONSOLE_WARN("Host %pI4h reset our connection " "while we were sending data; it may have " "rebooted.\n", - HIPQUAD(conn->ksnc_ipaddr)); + &conn->ksnc_ipaddr); break; default: LCONSOLE_WARN("There was an unexpected network error " - "while writing to %u.%u.%u.%u: %d.\n", - HIPQUAD(conn->ksnc_ipaddr), rc); + "while writing to %pI4h: %d.\n", + &conn->ksnc_ipaddr, rc); break; } CDEBUG(D_NET, "[%p] Error %d on write to %s" - " ip %d.%d.%d.%d:%d\n", conn, rc, + " ip %pI4h:%d\n", conn, rc, libcfs_id2str(conn->ksnc_peer->ksnp_id), - HIPQUAD(conn->ksnc_ipaddr), + &conn->ksnc_ipaddr, conn->ksnc_port); } @@ -700,9 +696,9 @@ ksocknal_queue_tx_locked (ksock_tx_t *tx, ksock_conn_t *conn) * ksnc_sock... */ LASSERT(!conn->ksnc_closing); - CDEBUG (D_NET, "Sending to %s ip %d.%d.%d.%d:%d\n", + CDEBUG(D_NET, "Sending to %s ip %pI4h:%d\n", libcfs_id2str(conn->ksnc_peer->ksnp_id), - HIPQUAD(conn->ksnc_ipaddr), + &conn->ksnc_ipaddr, conn->ksnc_port); ksocknal_tx_prep(conn, tx); @@ -801,9 +797,9 @@ ksocknal_find_connectable_route_locked (ksock_peer_t *peer) if (!(route->ksnr_retry_interval == 0 || /* first attempt */ cfs_time_aftereq(now, route->ksnr_timeout))) { CDEBUG(D_NET, - "Too soon to retry route %u.%u.%u.%u " + "Too soon to retry route %pI4h " "(cnted %d, interval %ld, %ld secs later)\n", - HIPQUAD(route->ksnr_ipaddr), + &route->ksnr_ipaddr, route->ksnr_connected, route->ksnr_retry_interval, cfs_duration_sec(route->ksnr_timeout - now)); @@ -1009,7 +1005,7 @@ ksocknal_send(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg) int ksocknal_thread_start(int (*fn)(void *arg), void *arg, char *name) { - task_t *task = kthread_run(fn, arg, name); + struct task_struct *task = kthread_run(fn, arg, name); if (IS_ERR(task)) return PTR_ERR(task); @@ -1120,7 +1116,7 @@ ksocknal_process_receive (ksock_conn_t *conn) LASSERT (atomic_read(&conn->ksnc_conn_refcount) > 0); /* NB: sched lock NOT held */ - /* SOCKNAL_RX_LNET_HEADER is here for backward compatability */ + /* SOCKNAL_RX_LNET_HEADER is here for backward compatibility */ LASSERT (conn->ksnc_rx_state == SOCKNAL_RX_KSM_HEADER || conn->ksnc_rx_state == SOCKNAL_RX_LNET_PAYLOAD || conn->ksnc_rx_state == SOCKNAL_RX_LNET_HEADER || @@ -1133,17 +1129,17 @@ ksocknal_process_receive (ksock_conn_t *conn) LASSERT (rc != -EAGAIN); if (rc == 0) - CDEBUG (D_NET, "[%p] EOF from %s" - " ip %d.%d.%d.%d:%d\n", conn, + CDEBUG(D_NET, "[%p] EOF from %s" + " ip %pI4h:%d\n", conn, libcfs_id2str(conn->ksnc_peer->ksnp_id), - HIPQUAD(conn->ksnc_ipaddr), + &conn->ksnc_ipaddr, conn->ksnc_port); else if (!conn->ksnc_closing) - CERROR ("[%p] Error %d on read from %s" - " ip %d.%d.%d.%d:%d\n", + CERROR("[%p] Error %d on read from %s" + " ip %pI4h:%d\n", conn, rc, libcfs_id2str(conn->ksnc_peer->ksnp_id), - HIPQUAD(conn->ksnc_ipaddr), + &conn->ksnc_ipaddr, conn->ksnc_port); /* it's not an error if conn is being closed */ @@ -1562,7 +1558,6 @@ int ksocknal_scheduler(void *arg) void ksocknal_read_callback (ksock_conn_t *conn) { ksock_sched_t *sched; - ENTRY; sched = conn->ksnc_scheduler; @@ -1580,8 +1575,6 @@ void ksocknal_read_callback (ksock_conn_t *conn) wake_up (&sched->kss_waitq); } spin_unlock_bh(&sched->kss_lock); - - EXIT; } /* @@ -1591,7 +1584,6 @@ void ksocknal_read_callback (ksock_conn_t *conn) void ksocknal_write_callback (ksock_conn_t *conn) { ksock_sched_t *sched; - ENTRY; sched = conn->ksnc_scheduler; @@ -1611,8 +1603,6 @@ void ksocknal_write_callback (ksock_conn_t *conn) } spin_unlock_bh(&sched->kss_lock); - - EXIT; } ksock_proto_t * @@ -1722,8 +1712,8 @@ ksocknal_recv_hello (lnet_ni_t *ni, ksock_conn_t *conn, rc = libcfs_sock_read(sock, &hello->kshm_magic, sizeof (hello->kshm_magic), timeout); if (rc != 0) { - CERROR ("Error %d reading HELLO from %u.%u.%u.%u\n", - rc, HIPQUAD(conn->ksnc_ipaddr)); + CERROR("Error %d reading HELLO from %pI4h\n", + rc, &conn->ksnc_ipaddr); LASSERT (rc < 0); return rc; } @@ -1732,18 +1722,18 @@ ksocknal_recv_hello (lnet_ni_t *ni, ksock_conn_t *conn, hello->kshm_magic != __swab32(LNET_PROTO_MAGIC) && hello->kshm_magic != le32_to_cpu (LNET_PROTO_TCP_MAGIC)) { /* Unexpected magic! */ - CERROR ("Bad magic(1) %#08x (%#08x expected) from " - "%u.%u.%u.%u\n", __cpu_to_le32 (hello->kshm_magic), + CERROR("Bad magic(1) %#08x (%#08x expected) from " + "%pI4h\n", __cpu_to_le32 (hello->kshm_magic), LNET_PROTO_TCP_MAGIC, - HIPQUAD(conn->ksnc_ipaddr)); + &conn->ksnc_ipaddr); return -EPROTO; } rc = libcfs_sock_read(sock, &hello->kshm_version, sizeof(hello->kshm_version), timeout); if (rc != 0) { - CERROR ("Error %d reading HELLO from %u.%u.%u.%u\n", - rc, HIPQUAD(conn->ksnc_ipaddr)); + CERROR("Error %d reading HELLO from %pI4h\n", + rc, &conn->ksnc_ipaddr); LASSERT (rc < 0); return rc; } @@ -1763,10 +1753,10 @@ ksocknal_recv_hello (lnet_ni_t *ni, ksock_conn_t *conn, ksocknal_send_hello(ni, conn, ni->ni_nid, hello); } - CERROR ("Unknown protocol version (%d.x expected)" - " from %u.%u.%u.%u\n", + CERROR("Unknown protocol version (%d.x expected)" + " from %pI4h\n", conn->ksnc_proto->pro_version, - HIPQUAD(conn->ksnc_ipaddr)); + &conn->ksnc_ipaddr); return -EPROTO; } @@ -1777,8 +1767,8 @@ ksocknal_recv_hello (lnet_ni_t *ni, ksock_conn_t *conn, /* receive the rest of hello message anyway */ rc = conn->ksnc_proto->pro_recv_hello(conn, hello, timeout); if (rc != 0) { - CERROR("Error %d reading or checking hello from from %u.%u.%u.%u\n", - rc, HIPQUAD(conn->ksnc_ipaddr)); + CERROR("Error %d reading or checking hello from from %pI4h\n", + rc, &conn->ksnc_ipaddr); LASSERT (rc < 0); return rc; } @@ -1787,7 +1777,7 @@ ksocknal_recv_hello (lnet_ni_t *ni, ksock_conn_t *conn, if (hello->kshm_src_nid == LNET_NID_ANY) { CERROR("Expecting a HELLO hdr with a NID, but got LNET_NID_ANY" - "from %u.%u.%u.%u\n", HIPQUAD(conn->ksnc_ipaddr)); + "from %pI4h\n", &conn->ksnc_ipaddr); return -EPROTO; } @@ -1807,9 +1797,9 @@ ksocknal_recv_hello (lnet_ni_t *ni, ksock_conn_t *conn, /* peer determines type */ conn->ksnc_type = ksocknal_invert_type(hello->kshm_ctype); if (conn->ksnc_type == SOCKLND_CONN_NONE) { - CERROR ("Unexpected type %d from %s ip %u.%u.%u.%u\n", + CERROR("Unexpected type %d from %s ip %pI4h\n", hello->kshm_ctype, libcfs_id2str(*peerid), - HIPQUAD(conn->ksnc_ipaddr)); + &conn->ksnc_ipaddr); return -EPROTO; } @@ -1819,11 +1809,11 @@ ksocknal_recv_hello (lnet_ni_t *ni, ksock_conn_t *conn, if (peerid->pid != recv_id.pid || peerid->nid != recv_id.nid) { LCONSOLE_ERROR_MSG(0x130, "Connected successfully to %s on host" - " %u.%u.%u.%u, but they claimed they were " + " %pI4h, but they claimed they were " "%s; please check your Lustre " "configuration.\n", libcfs_id2str(*peerid), - HIPQUAD(conn->ksnc_ipaddr), + &conn->ksnc_ipaddr, libcfs_id2str(recv_id)); return -EPROTO; } @@ -1834,9 +1824,9 @@ ksocknal_recv_hello (lnet_ni_t *ni, ksock_conn_t *conn, } if (ksocknal_invert_type(hello->kshm_ctype) != conn->ksnc_type) { - CERROR ("Mismatched types: me %d, %s ip %u.%u.%u.%u %d\n", + CERROR("Mismatched types: me %d, %s ip %pI4h %d\n", conn->ksnc_type, libcfs_id2str(*peerid), - HIPQUAD(conn->ksnc_ipaddr), + &conn->ksnc_ipaddr, hello->kshm_ctype); return -EPROTO; } @@ -1995,7 +1985,7 @@ ksocknal_connect (ksock_route_t *route) list_splice_init(&peer->ksnp_tx_queue, &zombies); } -#if 0 /* irrelevent with only eager routes */ +#if 0 /* irrelevant with only eager routes */ if (!route->ksnr_deleted) { /* make this route least-favourite for re-selection */ list_del(&route->ksnr_list); @@ -2208,8 +2198,8 @@ ksocknal_connd (void *arg) /* consecutive retry */ if (cons_retry++ > SOCKNAL_INSANITY_RECONN) { CWARN("massive consecutive " - "re-connecting to %u.%u.%u.%u\n", - HIPQUAD(route->ksnr_ipaddr)); + "re-connecting to %pI4h\n", + &route->ksnr_ipaddr); cons_retry = 0; } } else { @@ -2274,26 +2264,26 @@ ksocknal_find_timed_out_conn (ksock_peer_t *peer) switch (error) { case ECONNRESET: CNETERR("A connection with %s " - "(%u.%u.%u.%u:%d) was reset; " + "(%pI4h:%d) was reset; " "it may have rebooted.\n", libcfs_id2str(peer->ksnp_id), - HIPQUAD(conn->ksnc_ipaddr), + &conn->ksnc_ipaddr, conn->ksnc_port); break; case ETIMEDOUT: CNETERR("A connection with %s " - "(%u.%u.%u.%u:%d) timed out; the " + "(%pI4h:%d) timed out; the " "network or node may be down.\n", libcfs_id2str(peer->ksnp_id), - HIPQUAD(conn->ksnc_ipaddr), + &conn->ksnc_ipaddr, conn->ksnc_port); break; default: CNETERR("An unexpected network error %d " "occurred with %s " - "(%u.%u.%u.%u:%d\n", error, + "(%pI4h:%d\n", error, libcfs_id2str(peer->ksnp_id), - HIPQUAD(conn->ksnc_ipaddr), + &conn->ksnc_ipaddr, conn->ksnc_port); break; } @@ -2306,10 +2296,10 @@ ksocknal_find_timed_out_conn (ksock_peer_t *peer) conn->ksnc_rx_deadline)) { /* Timed out incomplete incoming message */ ksocknal_conn_addref(conn); - CNETERR("Timeout receiving from %s (%u.%u.%u.%u:%d), " + CNETERR("Timeout receiving from %s (%pI4h:%d), " "state %d wanted %d left %d\n", libcfs_id2str(peer->ksnp_id), - HIPQUAD(conn->ksnc_ipaddr), + &conn->ksnc_ipaddr, conn->ksnc_port, conn->ksnc_rx_state, conn->ksnc_rx_nob_wanted, @@ -2324,10 +2314,10 @@ ksocknal_find_timed_out_conn (ksock_peer_t *peer) /* Timed out messages queued for sending or * buffered in the socket's send buffer */ ksocknal_conn_addref(conn); - CNETERR("Timeout sending data to %s (%u.%u.%u.%u:%d) " + CNETERR("Timeout sending data to %s (%pI4h:%d) " "the network or that node may be down.\n", libcfs_id2str(peer->ksnp_id), - HIPQUAD(conn->ksnc_ipaddr), + &conn->ksnc_ipaddr, conn->ksnc_port); return (conn); } diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c index 3e08fe2d1489..a1c6a519bf5b 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c @@ -316,7 +316,7 @@ ksocknal_lib_tunables_init () *ksocknal_tunables.ksnd_zc_recv_min_nfrags = LNET_MAX_IOV; ksocknal_tunables.ksnd_sysctl = - cfs_register_sysctl_table(ksocknal_top_ctl_table, 0); + register_sysctl_table(ksocknal_top_ctl_table); if (ksocknal_tunables.ksnd_sysctl == NULL) CWARN("Can't setup /proc tunables\n"); @@ -325,20 +325,20 @@ ksocknal_lib_tunables_init () } void -ksocknal_lib_tunables_fini () +ksocknal_lib_tunables_fini(void) { if (ksocknal_tunables.ksnd_sysctl != NULL) unregister_sysctl_table(ksocknal_tunables.ksnd_sysctl); } #else int -ksocknal_lib_tunables_init () +ksocknal_lib_tunables_init(void) { return 0; } void -ksocknal_lib_tunables_fini () +ksocknal_lib_tunables_fini(void) { } #endif /* # if CONFIG_SYSCTL && !CFS_SYSFS_MODULE_PARM */ @@ -964,7 +964,6 @@ static void ksocknal_data_ready (struct sock *sk, int n) { ksock_conn_t *conn; - ENTRY; /* interleave correctly with closing sockets... */ LASSERT(!in_irq()); @@ -978,8 +977,6 @@ ksocknal_data_ready (struct sock *sk, int n) ksocknal_read_callback(conn); read_unlock(&ksocknal_data.ksnd_global_lock); - - EXIT; } static void diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.h b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.h index 3c135786dc11..1cfc1b168bed 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.h +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.h @@ -41,7 +41,6 @@ #include <linux/module.h> #include <linux/kernel.h> -#include <linux/version.h> #include <linux/mm.h> #include <linux/string.h> #include <linux/stat.h> @@ -58,11 +57,9 @@ #include <linux/init.h> #include <linux/fs.h> #include <linux/file.h> -#include <linux/stat.h> #include <linux/list.h> #include <linux/kmod.h> #include <linux/sysctl.h> -#include <asm/uaccess.h> #include <asm/div64.h> #include <linux/syscalls.h> diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c index ec57179f8d2b..71205e2015ce 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c @@ -218,7 +218,7 @@ ksocknal_queue_tx_zcack_v3(ksock_conn_t *conn, if (tx->tx_msg.ksm_zc_cookies[0] > tx->tx_msg.ksm_zc_cookies[1]) { __u64 tmp = 0; - /* two seperated cookies: (a+2, a) or (a+1, a) */ + /* two separated cookies: (a+2, a) or (a+1, a) */ LASSERT (tx->tx_msg.ksm_zc_cookies[0] - tx->tx_msg.ksm_zc_cookies[1] <= 2); @@ -496,8 +496,8 @@ ksocknal_send_hello_v1 (ksock_conn_t *conn, ksock_hello_msg_t *hello) rc = libcfs_sock_write(sock, hdr, sizeof(*hdr),lnet_acceptor_timeout()); if (rc != 0) { - CNETERR("Error %d sending HELLO hdr to %u.%u.%u.%u/%d\n", - rc, HIPQUAD(conn->ksnc_ipaddr), conn->ksnc_port); + CNETERR("Error %d sending HELLO hdr to %pI4h/%d\n", + rc, &conn->ksnc_ipaddr, conn->ksnc_port); goto out; } @@ -513,8 +513,8 @@ ksocknal_send_hello_v1 (ksock_conn_t *conn, ksock_hello_msg_t *hello) lnet_acceptor_timeout()); if (rc != 0) { CNETERR("Error %d sending HELLO payload (%d)" - " to %u.%u.%u.%u/%d\n", rc, hello->kshm_nips, - HIPQUAD(conn->ksnc_ipaddr), conn->ksnc_port); + " to %pI4h/%d\n", rc, hello->kshm_nips, + &conn->ksnc_ipaddr, conn->ksnc_port); } out: LIBCFS_FREE(hdr, sizeof(*hdr)); @@ -545,8 +545,8 @@ ksocknal_send_hello_v2 (ksock_conn_t *conn, ksock_hello_msg_t *hello) lnet_acceptor_timeout()); if (rc != 0) { - CNETERR("Error %d sending HELLO hdr to %u.%u.%u.%u/%d\n", - rc, HIPQUAD(conn->ksnc_ipaddr), conn->ksnc_port); + CNETERR("Error %d sending HELLO hdr to %pI4h/%d\n", + rc, &conn->ksnc_ipaddr, conn->ksnc_port); return rc; } @@ -558,8 +558,8 @@ ksocknal_send_hello_v2 (ksock_conn_t *conn, ksock_hello_msg_t *hello) lnet_acceptor_timeout()); if (rc != 0) { CNETERR("Error %d sending HELLO payload (%d)" - " to %u.%u.%u.%u/%d\n", rc, hello->kshm_nips, - HIPQUAD(conn->ksnc_ipaddr), conn->ksnc_port); + " to %pI4h/%d\n", rc, hello->kshm_nips, + &conn->ksnc_ipaddr, conn->ksnc_port); } return rc; @@ -583,18 +583,18 @@ ksocknal_recv_hello_v1(ksock_conn_t *conn, ksock_hello_msg_t *hello,int timeout) sizeof (*hdr) - offsetof (lnet_hdr_t, src_nid), timeout); if (rc != 0) { - CERROR ("Error %d reading rest of HELLO hdr from %u.%u.%u.%u\n", - rc, HIPQUAD(conn->ksnc_ipaddr)); + CERROR("Error %d reading rest of HELLO hdr from %pI4h\n", + rc, &conn->ksnc_ipaddr); LASSERT (rc < 0 && rc != -EALREADY); goto out; } /* ...and check we got what we expected */ if (hdr->type != cpu_to_le32 (LNET_MSG_HELLO)) { - CERROR ("Expecting a HELLO hdr," - " but got type %d from %u.%u.%u.%u\n", + CERROR("Expecting a HELLO hdr," + " but got type %d from %pI4h\n", le32_to_cpu (hdr->type), - HIPQUAD(conn->ksnc_ipaddr)); + &conn->ksnc_ipaddr); rc = -EPROTO; goto out; } @@ -607,8 +607,8 @@ ksocknal_recv_hello_v1(ksock_conn_t *conn, ksock_hello_msg_t *hello,int timeout) sizeof (__u32); if (hello->kshm_nips > LNET_MAX_INTERFACES) { - CERROR("Bad nips %d from ip %u.%u.%u.%u\n", - hello->kshm_nips, HIPQUAD(conn->ksnc_ipaddr)); + CERROR("Bad nips %d from ip %pI4h\n", + hello->kshm_nips, &conn->ksnc_ipaddr); rc = -EPROTO; goto out; } @@ -619,9 +619,9 @@ ksocknal_recv_hello_v1(ksock_conn_t *conn, ksock_hello_msg_t *hello,int timeout) rc = libcfs_sock_read(sock, hello->kshm_ips, hello->kshm_nips * sizeof(__u32), timeout); if (rc != 0) { - CERROR ("Error %d reading IPs from ip %u.%u.%u.%u\n", - rc, HIPQUAD(conn->ksnc_ipaddr)); - LASSERT (rc < 0 && rc != -EALREADY); + CERROR("Error %d reading IPs from ip %pI4h\n", + rc, &conn->ksnc_ipaddr); + LASSERT(rc < 0 && rc != -EALREADY); goto out; } @@ -629,8 +629,8 @@ ksocknal_recv_hello_v1(ksock_conn_t *conn, ksock_hello_msg_t *hello,int timeout) hello->kshm_ips[i] = __le32_to_cpu(hello->kshm_ips[i]); if (hello->kshm_ips[i] == 0) { - CERROR("Zero IP[%d] from ip %u.%u.%u.%u\n", - i, HIPQUAD(conn->ksnc_ipaddr)); + CERROR("Zero IP[%d] from ip %pI4h\n", + i, &conn->ksnc_ipaddr); rc = -EPROTO; break; } @@ -658,9 +658,9 @@ ksocknal_recv_hello_v2 (ksock_conn_t *conn, ksock_hello_msg_t *hello, int timeou offsetof(ksock_hello_msg_t, kshm_src_nid), timeout); if (rc != 0) { - CERROR ("Error %d reading HELLO from %u.%u.%u.%u\n", - rc, HIPQUAD(conn->ksnc_ipaddr)); - LASSERT (rc < 0 && rc != -EALREADY); + CERROR("Error %d reading HELLO from %pI4h\n", + rc, &conn->ksnc_ipaddr); + LASSERT(rc < 0 && rc != -EALREADY); return rc; } @@ -676,8 +676,8 @@ ksocknal_recv_hello_v2 (ksock_conn_t *conn, ksock_hello_msg_t *hello, int timeou } if (hello->kshm_nips > LNET_MAX_INTERFACES) { - CERROR("Bad nips %d from ip %u.%u.%u.%u\n", - hello->kshm_nips, HIPQUAD(conn->ksnc_ipaddr)); + CERROR("Bad nips %d from ip %pI4h\n", + hello->kshm_nips, &conn->ksnc_ipaddr); return -EPROTO; } @@ -687,9 +687,9 @@ ksocknal_recv_hello_v2 (ksock_conn_t *conn, ksock_hello_msg_t *hello, int timeou rc = libcfs_sock_read(sock, hello->kshm_ips, hello->kshm_nips * sizeof(__u32), timeout); if (rc != 0) { - CERROR ("Error %d reading IPs from ip %u.%u.%u.%u\n", - rc, HIPQUAD(conn->ksnc_ipaddr)); - LASSERT (rc < 0 && rc != -EALREADY); + CERROR("Error %d reading IPs from ip %pI4h\n", + rc, &conn->ksnc_ipaddr); + LASSERT(rc < 0 && rc != -EALREADY); return rc; } @@ -698,8 +698,8 @@ ksocknal_recv_hello_v2 (ksock_conn_t *conn, ksock_hello_msg_t *hello, int timeou __swab32s(&hello->kshm_ips[i]); if (hello->kshm_ips[i] == 0) { - CERROR("Zero IP[%d] from ip %u.%u.%u.%u\n", - i, HIPQUAD(conn->ksnc_ipaddr)); + CERROR("Zero IP[%d] from ip %pI4h\n", + i, &conn->ksnc_ipaddr); return -EPROTO; } } diff --git a/drivers/staging/lustre/lnet/lnet/Makefile b/drivers/staging/lustre/lnet/lnet/Makefile index 1bd9ef774208..b815fe12b10a 100644 --- a/drivers/staging/lustre/lnet/lnet/Makefile +++ b/drivers/staging/lustre/lnet/lnet/Makefile @@ -1,6 +1,6 @@ obj-$(CONFIG_LNET) += lnet.o -lnet-y := api-errno.o api-ni.o config.o lib-me.o lib-msg.o lib-eq.o \ +lnet-y := api-ni.o config.o lib-me.o lib-msg.o lib-eq.o \ lib-md.o lib-ptl.o lib-move.o module.o lo.o router.o \ router_proc.o acceptor.o peer.o diff --git a/drivers/staging/lustre/lnet/lnet/acceptor.c b/drivers/staging/lustre/lnet/lnet/acceptor.c index 81ef28bbcba0..bb15bde0704c 100644 --- a/drivers/staging/lustre/lnet/lnet/acceptor.c +++ b/drivers/staging/lustre/lnet/lnet/acceptor.c @@ -101,52 +101,52 @@ lnet_connect_console_error (int rc, lnet_nid_t peer_nid, switch (rc) { /* "normal" errors */ case -ECONNREFUSED: - CNETERR("Connection to %s at host %u.%u.%u.%u on port %d was " + CNETERR("Connection to %s at host %pI4h on port %d was " "refused: check that Lustre is running on that node.\n", libcfs_nid2str(peer_nid), - HIPQUAD(peer_ip), peer_port); + &peer_ip, peer_port); break; case -EHOSTUNREACH: case -ENETUNREACH: - CNETERR("Connection to %s at host %u.%u.%u.%u " + CNETERR("Connection to %s at host %pI4h " "was unreachable: the network or that node may " "be down, or Lustre may be misconfigured.\n", - libcfs_nid2str(peer_nid), HIPQUAD(peer_ip)); + libcfs_nid2str(peer_nid), &peer_ip); break; case -ETIMEDOUT: - CNETERR("Connection to %s at host %u.%u.%u.%u on " + CNETERR("Connection to %s at host %pI4h on " "port %d took too long: that node may be hung " "or experiencing high load.\n", libcfs_nid2str(peer_nid), - HIPQUAD(peer_ip), peer_port); + &peer_ip, peer_port); break; case -ECONNRESET: - LCONSOLE_ERROR_MSG(0x11b, "Connection to %s at host %u.%u.%u.%u" + LCONSOLE_ERROR_MSG(0x11b, "Connection to %s at host %pI4h" " on port %d was reset: " "is it running a compatible version of " "Lustre and is %s one of its NIDs?\n", libcfs_nid2str(peer_nid), - HIPQUAD(peer_ip), peer_port, + &peer_ip, peer_port, libcfs_nid2str(peer_nid)); break; case -EPROTO: LCONSOLE_ERROR_MSG(0x11c, "Protocol error connecting to %s at " - "host %u.%u.%u.%u on port %d: is it running " + "host %pI4h on port %d: is it running " "a compatible version of Lustre?\n", libcfs_nid2str(peer_nid), - HIPQUAD(peer_ip), peer_port); + &peer_ip, peer_port); break; case -EADDRINUSE: LCONSOLE_ERROR_MSG(0x11d, "No privileged ports available to " - "connect to %s at host %u.%u.%u.%u on port " + "connect to %s at host %pI4h on port " "%d\n", libcfs_nid2str(peer_nid), - HIPQUAD(peer_ip), peer_port); + &peer_ip, peer_port); break; default: LCONSOLE_ERROR_MSG(0x11e, "Unexpected error %d connecting to %s" - " at host %u.%u.%u.%u on port %d\n", rc, + " at host %pI4h on port %d\n", rc, libcfs_nid2str(peer_nid), - HIPQUAD(peer_ip), peer_port); + &peer_ip, peer_port); break; } } @@ -253,8 +253,8 @@ lnet_accept(socket_t *sock, __u32 magic) if (rc != 0) CERROR("Error sending magic+version in response" - "to LNET magic from %u.%u.%u.%u: %d\n", - HIPQUAD(peer_ip), rc); + "to LNET magic from %pI4h: %d\n", + &peer_ip, rc); return -EPROTO; } @@ -265,9 +265,9 @@ lnet_accept(socket_t *sock, __u32 magic) else str = "unrecognised"; - LCONSOLE_ERROR_MSG(0x11f, "Refusing connection from %u.%u.%u.%u" + LCONSOLE_ERROR_MSG(0x11f, "Refusing connection from %pI4h" " magic %08x: %s acceptor protocol\n", - HIPQUAD(peer_ip), magic, str); + &peer_ip, magic, str); return -EPROTO; } @@ -278,7 +278,7 @@ lnet_accept(socket_t *sock, __u32 magic) accept_timeout); if (rc != 0) { CERROR("Error %d reading connection request version from " - "%u.%u.%u.%u\n", rc, HIPQUAD(peer_ip)); + "%pI4h\n", rc, &peer_ip); return -EIO; } @@ -301,8 +301,8 @@ lnet_accept(socket_t *sock, __u32 magic) if (rc != 0) CERROR("Error sending magic+version in response" - "to version %d from %u.%u.%u.%u: %d\n", - peer_version, HIPQUAD(peer_ip), rc); + "to version %d from %pI4h: %d\n", + peer_version, &peer_ip, rc); return -EPROTO; } @@ -312,7 +312,7 @@ lnet_accept(socket_t *sock, __u32 magic) accept_timeout); if (rc != 0) { CERROR("Error %d reading connection request from " - "%u.%u.%u.%u\n", rc, HIPQUAD(peer_ip)); + "%pI4h\n", rc, &peer_ip); return -EIO; } @@ -324,23 +324,23 @@ lnet_accept(socket_t *sock, __u32 magic) ni->ni_nid != cr.acr_nid) { /* right NET, wrong NID! */ if (ni != NULL) lnet_ni_decref(ni); - LCONSOLE_ERROR_MSG(0x120, "Refusing connection from %u.%u.%u.%u" + LCONSOLE_ERROR_MSG(0x120, "Refusing connection from %pI4h" " for %s: No matching NI\n", - HIPQUAD(peer_ip), libcfs_nid2str(cr.acr_nid)); + &peer_ip, libcfs_nid2str(cr.acr_nid)); return -EPERM; } if (ni->ni_lnd->lnd_accept == NULL) { /* This catches a request for the loopback LND */ lnet_ni_decref(ni); - LCONSOLE_ERROR_MSG(0x121, "Refusing connection from %u.%u.%u.%u" + LCONSOLE_ERROR_MSG(0x121, "Refusing connection from %pI4h" " for %s: NI doesn not accept IP connections\n", - HIPQUAD(peer_ip), libcfs_nid2str(cr.acr_nid)); + &peer_ip, libcfs_nid2str(cr.acr_nid)); return -EPERM; } - CDEBUG(D_NET, "Accept %s from %u.%u.%u.%u\n", - libcfs_nid2str(cr.acr_nid), HIPQUAD(peer_ip)); + CDEBUG(D_NET, "Accept %s from %pI4h\n", + libcfs_nid2str(cr.acr_nid), &peer_ip); rc = ni->ni_lnd->lnd_accept(ni, sock); @@ -410,9 +410,9 @@ lnet_acceptor(void *arg) } if (secure && peer_port > LNET_ACCEPTOR_MAX_RESERVED_PORT) { - CERROR("Refusing connection from %u.%u.%u.%u: " + CERROR("Refusing connection from %pI4h: " "insecure port %d\n", - HIPQUAD(peer_ip), peer_port); + &peer_ip, peer_port); goto failed; } @@ -420,7 +420,7 @@ lnet_acceptor(void *arg) accept_timeout); if (rc != 0) { CERROR("Error %d reading connection request from " - "%u.%u.%u.%u\n", rc, HIPQUAD(peer_ip)); + "%pI4h\n", rc, &peer_ip); goto failed; } diff --git a/drivers/staging/lustre/lnet/lnet/api-errno.c b/drivers/staging/lustre/lnet/lnet/api-errno.c deleted file mode 100644 index 695b27265e23..000000000000 --- a/drivers/staging/lustre/lnet/lnet/api-errno.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * GPL HEADER START - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 only, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License version 2 for more details (a copy is included - * in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU General Public License - * version 2 along with this program; If not, see - * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - * GPL HEADER END - */ -/* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. - * Use is subject to license terms. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - * - * lnet/lnet/api-errno.c - * - * Instantiate the string table of errors - */ - -/* If you change these, you must update the number table in portals/errno.h */ diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index e88bee362497..160a4292c6ce 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -1371,7 +1371,7 @@ EXPORT_SYMBOL(LNetNIInit); * \return always 0 for current implementation. */ int -LNetNIFini() +LNetNIFini(void) { LNET_MUTEX_LOCK(&the_lnet.ln_api_mutex); @@ -1541,7 +1541,10 @@ LNetGetId(unsigned int index, lnet_process_id_t *id) int rc = -ENOENT; LASSERT(the_lnet.ln_init); - LASSERT(the_lnet.ln_refcount > 0); + + /* LNetNI initilization failed? */ + if (the_lnet.ln_refcount == 0) + return rc; cpt = lnet_net_lock_current(); diff --git a/drivers/staging/lustre/lnet/lnet/lib-eq.c b/drivers/staging/lustre/lnet/lnet/lib-eq.c index 78297a7d94e8..4ce68d3b0931 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-eq.c +++ b/drivers/staging/lustre/lnet/lnet/lib-eq.c @@ -244,11 +244,10 @@ lnet_eq_dequeue_event(lnet_eq_t *eq, lnet_event_t *ev) int new_index = eq->eq_deq_seq & (eq->eq_size - 1); lnet_event_t *new_event = &eq->eq_events[new_index]; int rc; - ENTRY; /* must called with lnet_eq_wait_lock hold */ if (LNET_SEQ_GT(eq->eq_deq_seq, new_event->sequence)) - RETURN(0); + return 0; /* We've got a new event... */ *ev = *new_event; @@ -268,7 +267,7 @@ lnet_eq_dequeue_event(lnet_eq_t *eq, lnet_event_t *ev) } eq->eq_deq_seq = new_event->sequence + 1; - RETURN(rc); + return rc; } /** @@ -400,13 +399,12 @@ LNetEQPoll(lnet_handle_eq_t *eventqs, int neq, int timeout_ms, int wait = 1; int rc; int i; - ENTRY; LASSERT (the_lnet.ln_init); LASSERT (the_lnet.ln_refcount > 0); if (neq < 1) - RETURN(-ENOENT); + return -ENOENT; lnet_eq_wait_lock(); @@ -416,14 +414,14 @@ LNetEQPoll(lnet_handle_eq_t *eventqs, int neq, int timeout_ms, if (eq == NULL) { lnet_eq_wait_unlock(); - RETURN(-ENOENT); + return -ENOENT; } rc = lnet_eq_dequeue_event(eq, event); if (rc != 0) { lnet_eq_wait_unlock(); *which = i; - RETURN(rc); + return rc; } } @@ -443,5 +441,5 @@ LNetEQPoll(lnet_handle_eq_t *eventqs, int neq, int timeout_ms, } lnet_eq_wait_unlock(); - RETURN(0); + return 0; } diff --git a/drivers/staging/lustre/lnet/lnet/lib-msg.c b/drivers/staging/lustre/lnet/lnet/lib-msg.c index 8f3a50bd5f69..61ae88be6f02 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-msg.c +++ b/drivers/staging/lustre/lnet/lnet/lib-msg.c @@ -45,8 +45,6 @@ void lnet_build_unlink_event (lnet_libmd_t *md, lnet_event_t *ev) { - ENTRY; - memset(ev, 0, sizeof(*ev)); ev->status = 0; @@ -54,7 +52,6 @@ lnet_build_unlink_event (lnet_libmd_t *md, lnet_event_t *ev) ev->type = LNET_EVENT_UNLINK; lnet_md_deconstruct(md, &ev->md); lnet_md2handle(&ev->md_handle, md); - EXIT; } /* @@ -319,7 +316,7 @@ lnet_msg_attach_md(lnet_msg_t *msg, lnet_libmd_t *md, LASSERT(!msg->msg_routing); msg->msg_md = md; - if (msg->msg_receiving) { /* commited for receiving */ + if (msg->msg_receiving) { /* committed for receiving */ msg->msg_offset = offset; msg->msg_wanted = mlen; } @@ -395,7 +392,7 @@ lnet_complete_msg_locked(lnet_msg_t *msg, int cpt) * NB: message is committed for sending, we should return * on success because LND will finalize this message later. * - * Also, there is possibility that message is commited for + * Also, there is possibility that message is committed for * sending and also failed before delivering to LND, * i.e: ENOMEM, in that case we can't fall through either * because CPT for sending can be different with CPT for @@ -417,7 +414,7 @@ lnet_complete_msg_locked(lnet_msg_t *msg, int cpt) * NB: message is committed for sending, we should return * on success because LND will finalize this message later. * - * Also, there is possibility that message is commited for + * Also, there is possibility that message is committed for * sending and also failed before delivering to LND, * i.e: ENOMEM, in that case we can't fall through either: * - The rule is message must decommit for sending first if @@ -477,14 +474,14 @@ lnet_finalize (lnet_ni_t *ni, lnet_msg_t *msg, int status) again: rc = 0; if (!msg->msg_tx_committed && !msg->msg_rx_committed) { - /* not commited to network yet */ + /* not committed to network yet */ LASSERT(!msg->msg_onactivelist); lnet_msg_free(msg); return; } /* - * NB: routed message can be commited for both receiving and sending, + * NB: routed message can be committed for both receiving and sending, * we should finalize in LIFO order and keep counters correct. * (finalize sending first then finalize receiving) */ diff --git a/drivers/staging/lustre/lnet/lnet/module.c b/drivers/staging/lustre/lnet/lnet/module.c index c8323854580a..afb81755cbad 100644 --- a/drivers/staging/lustre/lnet/lnet/module.c +++ b/drivers/staging/lustre/lnet/lnet/module.c @@ -114,14 +114,13 @@ int init_lnet(void) { int rc; - ENTRY; mutex_init(&lnet_config_mutex); rc = LNetInit(); if (rc != 0) { CERROR("LNetInit: error %d\n", rc); - RETURN(rc); + return rc; } rc = libcfs_register_ioctl(&lnet_ioctl_handler); @@ -133,7 +132,7 @@ init_lnet(void) (void) kthread_run(lnet_configure, NULL, "lnet_initd"); } - RETURN(0); + return 0; } void @@ -150,5 +149,7 @@ fini_lnet(void) MODULE_AUTHOR("Peter J. Braam <braam@clusterfs.com>"); MODULE_DESCRIPTION("Portals v3.1"); MODULE_LICENSE("GPL"); +MODULE_VERSION("1.0.0"); -cfs_module(lnet, "1.0.0", init_lnet, fini_lnet); +module_init(init_lnet); +module_exit(fini_lnet); diff --git a/drivers/staging/lustre/lnet/lnet/router_proc.c b/drivers/staging/lustre/lnet/lnet/router_proc.c index 3084b0c75983..931f6ca25dc7 100644 --- a/drivers/staging/lustre/lnet/lnet/router_proc.c +++ b/drivers/staging/lustre/lnet/lnet/router_proc.c @@ -920,7 +920,7 @@ lnet_proc_init(void) { #ifdef CONFIG_SYSCTL if (lnet_table_header == NULL) - lnet_table_header = cfs_register_sysctl_table(top_table, 0); + lnet_table_header = register_sysctl_table(top_table); #endif } diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c b/drivers/staging/lustre/lnet/selftest/brw_test.c index 3bb6fbe23f78..ef5064e0055f 100644 --- a/drivers/staging/lustre/lnet/selftest/brw_test.c +++ b/drivers/staging/lustre/lnet/selftest/brw_test.c @@ -361,7 +361,7 @@ brw_server_rpc_done (srpc_server_rpc_t *rpc) blk->bk_sink ? "from" : "to", libcfs_id2str(rpc->srpc_peer), rpc->srpc_status); else - CDEBUG (D_NET, "Transfered %d pages bulk data %s %s\n", + CDEBUG (D_NET, "Transferred %d pages bulk data %s %s\n", blk->bk_niov, blk->bk_sink ? "from" : "to", libcfs_id2str(rpc->srpc_peer)); diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c index 446de0e4672f..cbce662b987b 100644 --- a/drivers/staging/lustre/lnet/selftest/conrpc.c +++ b/drivers/staging/lustre/lnet/selftest/conrpc.c @@ -1356,7 +1356,7 @@ lstcon_rpc_cleanup_wait(void) lst_wait_until((atomic_read(&console_session.ses_rpc_counter) == 0), console_session.ses_rpc_lock, - "Network is not accessable or target is down, " + "Network is not accessible or target is down, " "waiting for %d console RPCs to being recycled\n", atomic_read(&console_session.ses_rpc_counter)); diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c index 78e8d0467267..09e4700af640 100644 --- a/drivers/staging/lustre/lnet/selftest/console.c +++ b/drivers/staging/lustre/lnet/selftest/console.c @@ -1773,7 +1773,7 @@ lstcon_session_info(lst_sid_t *sid_up, int *key_up, unsigned *featp, } int -lstcon_session_end() +lstcon_session_end(void) { lstcon_rpc_trans_t *trans; lstcon_group_t *grp; diff --git a/drivers/staging/lustre/lnet/selftest/module.c b/drivers/staging/lustre/lnet/selftest/module.c index 5257e5630a0e..6dd4309dc5ea 100644 --- a/drivers/staging/lustre/lnet/selftest/module.c +++ b/drivers/staging/lustre/lnet/selftest/module.c @@ -165,5 +165,7 @@ error: MODULE_DESCRIPTION("LNet Selftest"); MODULE_LICENSE("GPL"); +MODULE_VERSION("0.9.0"); -cfs_module(lnet, "0.9.0", lnet_selftest_init, lnet_selftest_fini); +module_init(lnet_selftest_init); +module_exit(lnet_selftest_fini); diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c b/drivers/staging/lustre/lnet/selftest/rpc.c index bc1f38b80486..7659a26676bb 100644 --- a/drivers/staging/lustre/lnet/selftest/rpc.c +++ b/drivers/staging/lustre/lnet/selftest/rpc.c @@ -661,8 +661,10 @@ srpc_finish_service(struct srpc_service *sv) cfs_percpt_for_each(scd, i, sv->sv_cpt_data) { spin_lock(&scd->scd_lock); - if (!swi_deschedule_workitem(&scd->scd_buf_wi)) + if (!swi_deschedule_workitem(&scd->scd_buf_wi)) { + spin_unlock(&scd->scd_lock); return 0; + } if (scd->scd_buf_nposted > 0) { CDEBUG(D_NET, "waiting for %d posted buffers to unlink", @@ -1115,7 +1117,7 @@ srpc_del_client_rpc_timer (srpc_client_rpc_t *rpc) if (rpc->crpc_timeout == 0) return; - /* timer sucessfully defused */ + /* timer successfully defused */ if (stt_del_timer(&rpc->crpc_timer)) return; diff --git a/drivers/staging/lustre/lnet/selftest/timer.c b/drivers/staging/lustre/lnet/selftest/timer.c index 2c078550277b..3bf4afb42ffe 100644 --- a/drivers/staging/lustre/lnet/selftest/timer.c +++ b/drivers/staging/lustre/lnet/selftest/timer.c @@ -195,7 +195,7 @@ stt_timer_main (void *arg) int stt_start_timer_thread (void) { - task_t *task; + struct task_struct *task; LASSERT(!stt_data.stt_shuttingdown); |