Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-2673 procfs: call lprocfs_free_xxx_stats() later
[fs/lustre-release.git]
/
lnet
/
ulnds
/
socklnd
/
poll.c
diff --git
a/lnet/ulnds/socklnd/poll.c
b/lnet/ulnds/socklnd/poll.c
index
01ea259
..
3baa11a
100644
(file)
--- a/
lnet/ulnds/socklnd/poll.c
+++ b/
lnet/ulnds/socklnd/poll.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.
* GPL HEADER START
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@
-26,8
+24,10
@@
* GPL HEADER END
*/
/*
* GPL HEADER END
*/
/*
- * Copyright
2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright
(c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2012, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
*/
/*
* This file is part of Lustre, http://www.lustre.org/
@@
-45,12
+45,12
@@
void
usocklnd_process_stale_list(usock_pollthread_t *pt_data)
{
void
usocklnd_process_stale_list(usock_pollthread_t *pt_data)
{
- while (!list_empty(&pt_data->upt_stale_list)) {
+ while (!
cfs_
list_empty(&pt_data->upt_stale_list)) {
usock_conn_t *conn;
usock_conn_t *conn;
- conn = list_entry(pt_data->upt_stale_list.next,
- usock_conn_t, uc_stale_list);
+ conn =
cfs_
list_entry(pt_data->upt_stale_list.next,
+
usock_conn_t, uc_stale_list);
- list_del(&conn->uc_stale_list);
+
cfs_
list_del(&conn->uc_stale_list);
usocklnd_tear_peer_conn(conn);
usocklnd_conn_decref(conn); /* -1 for idx2conn[idx] or pr */
usocklnd_tear_peer_conn(conn);
usocklnd_conn_decref(conn); /* -1 for idx2conn[idx] or pr */
@@
-90,12
+90,12
@@
usocklnd_poll_thread(void *arg)
/* Process all enqueued poll requests */
pthread_mutex_lock(&pt_data->upt_pollrequests_lock);
/* Process all enqueued poll requests */
pthread_mutex_lock(&pt_data->upt_pollrequests_lock);
- while (!list_empty(&pt_data->upt_pollrequests)) {
+ while (!
cfs_
list_empty(&pt_data->upt_pollrequests)) {
usock_pollrequest_t *pr;
usock_pollrequest_t *pr;
- pr = list_entry(pt_data->upt_pollrequests.next,
- usock_pollrequest_t, upr_list);
+ pr =
cfs_
list_entry(pt_data->upt_pollrequests.next,
+
usock_pollrequest_t, upr_list);
- list_del(&pr->upr_list);
+
cfs_
list_del(&pr->upr_list);
rc = usocklnd_process_pollrequest(pr, pt_data);
if (rc)
break;
rc = usocklnd_process_pollrequest(pr, pt_data);
if (rc)
break;
@@
-171,17
+171,17
@@
usocklnd_poll_thread(void *arg)
/* Block new poll requests to be enqueued */
pt_data->upt_errno = rc;
/* Block new poll requests to be enqueued */
pt_data->upt_errno = rc;
- while (!list_empty(&pt_data->upt_pollrequests)) {
+ while (!
cfs_
list_empty(&pt_data->upt_pollrequests)) {
usock_pollrequest_t *pr;
usock_pollrequest_t *pr;
- pr = list_entry(pt_data->upt_pollrequests.next,
+ pr =
cfs_
list_entry(pt_data->upt_pollrequests.next,
usock_pollrequest_t, upr_list);
usock_pollrequest_t, upr_list);
- list_del(&pr->upr_list);
+
cfs_
list_del(&pr->upr_list);
if (pr->upr_type == POLL_ADD_REQUEST) {
libcfs_sock_release(pr->upr_conn->uc_sock);
if (pr->upr_type == POLL_ADD_REQUEST) {
libcfs_sock_release(pr->upr_conn->uc_sock);
- list_add_tail(&pr->upr_conn->uc_stale_list,
- &pt_data->upt_stale_list);
+
cfs_
list_add_tail(&pr->upr_conn->uc_stale_list,
+
&pt_data->upt_stale_list);
} else {
usocklnd_conn_decref(pr->upr_conn);
}
} else {
usocklnd_conn_decref(pr->upr_conn);
}
@@
-202,7
+202,7
@@
usocklnd_poll_thread(void *arg)
}
/* unblock usocklnd_shutdown() */
}
/* unblock usocklnd_shutdown() */
-
cfs
_complete(&pt_data->upt_completion);
+
mt
_complete(&pt_data->upt_completion);
return 0;
}
return 0;
}
@@
-237,7
+237,7
@@
usocklnd_add_pollrequest(usock_conn_t *conn, int type, short value)
return rc;
}
return rc;
}
- list_add_tail(&pr->upr_list, &pt->upt_pollrequests);
+
cfs_
list_add_tail(&pr->upr_list, &pt->upt_pollrequests);
pthread_mutex_unlock(&pt->upt_pollrequests_lock);
return 0;
}
pthread_mutex_unlock(&pt->upt_pollrequests_lock);
return 0;
}
@@
-266,7
+266,7
@@
usocklnd_add_killrequest(usock_conn_t *conn)
return; /* conn will be killed in poll thread anyway */
}
return; /* conn will be killed in poll thread anyway */
}
- list_add_tail(&pr->upr_list, &pt->upt_pollrequests);
+
cfs_
list_add_tail(&pr->upr_list, &pt->upt_pollrequests);
pthread_mutex_unlock(&pt->upt_pollrequests_lock);
conn->uc_preq = NULL;
pthread_mutex_unlock(&pt->upt_pollrequests_lock);
conn->uc_preq = NULL;
@@
-387,7
+387,8
@@
usocklnd_process_pollrequest(usock_pollrequest_t *pr,
}
libcfs_sock_release(conn->uc_sock);
}
libcfs_sock_release(conn->uc_sock);
- list_add_tail(&conn->uc_stale_list, &pt_data->upt_stale_list);
+ cfs_list_add_tail(&conn->uc_stale_list,
+ &pt_data->upt_stale_list);
break;
case POLL_RX_SET_REQUEST:
pollfd[idx].events = (pollfd[idx].events & ~POLLIN) | value;
break;
case POLL_RX_SET_REQUEST:
pollfd[idx].events = (pollfd[idx].events & ~POLLIN) | value;