staging: lustre: remove linux-tcpip.h
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 Jul 2014 07:01:03 +0000 (00:01 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 Jul 2014 07:01:03 +0000 (00:01 -0700)
There were just a few macros being used, remove them and have the places
where they were being used to make the proper kernel api call instead.

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: hpdd-discuss <hpdd-discuss@lists.01.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h
drivers/staging/lustre/include/linux/libcfs/linux/linux-tcpip.h [deleted file]
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c
drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c

index c4343fa890e47a6fb83421104b7e34c456e2a27b..1c06bf1dc3d0f930bca19d60336a7da1b8ee03d2 100644 (file)
 #include <linux/bitops.h>
 #include <linux/mutex.h>
 #include <linux/types.h>
+#include <net/sock.h>
 #include <stdarg.h>
 #include "linux-cpu.h"
 #include "linux-time.h"
 #include "linux-mem.h"
 #include "linux-prim.h"
-#include "linux-tcpip.h"
 #include "kp30.h"
 
 #include <asm/types.h>
diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-tcpip.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-tcpip.h
deleted file mode 100644 (file)
index 441537a..0000000
+++ /dev/null
@@ -1,66 +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) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (c) 2012, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- *
- * libcfs/include/libcfs/linux/linux-tcpip.h
- *
- * Basic library routines.
- */
-
-#ifndef __LIBCFS_LINUX_CFS_TCP_H__
-#define __LIBCFS_LINUX_CFS_TCP_H__
-
-#ifndef __LIBCFS_LIBCFS_H__
-#error Do not #include this file directly. #include <linux/libcfs/libcfs.h> instead
-#endif
-
-#include <net/sock.h>
-
-#define SOCK_TEST_NOSPACE(so)   test_bit(SOCK_NOSPACE, &(so)->flags)
-
-static inline int
-cfs_sock_error(struct socket *sock)
-{
-       return sock->sk->sk_err;
-}
-
-static inline int
-cfs_sock_wmem_queued(struct socket *sock)
-{
-       return sock->sk->sk_wmem_queued;
-}
-
-#define cfs_sk_sleep(sk)       sk_sleep(sk)
-
-#endif
index 237394ca4ed93d685e1464c2c9212773f3dc87c9..1590957711a75fb6b6a6f6da3536c1f03245d914 100644 (file)
@@ -1258,7 +1258,7 @@ ksocknal_create_conn (lnet_ni_t *ni, ksock_route_t *route,
 
        conn->ksnc_tx_last_post = cfs_time_current();
        /* Set the deadline for the outgoing HELLO to drain */
-       conn->ksnc_tx_bufnob = cfs_sock_wmem_queued(sock);
+       conn->ksnc_tx_bufnob = sock->sk->sk_wmem_queued;
        conn->ksnc_tx_deadline = cfs_time_shift(*ksocknal_tunables.ksnd_timeout);
        mb();   /* order with adding to peer's conn list */
 
@@ -1808,7 +1808,7 @@ ksocknal_query (lnet_ni_t *ni, lnet_nid_t nid, cfs_time_t *when)
 
                list_for_each (tmp, &peer->ksnp_conns) {
                        conn = list_entry(tmp, ksock_conn_t, ksnc_list);
-                       bufnob = cfs_sock_wmem_queued(conn->ksnc_sock);
+                       bufnob = conn->ksnc_sock->sk->sk_wmem_queued;
 
                        if (bufnob < conn->ksnc_tx_bufnob) {
                                /* something got ACKed */
index 3d0e59dd054e3282c7e21b3b785eb0a7a5d7e698..0a82645e6852f1ce4bb7df9d1e408edabf1a36e5 100644 (file)
@@ -212,7 +212,7 @@ ksocknal_transmit (ksock_conn_t *conn, ksock_tx_t *tx)
                        rc = ksocknal_send_kiov (conn, tx);
                }
 
-               bufnob = cfs_sock_wmem_queued(conn->ksnc_sock);
+               bufnob = conn->ksnc_sock->sk->sk_wmem_queued;
                if (rc > 0)                  /* sent something? */
                        conn->ksnc_tx_bufnob += rc; /* account it */
 
@@ -630,7 +630,7 @@ ksocknal_find_conn_locked(ksock_peer_t *peer, ksock_tx_t *tx, int nonblk)
        list_for_each (tmp, &peer->ksnp_conns) {
                ksock_conn_t *c  = list_entry(tmp, ksock_conn_t, ksnc_list);
                int        nob = atomic_read(&c->ksnc_tx_nob) +
-                                   cfs_sock_wmem_queued(c->ksnc_sock);
+                                   c->ksnc_sock->sk->sk_wmem_queued;
                int        rc;
 
                LASSERT (!c->ksnc_closing);
@@ -726,7 +726,7 @@ ksocknal_queue_tx_locked (ksock_tx_t *tx, ksock_conn_t *conn)
         * FIXME: SOCK_WMEM_QUEUED and SOCK_ERROR could block in __DARWIN8__
         * but they're used inside spinlocks a lot.
         */
-       bufnob = cfs_sock_wmem_queued(conn->ksnc_sock);
+       bufnob = conn->ksnc_sock->sk->sk_wmem_queued;
        spin_lock_bh(&sched->kss_lock);
 
        if (list_empty(&conn->ksnc_tx_queue) && bufnob == 0) {
@@ -2260,7 +2260,7 @@ ksocknal_find_timed_out_conn (ksock_peer_t *peer)
 
                /* SOCK_ERROR will reset error code of socket in
                 * some platform (like Darwin8.x) */
-               error = cfs_sock_error(conn->ksnc_sock);
+               error = conn->ksnc_sock->sk->sk_err;
                if (error != 0) {
                        ksocknal_conn_addref(conn);
 
@@ -2311,7 +2311,7 @@ ksocknal_find_timed_out_conn (ksock_peer_t *peer)
                }
 
                if ((!list_empty(&conn->ksnc_tx_queue) ||
-                    cfs_sock_wmem_queued(conn->ksnc_sock) != 0) &&
+                    conn->ksnc_sock->sk->sk_wmem_queued != 0) &&
                    cfs_time_aftereq(cfs_time_current(),
                                     conn->ksnc_tx_deadline)) {
                        /* Timed out messages queued for sending or
@@ -2508,7 +2508,7 @@ ksocknal_check_peer_timeouts (int idx)
                       "resid: %d, wmem: %d\n",
                       n, libcfs_nid2str(peer->ksnp_id.nid), tx,
                       cfs_duration_sec(cfs_time_current() - deadline),
-                      resid, cfs_sock_wmem_queued(conn->ksnc_sock));
+                      resid, conn->ksnc_sock->sk->sk_wmem_queued);
 
                ksocknal_close_conn_and_siblings (conn, -ETIMEDOUT);
                ksocknal_conn_decref(conn);
index d18bab19cd9ac6e54ae95523f6ca067a43d8b134..245c9d7560afa68f969a04b8b5d8963eca515af4 100644 (file)
@@ -695,7 +695,7 @@ ksocknal_lib_memory_pressure(ksock_conn_t *conn)
        sched = conn->ksnc_scheduler;
        spin_lock_bh(&sched->kss_lock);
 
-       if (!SOCK_TEST_NOSPACE(conn->ksnc_sock) &&
+       if (!test_bit(SOCK_NOSPACE, &conn->ksnc_sock->flags) &&
            !conn->ksnc_tx_ready) {
                /* SOCK_NOSPACE is set when the socket fills
                 * and cleared in the write_space callback
index eb14dfd4b0f58af3ba5523748c1d7301729c0a5f..a93b6210705b6c275506de48a75e56ed651b9351 100644 (file)
@@ -545,7 +545,7 @@ libcfs_sock_accept (struct socket **newsockp, struct socket *sock)
        newsock->ops = sock->ops;
 
        set_current_state(TASK_INTERRUPTIBLE);
-       add_wait_queue(cfs_sk_sleep(sock->sk), &wait);
+       add_wait_queue(sk_sleep(sock->sk), &wait);
 
        rc = sock->ops->accept(sock, newsock, O_NONBLOCK);
        if (rc == -EAGAIN) {
@@ -554,7 +554,7 @@ libcfs_sock_accept (struct socket **newsockp, struct socket *sock)
                rc = sock->ops->accept(sock, newsock, O_NONBLOCK);
        }
 
-       remove_wait_queue(cfs_sk_sleep(sock->sk), &wait);
+       remove_wait_queue(sk_sleep(sock->sk), &wait);
        set_current_state(TASK_RUNNING);
 
        if (rc != 0)
@@ -573,7 +573,7 @@ EXPORT_SYMBOL(libcfs_sock_accept);
 void
 libcfs_sock_abort_accept (struct socket *sock)
 {
-       wake_up_all(cfs_sk_sleep(sock->sk));
+       wake_up_all(sk_sleep(sock->sk));
 }
 
 EXPORT_SYMBOL(libcfs_sock_abort_accept);