Whamcloud - gitweb
LU-10560 libcfs: handle rename to wait_queue_entry_t 53/31153/11
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Fri, 9 Feb 2018 18:22:50 +0000 (13:22 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 22 Feb 2018 05:40:31 +0000 (05:40 +0000)
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 <mike.marciniszyn@intel.com>
Reviewed-on: https://review.whamcloud.com/31153
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Ben Evans <bevans@cray.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
19 files changed:
contrib/scripts/spelling.txt
libcfs/autoconf/lustre-libcfs.m4
libcfs/include/libcfs/linux/linux-misc.h
libcfs/libcfs/debug.c
libcfs/libcfs/tracefile.c
lnet/include/lnet/lib-lnet.h
lnet/klnds/o2iblnd/o2iblnd_cb.c
lnet/klnds/socklnd/socklnd_cb.c
lnet/lnet/lib-eq.c
lnet/lnet/lib-socket.c
lustre/autoconf/lustre-core.m4
lustre/fid/fid_request.c
lustre/include/lustre_lib.h
lustre/llite/lcommon_cl.c
lustre/lov/lov_cl_internal.h
lustre/lov/lov_object.c
lustre/obdclass/upcall_cache.c
lustre/ptlrpc/gss/gss_svc_upcall.c
lustre/ptlrpc/sec_bulk.c

index 8fcc0e4..a740266 100644 (file)
@@ -130,5 +130,6 @@ tempnam||mkstemp
 f_dentry||f_path.dentry
 = seq_printf||seq_printf
 return seq_printf||seq_printf
 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)
 DN_MAX_BONUSLEN||DN_BONUS_SIZE(dnodesize)
 DN_OLD_MAX_BONUSLEN||DN_BONUS_SIZE(DNODE_MIN_SIZE)
index df1bfcb..a85f18d 100644 (file)
@@ -817,6 +817,24 @@ LB_CHECK_LINUX_HEADER([linux/sched/signal.h], [
 ]) # LIBCFS_SCHED_HEADERS
 
 #
 ]) # 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 <linux/wait.h>
+],[
+       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
 # 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
 LIBCFS_HOTPLUG_STATE_MACHINE
 # 4.11
 LIBCFS_SCHED_HEADERS
+# 4.13
+LIBCFS_WAIT_QUEUE_ENTRY
 ]) # LIBCFS_PROG_LINUX
 
 #
 ]) # LIBCFS_PROG_LINUX
 
 #
index 351eaa7..57ebfea 100644 (file)
@@ -112,6 +112,10 @@ static inline bool gid_valid(kgid_t gid)
 
 int cfs_get_environ(const char *key, char *value, int *val_len);
 
 
 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
 /*
  * For RHEL6 struct kernel_parm_ops doesn't exist. Also
  * the arguments for .set and .get take different
index ee96827..a329689 100644 (file)
@@ -409,8 +409,8 @@ static int libcfs_debug_dumplog_thread(void *arg)
 
 void libcfs_debug_dumplog(void)
 {
 
 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
        ENTRY;
 
        /* we're being careful to ensure that the kernel thread is
index 87317ca..9079941 100644 (file)
@@ -46,6 +46,7 @@
 #include <linux/pagemap.h>
 #include <linux/uaccess.h>
 #include <libcfs/linux/linux-fs.h>
 #include <linux/pagemap.h>
 #include <linux/uaccess.h>
 #include <libcfs/linux/linux-fs.h>
+#include <libcfs/linux/linux-misc.h>
 #include <libcfs/libcfs.h>
 
 /* XXX move things up to the top, comment */
 #include <libcfs/libcfs.h>
 
 /* XXX move things up to the top, comment */
@@ -951,7 +952,7 @@ static int tracefiled(void *arg)
        complete(&tctl->tctl_start);
 
        while (1) {
        complete(&tctl->tctl_start);
 
        while (1) {
-               wait_queue_t __wait;
+               wait_queue_entry_t __wait;
 
                 pc.pc_want_daemon_pages = 0;
                 collect_pages(&pc);
 
                 pc.pc_want_daemon_pages = 0;
                 collect_pages(&pc);
index 3ca3d7f..bb7293e 100644 (file)
@@ -41,6 +41,7 @@
 # error This include is only for kernel use.
 #endif
 
 # error This include is only for kernel use.
 #endif
 
+#include <libcfs/linux/linux-misc.h>
 #include <libcfs/libcfs.h>
 #include <lnet/api.h>
 #include <lnet/lib-types.h>
 #include <libcfs/libcfs.h>
 #include <lnet/api.h>
 #include <lnet/lib-types.h>
index 56928c5..84cf226 100644 (file)
@@ -3395,7 +3395,7 @@ int
 kiblnd_connd (void *arg)
 {
        spinlock_t        *lock= &kiblnd_data.kib_connd_lock;
 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;
        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;
        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;
        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;
 {
        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;
 
        unsigned long    flags;
        int              rc;
 
index 078638f..c27844e 100644 (file)
@@ -2132,7 +2132,7 @@ ksocknal_connd(void *arg)
 {
        spinlock_t *connd_lock = &ksocknal_data.ksnd_connd_lock;
        struct ksock_connreq *cr;
 {
        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;
 
        int nloops = 0;
        int cons_retry = 0;
 
@@ -2510,7 +2510,7 @@ ksocknal_check_peer_timeouts(int idx)
 
 int ksocknal_reaper(void *arg)
 {
 
 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;
        struct ksock_conn *conn;
        struct ksock_sched *sched;
        struct list_head enomem_conns;
index c827e65..3bca6b7 100644 (file)
@@ -323,7 +323,7 @@ lnet_eq_wait_locked(signed long *timeout)
 __must_hold(&the_lnet.ln_eq_wait_lock)
 {
        signed long tms = *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)
        int wait;
 
        if (tms == 0)
index ec6f001..0f1778d 100644 (file)
@@ -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)
 {
 int
 lnet_sock_accept(struct socket **newsockp, struct socket *sock)
 {
-       wait_queue_t   wait;
+       wait_queue_entry_t wait;
        struct socket *newsock;
        int            rc;
 
        struct socket *newsock;
        int            rc;
 
index dbc3416..cfe5efb 100644 (file)
@@ -506,7 +506,8 @@ __add_wait_queue_exclusive, [
        #include <linux/wait.h>
 ],[
        wait_queue_head_t queue;
        #include <linux/wait.h>
 ],[
        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,
        __add_wait_queue_exclusive(&queue, &wait);
 ],[
        AC_DEFINE(HAVE___ADD_WAIT_QUEUE_EXCLUSIVE, 1,
index 2f45caf..30709a8 100644 (file)
@@ -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,
 }
 
 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);
 {
        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)
 {
 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);
        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)
 {
 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;
 
        int rc;
        ENTRY;
 
@@ -406,7 +406,7 @@ EXPORT_SYMBOL(seq_client_alloc_fid);
  */
 void seq_client_flush(struct lu_client_seq *seq)
 {
  */
 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);
 
        LASSERT(seq != NULL);
        init_waitqueue_entry(&link, current);
index 8334d8f..5acfd89 100644 (file)
@@ -47,6 +47,7 @@
 #include <linux/sched/mm.h>
 #endif
 
 #include <linux/sched/mm.h>
 #endif
 
+#include <libcfs/linux/linux-misc.h>
 #include <libcfs/libcfs.h>
 #include <uapi/linux/lustre/lustre_idl.h>
 #include <uapi/linux/lustre/lustre_ver.h>
 #include <libcfs/libcfs.h>
 #include <uapi/linux/lustre/lustre_idl.h>
 #include <uapi/linux/lustre/lustre_ver.h>
@@ -221,7 +222,7 @@ struct l_wait_info {
 /*
  * Wait Queue
  */
 /*
  * 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)
 {
 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 {                                                                           \
  */
 #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;                             \
        cfs_duration_t __timeout = info->lwi_timeout;                          \
        sigset_t   __blocked;                                              \
        int   __allow_intr = info->lwi_allow_intr;                             \
index c49051a..1249be0 100644 (file)
@@ -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;
 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;
 
        if (unlikely(atomic_read(&header->loh_ref) != 1)) {
                struct lu_site *site = obj->co_lu.lo_dev->ld_site;
index 76b1155..1609be5 100644 (file)
@@ -474,7 +474,7 @@ struct lov_thread_info {
        struct ost_lvb          lti_lvb;
        struct cl_2queue        lti_cl2q;
        struct cl_page_list     lti_plist;
        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;
 };
 
 /**
 };
 
 /**
index 1b337a2..4edcb89 100644 (file)
@@ -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;
        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);
 
 
         LASSERT(r0->lo_sub[idx] == los);
 
index d56cf5b..e31b9ea 100644 (file)
@@ -35,6 +35,7 @@
  */
 #define DEBUG_SUBSYSTEM S_SEC
 
  */
 #define DEBUG_SUBSYSTEM S_SEC
 
+#include <libcfs/linux/linux-misc.h>
 #include <libcfs/libcfs.h>
 #include <uapi/linux/lnet/lnet-types.h>
 #include <upcall_cache.h>
 #include <libcfs/libcfs.h>
 #include <uapi/linux/lnet/lnet-types.h>
 #include <upcall_cache.h>
@@ -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;
 {
        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;
 
        int rc, found;
        ENTRY;
 
index 05b7454..35ed8d1 100644 (file)
@@ -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;
        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;
        int                        replen = sizeof(struct ptlrpc_body);
        struct gss_rep_header     *rephdr;
        int                        first_check = 1;
index 426a804..f8d3222 100644 (file)
@@ -540,7 +540,7 @@ EXPORT_SYMBOL(pool_is_at_full_capacity);
  */
 int sptlrpc_enc_pool_get_pages(struct ptlrpc_bulk_desc *desc)
 {
  */
 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;
        unsigned long this_idle = -1;
        u64 tick_ns = 0;
        time64_t now;