int rc;
int bufnob;
- if (ksocknal_data.ksnd_stall_tx != 0) {
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(cfs_time_seconds(ksocknal_data.ksnd_stall_tx));
- }
+ if (ksocknal_data.ksnd_stall_tx != 0)
+ schedule_timeout_uninterruptible(
+ cfs_time_seconds(ksocknal_data.ksnd_stall_tx));
LASSERT(tx->tx_resid != 0);
int rc;
ENTRY;
- if (ksocknal_data.ksnd_stall_rx != 0) {
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(cfs_time_seconds(ksocknal_data.ksnd_stall_rx));
- }
+ if (ksocknal_data.ksnd_stall_rx != 0)
+ schedule_timeout_uninterruptible(
+ cfs_time_seconds(ksocknal_data.ksnd_stall_rx));
rc = ksocknal_connsock_addref(conn);
if (rc != 0) {
/* Set up to skip as much as possible now. If there's more left
* (ran out of iov entries) we'll get called again */
- conn->ksnc_rx_state = SOCKNAL_RX_SLOP;
- conn->ksnc_rx_nob_left = nob_to_skip;
+ conn->ksnc_rx_state = SOCKNAL_RX_SLOP;
+ conn->ksnc_rx_nob_left = nob_to_skip;
conn->ksnc_rx_iov = (struct kvec *)&conn->ksnc_rx_iov_space;
- skipped = 0;
- niov = 0;
+ skipped = 0;
+ niov = 0;
- do {
- nob = MIN (nob_to_skip, sizeof (ksocknal_slop_buffer));
+ do {
+ nob = min_t(int, nob_to_skip, sizeof(ksocknal_slop_buffer));
- conn->ksnc_rx_iov[niov].iov_base = ksocknal_slop_buffer;
- conn->ksnc_rx_iov[niov].iov_len = nob;
- niov++;
- skipped += nob;
- nob_to_skip -=nob;
+ conn->ksnc_rx_iov[niov].iov_base = ksocknal_slop_buffer;
+ conn->ksnc_rx_iov[niov].iov_len = nob;
+ niov++;
+ skipped += nob;
+ nob_to_skip -= nob;
- } while (nob_to_skip != 0 && /* mustn't overflow conn's rx iov */
+ } while (nob_to_skip != 0 && /* mustn't overflow conn's rx iov */
niov < sizeof(conn->ksnc_rx_iov_space) / sizeof(struct kvec));
conn->ksnc_rx_niov = niov;
EXIT;
}
-static struct ksock_proto *
-ksocknal_parse_proto_version (struct ksock_hello_msg *hello)
+static const struct ksock_proto *
+ksocknal_parse_proto_version(struct ksock_hello_msg *hello)
{
__u32 version = 0;
int timeout;
int proto_match;
int rc;
- struct ksock_proto *proto;
+ const struct ksock_proto *proto;
struct lnet_process_id recv_id;
/* socket type set on active connections - not set on passive */
*incarnation = hello->kshm_src_incarnation;
- if (hello->kshm_src_nid == LNET_NID_ANY) {
- CERROR("Expecting a HELLO hdr with a NID, but got LNET_NID_ANY"
- "from %pI4h\n", &conn->ksnc_ipaddr);
- return -EPROTO;
- }
+ if (hello->kshm_src_nid == LNET_NID_ANY) {
+ CERROR("Expecting a HELLO hdr with a NID, but got LNET_NID_ANY from %pI4h\n",
+ &conn->ksnc_ipaddr);
+ return -EPROTO;
+ }
if (!active &&
conn->ksnc_port > LNET_ACCEPTOR_MAX_RESERVED_PORT) {
nloops = 0;
schedule_timeout(timeout);
- set_current_state(TASK_RUNNING);
remove_wait_queue(&ksocknal_data.ksnd_connd_waitq, &wait);
spin_lock_bh(connd_lock);
}
wait_queue_entry_t wait;
struct ksock_conn *conn;
struct ksock_sched *sched;
- struct list_head enomem_conns;
+ LIST_HEAD(enomem_conns);
int nenomem_conns;
time64_t timeout;
int i;
cfs_block_allsigs ();
- INIT_LIST_HEAD(&enomem_conns);
init_waitqueue_entry(&wait, current);
spin_lock_bh(&ksocknal_data.ksnd_reaper_lock);