diff options
Diffstat (limited to 'drivers/staging/lustre/lustre/ptlrpc/pinger.c')
-rw-r--r-- | drivers/staging/lustre/lustre/ptlrpc/pinger.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/drivers/staging/lustre/lustre/ptlrpc/pinger.c b/drivers/staging/lustre/lustre/ptlrpc/pinger.c index 9dbda9332..d05c37c1f 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pinger.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pinger.c @@ -91,7 +91,7 @@ int ptlrpc_obd_ping(struct obd_device *obd) } EXPORT_SYMBOL(ptlrpc_obd_ping); -int ptlrpc_ping(struct obd_import *imp) +static int ptlrpc_ping(struct obd_import *imp) { struct ptlrpc_request *req; @@ -110,7 +110,7 @@ int ptlrpc_ping(struct obd_import *imp) return 0; } -void ptlrpc_update_next_ping(struct obd_import *imp, int soon) +static void ptlrpc_update_next_ping(struct obd_import *imp, int soon) { int time = soon ? PING_INTERVAL_SHORT : PING_INTERVAL; if (imp->imp_state == LUSTRE_IMP_DISCON) { @@ -141,7 +141,7 @@ static inline int ptlrpc_next_reconnect(struct obd_import *imp) return cfs_time_shift(obd_timeout); } -long pinger_check_timeout(unsigned long time) +static long pinger_check_timeout(unsigned long time) { struct timeout_item *item; unsigned long timeout = PING_INTERVAL; @@ -289,12 +289,10 @@ static int ptlrpc_pinger_main(void *arg) thread_is_stopping(thread) || thread_is_event(thread), &lwi); - if (thread_test_and_clear_flags(thread, SVC_STOPPING)) { + if (thread_test_and_clear_flags(thread, SVC_STOPPING)) break; - } else { - /* woken after adding import to reset timer */ - thread_test_and_clear_flags(thread, SVC_EVENT); - } + /* woken after adding import to reset timer */ + thread_test_and_clear_flags(thread, SVC_EVENT); } } @@ -422,12 +420,12 @@ EXPORT_SYMBOL(ptlrpc_pinger_del_import); * Register a timeout callback to the pinger list, and the callback will * be called when timeout happens. */ -struct timeout_item *ptlrpc_new_timeout(int time, enum timeout_event event, - timeout_cb_t cb, void *data) +static struct timeout_item *ptlrpc_new_timeout(int time, + enum timeout_event event, timeout_cb_t cb, void *data) { struct timeout_item *ti; - OBD_ALLOC_PTR(ti); + ti = kzalloc(sizeof(*ti), GFP_NOFS); if (!ti) return NULL; @@ -514,7 +512,7 @@ int ptlrpc_del_timeout_client(struct list_head *obd_list, LASSERTF(ti != NULL, "ti is NULL !\n"); if (list_empty(&ti->ti_obd_list)) { list_del(&ti->ti_chain); - OBD_FREE_PTR(ti); + kfree(ti); } mutex_unlock(&pinger_mutex); return 0; @@ -529,7 +527,7 @@ int ptlrpc_pinger_remove_timeouts(void) list_for_each_entry_safe(item, tmp, &timeout_list, ti_chain) { LASSERT(list_empty(&item->ti_obd_list)); list_del(&item->ti_chain); - OBD_FREE_PTR(item); + kfree(item); } mutex_unlock(&pinger_mutex); return 0; @@ -546,9 +544,9 @@ void ptlrpc_pinger_wake_up(void) #define PET_TERMINATE 2 static int pet_refcount; -static int pet_state; -static wait_queue_head_t pet_waitq; -LIST_HEAD(pet_list); +static int pet_state; +static wait_queue_head_t pet_waitq; +static LIST_HEAD(pet_list); static DEFINE_SPINLOCK(pet_lock); int ping_evictor_wake(struct obd_export *exp) |