X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lnet%2Fklnds%2Fsocklnd%2Fsocklnd_lib-winnt.c;h=0ffd8b04a66dfe8f0e4333429235659519b43037;hb=59071a8334bbc1a3a6d31565b7474063438d1f43;hp=250556fab43d70d0c50cff5e329c90996faf4ad6;hpb=0f8dca08a4f68cba82c2c822998ecc309d3b7aaf;p=fs%2Flustre-release.git diff --git a/lnet/klnds/socklnd/socklnd_lib-winnt.c b/lnet/klnds/socklnd/socklnd_lib-winnt.c old mode 100755 new mode 100644 index 250556f..0ffd8b0 --- a/lnet/klnds/socklnd/socklnd_lib-winnt.c +++ b/lnet/klnds/socklnd/socklnd_lib-winnt.c @@ -1,6 +1,4 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * +/* * GPL HEADER START * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,6 +26,8 @@ /* * Copyright (c) 2007, 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/ @@ -41,9 +41,9 @@ #include "socklnd.h" # if defined(CONFIG_SYSCTL) && !CFS_SYSFS_MODULE_PARM -static cfs_sysctl_table_t ksocknal_ctl_table[21]; +static struct ctl_table ksocknal_ctl_table[21]; -cfs_sysctl_table_t ksocknal_top_ctl_table[] = { +struct ctl_table ksocknal_top_ctl_table[] = { { /* ctl_name */ 200, /* procname */ "socknal", @@ -248,7 +248,7 @@ ksocknal_lib_tunables_init () LASSERT (i <= sizeof(ksocknal_ctl_table)/sizeof(ksocknal_ctl_table[0])); 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"); @@ -259,8 +259,8 @@ ksocknal_lib_tunables_init () void ksocknal_lib_tunables_fini () { - if (ksocknal_tunables.ksnd_sysctl != NULL) - cfs_unregister_sysctl_table(ksocknal_tunables.ksnd_sysctl); + if (ksocknal_tunables.ksnd_sysctl != NULL) + unregister_sysctl_table(ksocknal_tunables.ksnd_sysctl); } #else int @@ -544,7 +544,7 @@ ksocknal_lib_push_conn (ksock_conn_t *conn) ks_get_tconn(tconn); - cfs_spin_lock(&tconn->kstc_lock); + spin_lock(&tconn->kstc_lock); if (tconn->kstc_type == kstt_sender) { nagle = tconn->sender.kstc_info.nagle; tconn->sender.kstc_info.nagle = 0; @@ -554,7 +554,7 @@ ksocknal_lib_push_conn (ksock_conn_t *conn) tconn->child.kstc_info.nagle = 0; } - cfs_spin_unlock(&tconn->kstc_lock); + spin_unlock(&tconn->kstc_lock); val = 1; rc = ks_set_tcp_option( @@ -565,15 +565,15 @@ ksocknal_lib_push_conn (ksock_conn_t *conn) ); LASSERT (rc == 0); - cfs_spin_lock(&tconn->kstc_lock); - - if (tconn->kstc_type == kstt_sender) { - tconn->sender.kstc_info.nagle = nagle; - } else { - LASSERT(tconn->kstc_type == kstt_child); - tconn->child.kstc_info.nagle = nagle; - } - cfs_spin_unlock(&tconn->kstc_lock); + spin_lock(&tconn->kstc_lock); + + if (tconn->kstc_type == kstt_sender) { + tconn->sender.kstc_info.nagle = nagle; + } else { + LASSERT(tconn->kstc_type == kstt_child); + tconn->child.kstc_info.nagle = nagle; + } + spin_unlock(&tconn->kstc_lock); ks_put_tconn(tconn); } @@ -618,28 +618,28 @@ void ksocknal_schedule_callback(struct socket*sock, int mode) { ksock_conn_t * conn = (ksock_conn_t *) sock->kstc_conn; - cfs_read_lock (&ksocknal_data.ksnd_global_lock); + read_lock(&ksocknal_data.ksnd_global_lock); if (mode) { ksocknal_write_callback(conn); } else { ksocknal_read_callback(conn); } - cfs_read_unlock (&ksocknal_data.ksnd_global_lock); + read_unlock(&ksocknal_data.ksnd_global_lock); } void ksocknal_tx_fini_callback(ksock_conn_t * conn, ksock_tx_t * tx) { - /* remove tx/conn from conn's outgoing queue */ - cfs_spin_lock_bh (&conn->ksnc_scheduler->kss_lock); - cfs_list_del(&tx->tx_list); - if (cfs_list_empty(&conn->ksnc_tx_queue)) { - cfs_list_del (&conn->ksnc_tx_list); - } - cfs_spin_unlock_bh (&conn->ksnc_scheduler->kss_lock); + /* remove tx/conn from conn's outgoing queue */ + spin_lock_bh(&conn->ksnc_scheduler->kss_lock); + cfs_list_del(&tx->tx_list); + if (cfs_list_empty(&conn->ksnc_tx_queue)) + cfs_list_del(&conn->ksnc_tx_list); + + spin_unlock_bh(&conn->ksnc_scheduler->kss_lock); - /* complete send; tx -ref */ - ksocknal_tx_decref (tx); + /* complete send; tx -ref */ + ksocknal_tx_decref(tx); } void