From: Mike Marciniszyn Date: Fri, 9 Feb 2018 18:22:50 +0000 (-0500) Subject: LU-10560 libcfs: handle rename to wait_queue_entry_t X-Git-Tag: 2.10.59~97 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=9b7ca14430edf84f8c031b1489b3c0d2fb617535 LU-10560 libcfs: handle rename to wait_queue_entry_t The 4.13 kernel renames wait_queue_t to wait_queue_entry_t. Add a probe and handle rename across the code base and have a define to translate to the new name when indicated. Test-Parameters: trivial Change-Id: I8f0f5ec4d02ccb270acb72ccffe13f0ecf6bd2f7 Signed-off-by: Mike Marciniszyn Reviewed-on: https://review.whamcloud.com/31153 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Ben Evans Reviewed-by: Bob Glossman Reviewed-by: Dmitry Eremin Reviewed-by: Andreas Dilger --- diff --git a/contrib/scripts/spelling.txt b/contrib/scripts/spelling.txt index 8fcc0e4..a740266 100644 --- a/contrib/scripts/spelling.txt +++ b/contrib/scripts/spelling.txt @@ -130,5 +130,6 @@ tempnam||mkstemp f_dentry||f_path.dentry = seq_printf||seq_printf return seq_printf||seq_printf +wait_queue_t|wait_queue_entry_t DN_MAX_BONUSLEN||DN_BONUS_SIZE(dnodesize) DN_OLD_MAX_BONUSLEN||DN_BONUS_SIZE(DNODE_MIN_SIZE) diff --git a/libcfs/autoconf/lustre-libcfs.m4 b/libcfs/autoconf/lustre-libcfs.m4 index df1bfcb..a85f18d 100644 --- a/libcfs/autoconf/lustre-libcfs.m4 +++ b/libcfs/autoconf/lustre-libcfs.m4 @@ -817,6 +817,24 @@ LB_CHECK_LINUX_HEADER([linux/sched/signal.h], [ ]) # LIBCFS_SCHED_HEADERS # +# LIBCFS_WAIT_QUEUE_ENTRY +# +# Kernel version 4.13 ac6424b981bce1c4bc55675c6ce11bfe1bbfa64f +# Rename wait_queue_t => wait_queue_entry_t +# +AC_DEFUN([LIBCFS_WAIT_QUEUE_ENTRY], [ +LB_CHECK_COMPILE([if 'wait_queue_entry_t' exists], +wait_queue_entry, [ + #include +],[ + wait_queue_entry_t e; +],[ + AC_DEFINE(HAVE_WAIT_QUEUE_ENTRY, 1, + ['wait_queue_entry_t' is available]) +]) +]) # LIBCFS_WAIT_QUEUE_ENTRY + +# # LIBCFS_PROG_LINUX # # LibCFS linux kernel checks @@ -895,6 +913,8 @@ LIBCFS_GET_USER_PAGES_GUP_FLAGS LIBCFS_HOTPLUG_STATE_MACHINE # 4.11 LIBCFS_SCHED_HEADERS +# 4.13 +LIBCFS_WAIT_QUEUE_ENTRY ]) # LIBCFS_PROG_LINUX # diff --git a/libcfs/include/libcfs/linux/linux-misc.h b/libcfs/include/libcfs/linux/linux-misc.h index 351eaa7..57ebfea 100644 --- a/libcfs/include/libcfs/linux/linux-misc.h +++ b/libcfs/include/libcfs/linux/linux-misc.h @@ -112,6 +112,10 @@ static inline bool gid_valid(kgid_t gid) int cfs_get_environ(const char *key, char *value, int *val_len); +#ifndef HAVE_WAIT_QUEUE_ENTRY +#define wait_queue_entry_t wait_queue_t +#endif + /* * For RHEL6 struct kernel_parm_ops doesn't exist. Also * the arguments for .set and .get take different diff --git a/libcfs/libcfs/debug.c b/libcfs/libcfs/debug.c index ee96827..a329689 100644 --- a/libcfs/libcfs/debug.c +++ b/libcfs/libcfs/debug.c @@ -409,8 +409,8 @@ static int libcfs_debug_dumplog_thread(void *arg) void libcfs_debug_dumplog(void) { - wait_queue_t wait; - struct task_struct *dumper; + wait_queue_entry_t wait; + struct task_struct *dumper; ENTRY; /* we're being careful to ensure that the kernel thread is diff --git a/libcfs/libcfs/tracefile.c b/libcfs/libcfs/tracefile.c index 87317ca..9079941 100644 --- a/libcfs/libcfs/tracefile.c +++ b/libcfs/libcfs/tracefile.c @@ -46,6 +46,7 @@ #include #include #include +#include #include /* XXX move things up to the top, comment */ @@ -951,7 +952,7 @@ static int tracefiled(void *arg) complete(&tctl->tctl_start); while (1) { - wait_queue_t __wait; + wait_queue_entry_t __wait; pc.pc_want_daemon_pages = 0; collect_pages(&pc); diff --git a/lnet/include/lnet/lib-lnet.h b/lnet/include/lnet/lib-lnet.h index 3ca3d7f..bb7293e 100644 --- a/lnet/include/lnet/lib-lnet.h +++ b/lnet/include/lnet/lib-lnet.h @@ -41,6 +41,7 @@ # error This include is only for kernel use. #endif +#include #include #include #include diff --git a/lnet/klnds/o2iblnd/o2iblnd_cb.c b/lnet/klnds/o2iblnd/o2iblnd_cb.c index 56928c5..84cf226 100644 --- a/lnet/klnds/o2iblnd/o2iblnd_cb.c +++ b/lnet/klnds/o2iblnd/o2iblnd_cb.c @@ -3395,7 +3395,7 @@ int kiblnd_connd (void *arg) { spinlock_t *lock= &kiblnd_data.kib_connd_lock; - wait_queue_t wait; + wait_queue_entry_t wait; unsigned long flags; kib_conn_t *conn; int timeout; @@ -3643,7 +3643,7 @@ kiblnd_scheduler(void *arg) long id = (long)arg; struct kib_sched_info *sched; kib_conn_t *conn; - wait_queue_t wait; + wait_queue_entry_t wait; unsigned long flags; struct ib_wc wc; int did_something; @@ -3785,7 +3785,7 @@ kiblnd_failover_thread(void *arg) { rwlock_t *glock = &kiblnd_data.kib_global_lock; kib_dev_t *dev; - wait_queue_t wait; + wait_queue_entry_t wait; unsigned long flags; int rc; diff --git a/lnet/klnds/socklnd/socklnd_cb.c b/lnet/klnds/socklnd/socklnd_cb.c index 078638f..c27844e 100644 --- a/lnet/klnds/socklnd/socklnd_cb.c +++ b/lnet/klnds/socklnd/socklnd_cb.c @@ -2132,7 +2132,7 @@ ksocknal_connd(void *arg) { spinlock_t *connd_lock = &ksocknal_data.ksnd_connd_lock; struct ksock_connreq *cr; - wait_queue_t wait; + wait_queue_entry_t wait; int nloops = 0; int cons_retry = 0; @@ -2510,7 +2510,7 @@ ksocknal_check_peer_timeouts(int idx) int ksocknal_reaper(void *arg) { - wait_queue_t wait; + wait_queue_entry_t wait; struct ksock_conn *conn; struct ksock_sched *sched; struct list_head enomem_conns; diff --git a/lnet/lnet/lib-eq.c b/lnet/lnet/lib-eq.c index c827e65..3bca6b7 100644 --- a/lnet/lnet/lib-eq.c +++ b/lnet/lnet/lib-eq.c @@ -323,7 +323,7 @@ lnet_eq_wait_locked(signed long *timeout) __must_hold(&the_lnet.ln_eq_wait_lock) { signed long tms = *timeout; - wait_queue_t wl; + wait_queue_entry_t wl; int wait; if (tms == 0) diff --git a/lnet/lnet/lib-socket.c b/lnet/lnet/lib-socket.c index ec6f001..0f1778d 100644 --- a/lnet/lnet/lib-socket.c +++ b/lnet/lnet/lib-socket.c @@ -568,7 +568,7 @@ static inline wait_queue_head_t *sk_sleep(struct sock *sk) int lnet_sock_accept(struct socket **newsockp, struct socket *sock) { - wait_queue_t wait; + wait_queue_entry_t wait; struct socket *newsock; int rc; diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index dbc3416..cfe5efb 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -506,7 +506,8 @@ __add_wait_queue_exclusive, [ #include ],[ wait_queue_head_t queue; - wait_queue_t wait; + wait_queue_t wait; + __add_wait_queue_exclusive(&queue, &wait); ],[ AC_DEFINE(HAVE___ADD_WAIT_QUEUE_EXCLUSIVE, 1, diff --git a/lustre/fid/fid_request.c b/lustre/fid/fid_request.c index 2f45caf..30709a8 100644 --- a/lustre/fid/fid_request.c +++ b/lustre/fid/fid_request.c @@ -245,7 +245,7 @@ static int seq_client_alloc_seq(const struct lu_env *env, } static int seq_fid_alloc_prep(struct lu_client_seq *seq, - wait_queue_t *link) + wait_queue_entry_t *link) { if (seq->lcs_update) { add_wait_queue(&seq->lcs_waitq, link); @@ -308,7 +308,7 @@ static void seq_fid_alloc_fini(struct lu_client_seq *seq, __u64 seqnr, int seq_client_get_seq(const struct lu_env *env, struct lu_client_seq *seq, u64 *seqnr) { - wait_queue_t link; + wait_queue_entry_t link; int rc; LASSERT(seqnr != NULL); @@ -345,7 +345,7 @@ EXPORT_SYMBOL(seq_client_get_seq); int seq_client_alloc_fid(const struct lu_env *env, struct lu_client_seq *seq, struct lu_fid *fid) { - wait_queue_t link; + wait_queue_entry_t link; int rc; ENTRY; @@ -406,7 +406,7 @@ EXPORT_SYMBOL(seq_client_alloc_fid); */ void seq_client_flush(struct lu_client_seq *seq) { - wait_queue_t link; + wait_queue_entry_t link; LASSERT(seq != NULL); init_waitqueue_entry(&link, current); diff --git a/lustre/include/lustre_lib.h b/lustre/include/lustre_lib.h index 8334d8f..5acfd89 100644 --- a/lustre/include/lustre_lib.h +++ b/lustre/include/lustre_lib.h @@ -47,6 +47,7 @@ #include #endif +#include #include #include #include @@ -221,7 +222,7 @@ struct l_wait_info { /* * Wait Queue */ -#ifndef HAVE___ADD_WAIT_QUEUE_EXCLUSIVE +#if !defined(HAVE___ADD_WAIT_QUEUE_EXCLUSIVE) && !defined(HAVE_WAIT_QUEUE_ENTRY) static inline void __add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t *wait) { @@ -258,7 +259,7 @@ static inline void __add_wait_queue_exclusive(wait_queue_head_t *q, */ #define __l_wait_event(wq, condition, info, ret, l_add_wait) \ do { \ - wait_queue_t __wait; \ + wait_queue_entry_t __wait; \ cfs_duration_t __timeout = info->lwi_timeout; \ sigset_t __blocked; \ int __allow_intr = info->lwi_allow_intr; \ diff --git a/lustre/llite/lcommon_cl.c b/lustre/llite/lcommon_cl.c index c49051a..1249be0 100644 --- a/lustre/llite/lcommon_cl.c +++ b/lustre/llite/lcommon_cl.c @@ -200,7 +200,7 @@ int cl_file_inode_init(struct inode *inode, struct lustre_md *md) static void cl_object_put_last(struct lu_env *env, struct cl_object *obj) { struct lu_object_header *header = obj->co_lu.lo_header; - wait_queue_t waiter; + wait_queue_entry_t waiter; if (unlikely(atomic_read(&header->loh_ref) != 1)) { struct lu_site *site = obj->co_lu.lo_dev->ld_site; diff --git a/lustre/lov/lov_cl_internal.h b/lustre/lov/lov_cl_internal.h index 76b1155..1609be5 100644 --- a/lustre/lov/lov_cl_internal.h +++ b/lustre/lov/lov_cl_internal.h @@ -474,7 +474,7 @@ struct lov_thread_info { struct ost_lvb lti_lvb; struct cl_2queue lti_cl2q; struct cl_page_list lti_plist; - wait_queue_t lti_waiter; + wait_queue_entry_t lti_waiter; }; /** diff --git a/lustre/lov/lov_object.c b/lustre/lov/lov_object.c index 1b337a2..4edcb89 100644 --- a/lustre/lov/lov_object.c +++ b/lustre/lov/lov_object.c @@ -283,7 +283,7 @@ static void lov_subobject_kill(const struct lu_env *env, struct lov_object *lov, struct cl_object *sub; struct lu_site *site; struct lu_site_bkt_data *bkt; - wait_queue_t *waiter; + wait_queue_entry_t *waiter; LASSERT(r0->lo_sub[idx] == los); diff --git a/lustre/obdclass/upcall_cache.c b/lustre/obdclass/upcall_cache.c index d56cf5b..e31b9ea 100644 --- a/lustre/obdclass/upcall_cache.c +++ b/lustre/obdclass/upcall_cache.c @@ -35,6 +35,7 @@ */ #define DEBUG_SUBSYSTEM S_SEC +#include #include #include #include @@ -148,7 +149,7 @@ struct upcall_cache_entry *upcall_cache_get_entry(struct upcall_cache *cache, { struct upcall_cache_entry *entry = NULL, *new = NULL, *next; struct list_head *head; - wait_queue_t wait; + wait_queue_entry_t wait; int rc, found; ENTRY; diff --git a/lustre/ptlrpc/gss/gss_svc_upcall.c b/lustre/ptlrpc/gss/gss_svc_upcall.c index 05b7454..35ed8d1 100644 --- a/lustre/ptlrpc/gss/gss_svc_upcall.c +++ b/lustre/ptlrpc/gss/gss_svc_upcall.c @@ -935,7 +935,7 @@ int gss_svc_upcall_handle_init(struct ptlrpc_request *req, struct ptlrpc_reply_state *rs; struct rsc *rsci = NULL; struct rsi *rsip = NULL, rsikey; - wait_queue_t wait; + wait_queue_entry_t wait; int replen = sizeof(struct ptlrpc_body); struct gss_rep_header *rephdr; int first_check = 1; diff --git a/lustre/ptlrpc/sec_bulk.c b/lustre/ptlrpc/sec_bulk.c index 426a804..f8d3222 100644 --- a/lustre/ptlrpc/sec_bulk.c +++ b/lustre/ptlrpc/sec_bulk.c @@ -540,7 +540,7 @@ EXPORT_SYMBOL(pool_is_at_full_capacity); */ int sptlrpc_enc_pool_get_pages(struct ptlrpc_bulk_desc *desc) { - wait_queue_t waitlink; + wait_queue_entry_t waitlink; unsigned long this_idle = -1; u64 tick_ns = 0; time64_t now;