From 68b636b68ebb58ef7a400886249be6479bdce96d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 4 Aug 2013 08:56:42 +0800 Subject: [PATCH] staging: lustre: remove task_t typedef Use struct task_struct instead. Also remove the unused libcfs_current() function, while I noticed it doing this conversion. Cc: Peng Tao Cc: Andreas Dilger Signed-off-by: Greg Kroah-Hartman --- .../lustre/include/linux/libcfs/linux/linux-prim.h | 4 ---- drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | 2 +- drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c | 2 +- drivers/staging/lustre/lnet/selftest/timer.c | 2 +- drivers/staging/lustre/lustre/include/cl_object.h | 8 ++++---- drivers/staging/lustre/lustre/include/lustre_lib.h | 2 +- drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 2 +- drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 2 +- drivers/staging/lustre/lustre/libcfs/debug.c | 2 +- drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c | 9 --------- drivers/staging/lustre/lustre/libcfs/workitem.c | 3 ++- drivers/staging/lustre/lustre/llite/llite_capa.c | 2 +- drivers/staging/lustre/lustre/llite/llite_close.c | 2 +- drivers/staging/lustre/lustre/llite/statahead.c | 2 +- drivers/staging/lustre/lustre/lov/lov_cl_internal.h | 2 +- drivers/staging/lustre/lustre/obdclass/genops.c | 2 +- drivers/staging/lustre/lustre/osc/osc_cl_internal.h | 4 ++-- drivers/staging/lustre/lustre/ptlrpc/import.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/pinger.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c | 3 ++- drivers/staging/lustre/lustre/ptlrpc/sec_gc.c | 2 +- 21 files changed, 25 insertions(+), 36 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-prim.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-prim.h index ae495a2ee434..c78f71a23592 100644 --- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-prim.h +++ b/drivers/staging/lustre/include/linux/libcfs/linux/linux-prim.h @@ -85,10 +85,6 @@ LL_PROC_PROTO(name) \ */ typedef struct proc_dir_entry proc_dir_entry_t; -/* - * Task struct - */ -typedef struct task_struct task_t; #define DECL_JOURNAL_DATA void *journal_info #define PUSH_JOURNAL do { \ journal_info = current->journal_info; \ diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c index 63a4258ac261..086ca3d7241b 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c @@ -1802,7 +1802,7 @@ kiblnd_recv (lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg, int delayed, int kiblnd_thread_start(int (*fn)(void *arg), void *arg, char *name) { - task_t *task = kthread_run(fn, arg, name); + struct task_struct *task = kthread_run(fn, arg, name); if (IS_ERR(task)) return PTR_ERR(task); diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c index 617570439be6..727f352e8860 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c @@ -1005,7 +1005,7 @@ ksocknal_send(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg) int ksocknal_thread_start(int (*fn)(void *arg), void *arg, char *name) { - task_t *task = kthread_run(fn, arg, name); + struct task_struct *task = kthread_run(fn, arg, name); if (IS_ERR(task)) return PTR_ERR(task); diff --git a/drivers/staging/lustre/lnet/selftest/timer.c b/drivers/staging/lustre/lnet/selftest/timer.c index 2c078550277b..3bf4afb42ffe 100644 --- a/drivers/staging/lustre/lnet/selftest/timer.c +++ b/drivers/staging/lustre/lnet/selftest/timer.c @@ -195,7 +195,7 @@ stt_timer_main (void *arg) int stt_start_timer_thread (void) { - task_t *task; + struct task_struct *task; LASSERT(!stt_data.stt_shuttingdown); diff --git a/drivers/staging/lustre/lustre/include/cl_object.h b/drivers/staging/lustre/lustre/include/cl_object.h index 4a478504c45e..edb40afe66f1 100644 --- a/drivers/staging/lustre/lustre/include/cl_object.h +++ b/drivers/staging/lustre/lustre/include/cl_object.h @@ -758,7 +758,7 @@ struct cl_page { /** * Debug information, the task is owning the page. */ - task_t *cp_task; + struct task_struct *cp_task; /** * Owning IO request in cl_page_state::CPS_PAGEOUT and * cl_page_state::CPS_PAGEIN states. This field is maintained only in @@ -1576,13 +1576,13 @@ struct cl_lock { * \see osc_lock_enqueue_wait(), lov_lock_cancel(), lov_sublock_wait(). */ struct mutex cll_guard; - task_t *cll_guarder; + struct task_struct *cll_guarder; int cll_depth; /** * the owner for INTRANSIT state */ - task_t *cll_intransit_owner; + struct task_struct *cll_intransit_owner; int cll_error; /** * Number of holds on a lock. A hold prevents a lock from being @@ -1869,7 +1869,7 @@ do { \ struct cl_page_list { unsigned pl_nr; struct list_head pl_pages; - task_t *pl_owner; + struct task_struct *pl_owner; }; /** diff --git a/drivers/staging/lustre/lustre/include/lustre_lib.h b/drivers/staging/lustre/lustre/include/lustre_lib.h index e77a74540da7..5e11107d4c66 100644 --- a/drivers/staging/lustre/lustre/include/lustre_lib.h +++ b/drivers/staging/lustre/lustre/include/lustre_lib.h @@ -96,7 +96,7 @@ void statfs_unpack(struct kstatfs *sfs, struct obd_statfs *osfs); /* l_lock.c */ struct lustre_lock { int l_depth; - task_t *l_owner; + struct task_struct *l_owner; struct semaphore l_sem; spinlock_t l_spin; }; diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c index 3ede1a444afd..3916bda3004c 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c @@ -796,7 +796,7 @@ static int ldlm_bl_thread_main(void *arg); static int ldlm_bl_thread_start(struct ldlm_bl_pool *blp) { struct ldlm_bl_thread_data bltd = { .bltd_blp = blp }; - task_t *task; + struct task_struct *task; init_completion(&bltd.bltd_comp); bltd.bltd_num = atomic_read(&blp->blp_num_threads); diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c index 00ff0edd5a2b..0593982f61c2 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c @@ -1339,7 +1339,7 @@ static int ldlm_pools_thread_main(void *arg) static int ldlm_pools_thread_start(void) { struct l_wait_info lwi = { 0 }; - task_t *task; + struct task_struct *task; if (ldlm_pools_thread != NULL) return -EALREADY; diff --git a/drivers/staging/lustre/lustre/libcfs/debug.c b/drivers/staging/lustre/lustre/libcfs/debug.c index cf93b6c6d906..f7216de4cb4f 100644 --- a/drivers/staging/lustre/lustre/libcfs/debug.c +++ b/drivers/staging/lustre/lustre/libcfs/debug.c @@ -361,7 +361,7 @@ int libcfs_debug_dumplog_thread(void *arg) void libcfs_debug_dumplog(void) { wait_queue_t wait; - task_t *dumper; + struct task_struct *dumper; /* we're being careful to ensure that the kernel thread is * able to set our state to running as it exits before we diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c index ec3d97664b1b..ab1e73168472 100644 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c @@ -170,12 +170,6 @@ void lbug_with_loc(struct libcfs_debug_msg_data *msgdata) schedule(); } -task_t *libcfs_current(void) -{ - CWARN("current task struct is %p\n", current); - return current; -} - static int panic_notifier(struct notifier_block *self, unsigned long unused1, void *unused2) { @@ -204,9 +198,6 @@ void libcfs_unregister_panic_notifier(void) atomic_notifier_chain_unregister(&panic_notifier_list, &libcfs_panic_notifier); } -EXPORT_SYMBOL(libcfs_current); - - EXPORT_SYMBOL(libcfs_run_upcall); EXPORT_SYMBOL(libcfs_run_lbug_upcall); EXPORT_SYMBOL(lbug_with_loc); diff --git a/drivers/staging/lustre/lustre/libcfs/workitem.c b/drivers/staging/lustre/lustre/libcfs/workitem.c index b533666c1900..462172d1a756 100644 --- a/drivers/staging/lustre/lustre/libcfs/workitem.c +++ b/drivers/staging/lustre/lustre/libcfs/workitem.c @@ -376,7 +376,8 @@ cfs_wi_sched_create(char *name, struct cfs_cpt_table *cptab, rc = 0; while (nthrs > 0) { char name[16]; - task_t *task; + struct task_struct *task; + spin_lock(&cfs_wi_data.wi_glock); while (sched->ws_starting > 0) { spin_unlock(&cfs_wi_data.wi_glock); diff --git a/drivers/staging/lustre/lustre/llite/llite_capa.c b/drivers/staging/lustre/lustre/llite/llite_capa.c index 1d30181e3bcd..edd512b20ee3 100644 --- a/drivers/staging/lustre/lustre/llite/llite_capa.c +++ b/drivers/staging/lustre/lustre/llite/llite_capa.c @@ -289,7 +289,7 @@ void ll_capa_timer_callback(unsigned long unused) int ll_capa_thread_start(void) { - task_t *task; + struct task_struct *task; init_waitqueue_head(&ll_capa_thread.t_ctl_waitq); diff --git a/drivers/staging/lustre/lustre/llite/llite_close.c b/drivers/staging/lustre/lustre/llite/llite_close.c index 487ce6851d96..1f5825c87a79 100644 --- a/drivers/staging/lustre/lustre/llite/llite_close.c +++ b/drivers/staging/lustre/lustre/llite/llite_close.c @@ -362,7 +362,7 @@ static int ll_close_thread(void *arg) int ll_close_thread_start(struct ll_close_queue **lcq_ret) { struct ll_close_queue *lcq; - task_t *task; + struct task_struct *task; if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_CLOSE_THREAD)) return -EINTR; diff --git a/drivers/staging/lustre/lustre/llite/statahead.c b/drivers/staging/lustre/lustre/llite/statahead.c index 2daca2e90b11..8eaa38e91b99 100644 --- a/drivers/staging/lustre/lustre/llite/statahead.c +++ b/drivers/staging/lustre/lustre/llite/statahead.c @@ -1017,7 +1017,7 @@ static void ll_start_agl(struct dentry *parent, struct ll_statahead_info *sai) struct ptlrpc_thread *thread = &sai->sai_agl_thread; struct l_wait_info lwi = { 0 }; struct ll_inode_info *plli; - task_t *task; + struct task_struct *task; CDEBUG(D_READA, "start agl thread: [pid %d] [parent %.*s]\n", current_pid(), parent->d_name.len, parent->d_name.name); diff --git a/drivers/staging/lustre/lustre/lov/lov_cl_internal.h b/drivers/staging/lustre/lustre/lov/lov_cl_internal.h index a82dfeab5921..33d9ce68fedd 100644 --- a/drivers/staging/lustre/lustre/lov/lov_cl_internal.h +++ b/drivers/staging/lustre/lustre/lov/lov_cl_internal.h @@ -261,7 +261,7 @@ struct lov_object { * Thread that acquired lov_object::lo_type_guard in an exclusive * mode. */ - task_t *lo_owner; + struct task_struct *lo_owner; }; /** diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c b/drivers/staging/lustre/lustre/obdclass/genops.c index bba1b35360d0..68fe71c8a2a9 100644 --- a/drivers/staging/lustre/lustre/obdclass/genops.c +++ b/drivers/staging/lustre/lustre/obdclass/genops.c @@ -1733,7 +1733,7 @@ static int obd_zombie_impexp_thread(void *unused) */ int obd_zombie_impexp_init(void) { - task_t *task; + struct task_struct *task; INIT_LIST_HEAD(&obd_zombie_imports); INIT_LIST_HEAD(&obd_zombie_exports); diff --git a/drivers/staging/lustre/lustre/osc/osc_cl_internal.h b/drivers/staging/lustre/lustre/osc/osc_cl_internal.h index 158e8fff838f..a3aa9b6596ef 100644 --- a/drivers/staging/lustre/lustre/osc/osc_cl_internal.h +++ b/drivers/staging/lustre/lustre/osc/osc_cl_internal.h @@ -374,7 +374,7 @@ struct osc_page { /** * Thread that submitted this page for transfer. For debugging. */ - task_t *ops_submitter; + struct task_struct *ops_submitter; /** * Submit time - the time when the page is starting RPC. For debugging. */ @@ -660,7 +660,7 @@ struct osc_extent { /** lock covering this extent */ struct cl_lock *oe_osclock; /** terminator of this extent. Must be true if this extent is in IO. */ - task_t *oe_owner; + struct task_struct *oe_owner; /** return value of writeback. If somebody is waiting for this extent, * this value can be known by outside world. */ int oe_rc; diff --git a/drivers/staging/lustre/lustre/ptlrpc/import.c b/drivers/staging/lustre/lustre/ptlrpc/import.c index 2cdbb4d909c9..5ca69aec72e1 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/import.c +++ b/drivers/staging/lustre/lustre/ptlrpc/import.c @@ -1305,7 +1305,7 @@ int ptlrpc_import_recovery_state_machine(struct obd_import *imp) spin_unlock(&imp->imp_lock); { - task_t *task; + struct task_struct *task; /* bug 17802: XXX client_disconnect_export vs connect request * race. if client will evicted at this time, we start * invalidate thread without reference to import and import can diff --git a/drivers/staging/lustre/lustre/ptlrpc/pinger.c b/drivers/staging/lustre/lustre/ptlrpc/pinger.c index a9206e955cd3..227a0ae9593b 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pinger.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pinger.c @@ -720,7 +720,7 @@ static int ping_evictor_main(void *arg) void ping_evictor_start(void) { - task_t *task; + struct task_struct *task; if (++pet_refcount > 1) return; diff --git a/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c b/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c index 59c4f83af446..fbdeff65d059 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c +++ b/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c @@ -630,7 +630,8 @@ int ptlrpcd_start(int index, int max, const char *name, struct ptlrpcd_ctl *pc) env = 1; { - task_t *task; + struct task_struct *task; + if (index >= 0) { rc = ptlrpcd_bind(index, max); if (rc < 0) diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c b/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c index 4c96a14a1bb6..d2eb20eb56db 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c @@ -217,7 +217,7 @@ again: int sptlrpc_gc_init(void) { struct l_wait_info lwi = { 0 }; - task_t *task; + struct task_struct *task; mutex_init(&sec_gc_mutex); spin_lock_init(&sec_gc_list_lock); -- 2.34.1