-/* -*- 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 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.
*/
/*
#define LST_PING_TEST_MAGIC 0xbabeface
typedef struct {
- spinlock_t pnd_lock; /* serialize */
+ cfs_spinlock_t pnd_lock; /* serialize */
int pnd_counter; /* sequence counter */
} lst_ping_data_t;
{
LASSERT (tsi->tsi_is_client);
- spin_lock_init(&lst_ping_data.pnd_lock);
+ cfs_spin_lock_init(&lst_ping_data.pnd_lock);
lst_ping_data.pnd_counter = 0;
return 0;
LASSERT (sn != NULL);
LASSERT (tsi->tsi_is_client);
- errors = atomic_read(&sn->sn_ping_errors);
+ errors = cfs_atomic_read(&sn->sn_ping_errors);
if (errors)
CWARN ("%d pings have failed.\n", errors);
else
req->pnr_magic = LST_PING_TEST_MAGIC;
- spin_lock(&lst_ping_data.pnd_lock);
+ cfs_spin_lock(&lst_ping_data.pnd_lock);
req->pnr_seq = lst_ping_data.pnd_counter ++;
- spin_unlock(&lst_ping_data.pnd_lock);
+ cfs_spin_unlock(&lst_ping_data.pnd_lock);
cfs_fs_timeval(&tv);
req->pnr_time_sec = tv.tv_sec;
if (rpc->crpc_status != 0) {
if (!tsi->tsi_stopping) /* rpc could have been aborted */
- atomic_inc(&sn->sn_ping_errors);
+ cfs_atomic_inc(&sn->sn_ping_errors);
CERROR ("Unable to ping %s (%d): %d\n",
libcfs_id2str(rpc->crpc_dest),
reqst->pnr_seq, rpc->crpc_status);
if (reply->pnr_magic != LST_PING_TEST_MAGIC) {
rpc->crpc_status = -EBADMSG;
- atomic_inc(&sn->sn_ping_errors);
+ cfs_atomic_inc(&sn->sn_ping_errors);
CERROR ("Bad magic %u from %s, %u expected.\n",
reply->pnr_magic, libcfs_id2str(rpc->crpc_dest),
LST_PING_TEST_MAGIC);
if (reply->pnr_seq != reqst->pnr_seq) {
rpc->crpc_status = -EBADMSG;
- atomic_inc(&sn->sn_ping_errors);
+ cfs_atomic_inc(&sn->sn_ping_errors);
CERROR ("Bad seq %u from %s, %u expected.\n",
reply->pnr_seq, libcfs_id2str(rpc->crpc_dest),
reqst->pnr_seq);