Commit fb4a1539 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

staging: lustre: remove linux-tcpip.h

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: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e12517f3
...@@ -45,12 +45,12 @@ ...@@ -45,12 +45,12 @@
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/types.h> #include <linux/types.h>
#include <net/sock.h>
#include <stdarg.h> #include <stdarg.h>
#include "linux-cpu.h" #include "linux-cpu.h"
#include "linux-time.h" #include "linux-time.h"
#include "linux-mem.h" #include "linux-mem.h"
#include "linux-prim.h" #include "linux-prim.h"
#include "linux-tcpip.h"
#include "kp30.h" #include "kp30.h"
#include <asm/types.h> #include <asm/types.h>
......
/*
* 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
...@@ -1258,7 +1258,7 @@ ksocknal_create_conn (lnet_ni_t *ni, ksock_route_t *route, ...@@ -1258,7 +1258,7 @@ ksocknal_create_conn (lnet_ni_t *ni, ksock_route_t *route,
conn->ksnc_tx_last_post = cfs_time_current(); conn->ksnc_tx_last_post = cfs_time_current();
/* Set the deadline for the outgoing HELLO to drain */ /* 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); conn->ksnc_tx_deadline = cfs_time_shift(*ksocknal_tunables.ksnd_timeout);
mb(); /* order with adding to peer's conn list */ 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) ...@@ -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) { list_for_each (tmp, &peer->ksnp_conns) {
conn = list_entry(tmp, ksock_conn_t, ksnc_list); 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) { if (bufnob < conn->ksnc_tx_bufnob) {
/* something got ACKed */ /* something got ACKed */
......
...@@ -212,7 +212,7 @@ ksocknal_transmit (ksock_conn_t *conn, ksock_tx_t *tx) ...@@ -212,7 +212,7 @@ ksocknal_transmit (ksock_conn_t *conn, ksock_tx_t *tx)
rc = ksocknal_send_kiov (conn, 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? */ if (rc > 0) /* sent something? */
conn->ksnc_tx_bufnob += rc; /* account it */ 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) ...@@ -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) { list_for_each (tmp, &peer->ksnp_conns) {
ksock_conn_t *c = list_entry(tmp, ksock_conn_t, ksnc_list); ksock_conn_t *c = list_entry(tmp, ksock_conn_t, ksnc_list);
int nob = atomic_read(&c->ksnc_tx_nob) + int nob = atomic_read(&c->ksnc_tx_nob) +
cfs_sock_wmem_queued(c->ksnc_sock); c->ksnc_sock->sk->sk_wmem_queued;
int rc; int rc;
LASSERT (!c->ksnc_closing); LASSERT (!c->ksnc_closing);
...@@ -726,7 +726,7 @@ ksocknal_queue_tx_locked (ksock_tx_t *tx, ksock_conn_t *conn) ...@@ -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__ * FIXME: SOCK_WMEM_QUEUED and SOCK_ERROR could block in __DARWIN8__
* but they're used inside spinlocks a lot. * 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); spin_lock_bh(&sched->kss_lock);
if (list_empty(&conn->ksnc_tx_queue) && bufnob == 0) { if (list_empty(&conn->ksnc_tx_queue) && bufnob == 0) {
...@@ -2260,7 +2260,7 @@ ksocknal_find_timed_out_conn (ksock_peer_t *peer) ...@@ -2260,7 +2260,7 @@ ksocknal_find_timed_out_conn (ksock_peer_t *peer)
/* SOCK_ERROR will reset error code of socket in /* SOCK_ERROR will reset error code of socket in
* some platform (like Darwin8.x) */ * some platform (like Darwin8.x) */
error = cfs_sock_error(conn->ksnc_sock); error = conn->ksnc_sock->sk->sk_err;
if (error != 0) { if (error != 0) {
ksocknal_conn_addref(conn); ksocknal_conn_addref(conn);
...@@ -2311,7 +2311,7 @@ ksocknal_find_timed_out_conn (ksock_peer_t *peer) ...@@ -2311,7 +2311,7 @@ ksocknal_find_timed_out_conn (ksock_peer_t *peer)
} }
if ((!list_empty(&conn->ksnc_tx_queue) || 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(), cfs_time_aftereq(cfs_time_current(),
conn->ksnc_tx_deadline)) { conn->ksnc_tx_deadline)) {
/* Timed out messages queued for sending or /* Timed out messages queued for sending or
...@@ -2508,7 +2508,7 @@ ksocknal_check_peer_timeouts (int idx) ...@@ -2508,7 +2508,7 @@ ksocknal_check_peer_timeouts (int idx)
"resid: %d, wmem: %d\n", "resid: %d, wmem: %d\n",
n, libcfs_nid2str(peer->ksnp_id.nid), tx, n, libcfs_nid2str(peer->ksnp_id.nid), tx,
cfs_duration_sec(cfs_time_current() - deadline), 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_close_conn_and_siblings (conn, -ETIMEDOUT);
ksocknal_conn_decref(conn); ksocknal_conn_decref(conn);
......
...@@ -695,7 +695,7 @@ ksocknal_lib_memory_pressure(ksock_conn_t *conn) ...@@ -695,7 +695,7 @@ ksocknal_lib_memory_pressure(ksock_conn_t *conn)
sched = conn->ksnc_scheduler; sched = conn->ksnc_scheduler;
spin_lock_bh(&sched->kss_lock); 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) { !conn->ksnc_tx_ready) {
/* SOCK_NOSPACE is set when the socket fills /* SOCK_NOSPACE is set when the socket fills
* and cleared in the write_space callback * and cleared in the write_space callback
......
...@@ -545,7 +545,7 @@ libcfs_sock_accept (struct socket **newsockp, struct socket *sock) ...@@ -545,7 +545,7 @@ libcfs_sock_accept (struct socket **newsockp, struct socket *sock)
newsock->ops = sock->ops; newsock->ops = sock->ops;
set_current_state(TASK_INTERRUPTIBLE); 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); rc = sock->ops->accept(sock, newsock, O_NONBLOCK);
if (rc == -EAGAIN) { if (rc == -EAGAIN) {
...@@ -554,7 +554,7 @@ libcfs_sock_accept (struct socket **newsockp, struct socket *sock) ...@@ -554,7 +554,7 @@ libcfs_sock_accept (struct socket **newsockp, struct socket *sock)
rc = sock->ops->accept(sock, newsock, O_NONBLOCK); 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); set_current_state(TASK_RUNNING);
if (rc != 0) if (rc != 0)
...@@ -573,7 +573,7 @@ EXPORT_SYMBOL(libcfs_sock_accept); ...@@ -573,7 +573,7 @@ EXPORT_SYMBOL(libcfs_sock_accept);
void void
libcfs_sock_abort_accept (struct socket *sock) 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); EXPORT_SYMBOL(libcfs_sock_abort_accept);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment