Commit 922da0c5 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Greg Kroah-Hartman

staging/lustre: remove wrappers for timer functions

This is a simple cleanup that I did after noticing that the abstraction
for the timer functions in completely pointless, and the one user (ptlrpc)
can just as well call the native Linux functions.

For good measure, this also removes the empty libcfs_arch_init()
and libcfs_arch_cleanup() functions that are defined in the
same file.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 806d6514
......@@ -62,9 +62,6 @@ static inline int __is_po2(unsigned long long val)
#include <linux/list.h>
int libcfs_arch_init(void);
void libcfs_arch_cleanup(void);
/* need both kernel and user-land acceptor */
#define LNET_ACCEPTOR_MIN_RESERVED_PORT 512
#define LNET_ACCEPTOR_MAX_RESERVED_PORT 1023
......
......@@ -40,20 +40,8 @@
#ifndef __LIBCFS_PRIM_H__
#define __LIBCFS_PRIM_H__
/*
* Timer
*/
typedef void (cfs_timer_func_t)(ulong_ptr_t);
void add_wait_queue_exclusive_head(wait_queue_head_t *, wait_queue_t *);
void cfs_init_timer(struct timer_list *t);
void cfs_timer_init(struct timer_list *t, cfs_timer_func_t *func, void *arg);
void cfs_timer_arm(struct timer_list *t, unsigned long deadline);
void cfs_timer_disarm(struct timer_list *t);
int cfs_timer_is_armed(struct timer_list *t);
unsigned long cfs_timer_deadline(struct timer_list *t);
/*
* Memory
*/
......
......@@ -70,55 +70,6 @@ add_wait_queue_exclusive_head(wait_queue_head_t *waitq, wait_queue_t *link)
}
EXPORT_SYMBOL(add_wait_queue_exclusive_head);
void cfs_init_timer(struct timer_list *t)
{
init_timer(t);
}
EXPORT_SYMBOL(cfs_init_timer);
void cfs_timer_init(struct timer_list *t, cfs_timer_func_t *func, void *arg)
{
init_timer(t);
t->function = func;
t->data = (unsigned long)arg;
}
EXPORT_SYMBOL(cfs_timer_init);
void cfs_timer_arm(struct timer_list *t, unsigned long deadline)
{
mod_timer(t, deadline);
}
EXPORT_SYMBOL(cfs_timer_arm);
void cfs_timer_disarm(struct timer_list *t)
{
del_timer(t);
}
EXPORT_SYMBOL(cfs_timer_disarm);
int cfs_timer_is_armed(struct timer_list *t)
{
return timer_pending(t);
}
EXPORT_SYMBOL(cfs_timer_is_armed);
unsigned long cfs_timer_deadline(struct timer_list *t)
{
return t->expires;
}
EXPORT_SYMBOL(cfs_timer_deadline);
void cfs_enter_debugger(void)
{
#if defined(CONFIG_KGDB)
/* BREAKPOINT(); */
#else
/* nothing */
#endif
}
EXPORT_SYMBOL(cfs_enter_debugger);
sigset_t
cfs_block_allsigs(void)
{
......@@ -194,18 +145,3 @@ cfs_clear_sigpending(void)
spin_unlock_irqrestore(&current->sighand->siglock, flags);
}
EXPORT_SYMBOL(cfs_clear_sigpending);
int
libcfs_arch_init(void)
{
return 0;
}
EXPORT_SYMBOL(libcfs_arch_init);
void
libcfs_arch_cleanup(void)
{
return;
}
EXPORT_SYMBOL(libcfs_arch_cleanup);
......@@ -701,7 +701,6 @@ static int init_libcfs_module(void)
{
int rc;
libcfs_arch_init();
libcfs_init_nidstrings();
rc = libcfs_debug_init(5 * 1024 * 1024);
......@@ -777,8 +776,6 @@ static void exit_libcfs_module(void)
rc = libcfs_debug_cleanup();
if (rc)
pr_err("LustreError: libcfs_debug_cleanup: %d\n", rc);
libcfs_arch_cleanup();
}
MODULE_VERSION("1.0.0");
......
......@@ -649,7 +649,9 @@ ptlrpc_service_part_init(struct ptlrpc_service *svc,
if (array->paa_reqs_count == NULL)
goto free_reqs_array;
cfs_timer_init(&svcpt->scp_at_timer, ptlrpc_at_timer, svcpt);
setup_timer(&svcpt->scp_at_timer, ptlrpc_at_timer,
(unsigned long)svcpt);
/* At SOW, service time should be quick; 10s seems generous. If client
* timeout is less than this, we'll be sending an early reply. */
at_init(&svcpt->scp_at_estimate, 10, 0);
......@@ -1124,7 +1126,7 @@ static void ptlrpc_at_set_timer(struct ptlrpc_service_part *svcpt)
__s32 next;
if (array->paa_count == 0) {
cfs_timer_disarm(&svcpt->scp_at_timer);
del_timer(&svcpt->scp_at_timer);
return;
}
......@@ -1134,7 +1136,7 @@ static void ptlrpc_at_set_timer(struct ptlrpc_service_part *svcpt)
if (next <= 0) {
ptlrpc_at_timer((unsigned long)svcpt);
} else {
cfs_timer_arm(&svcpt->scp_at_timer, cfs_time_shift(next));
mod_timer(&svcpt->scp_at_timer, cfs_time_shift(next));
CDEBUG(D_INFO, "armed %s at %+ds\n",
svcpt->scp_service->srv_name, next);
}
......@@ -2840,7 +2842,7 @@ ptlrpc_service_del_atimer(struct ptlrpc_service *svc)
/* early disarm AT timer... */
ptlrpc_service_for_each_part(svcpt, i, svc) {
if (svcpt->scp_service != NULL)
cfs_timer_disarm(&svcpt->scp_at_timer);
del_timer(&svcpt->scp_at_timer);
}
}
......@@ -2980,7 +2982,7 @@ ptlrpc_service_free(struct ptlrpc_service *svc)
break;
/* In case somebody rearmed this in the meantime */
cfs_timer_disarm(&svcpt->scp_at_timer);
del_timer(&svcpt->scp_at_timer);
array = &svcpt->scp_at_array;
kfree(array->paa_reqs_array);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment