]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
staging: lustre: lnet: change lst_nid_t to proper structure
authorJames Simmons <jsimmons@infradead.org>
Mon, 16 Jan 2017 21:30:04 +0000 (16:30 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jan 2017 10:10:14 +0000 (11:10 +0100)
Change lst_nid_t from typedef to proper structure.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142
Reviewed-on: https://review.whamcloud.com/24188
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/include/linux/lnet/lnetst.h
drivers/staging/lustre/lnet/selftest/conrpc.c
drivers/staging/lustre/lnet/selftest/console.c
drivers/staging/lustre/lnet/selftest/console.h
drivers/staging/lustre/lnet/selftest/framework.c
drivers/staging/lustre/lnet/selftest/rpc.h
drivers/staging/lustre/lnet/selftest/selftest.h

index 8a84888635ff112e5b1e859f4678b0345f2663e6..68c7f5837be39c78dc0a075d94b06529fb855e38 100644 (file)
 #define LSTIO_BATCH_QUERY      0xC27   /* query batch status */
 #define LSTIO_STAT_QUERY       0xC30   /* get stats */
 
-typedef struct {
+struct lst_sid {
        lnet_nid_t      ses_nid;        /* nid of console node */
        __u64           ses_stamp;      /* time stamp */
-} lst_sid_t;                           /*** session id */
+};                                     /*** session id */
 
-extern lst_sid_t LST_INVALID_SID;
+extern struct lst_sid LST_INVALID_SID;
 
 typedef struct {
        __u64   bat_id;         /* unique id in session */
@@ -131,7 +131,7 @@ typedef struct {
        int                     rpe_state;      /* peer's state */
        int                     rpe_rpc_errno;  /* RPC errno */
 
-       lst_sid_t               rpe_sid;        /* peer's session id */
+       struct lst_sid          rpe_sid;        /* peer's session id */
        int                     rpe_fwk_errno;  /* framework errno */
        int                     rpe_priv[4];    /* private data */
        char                    rpe_payload[0]; /* private reply payload */
@@ -245,14 +245,14 @@ typedef struct {
        int              lstio_ses_force;       /* IN: force create ? */
        /** IN: session features */
        unsigned int     lstio_ses_feats;
-       lst_sid_t __user *lstio_ses_idp;        /* OUT: session id */
+       struct lst_sid __user *lstio_ses_idp;   /* OUT: session id */
        int              lstio_ses_nmlen;       /* IN: name length */
        char __user      *lstio_ses_namep;      /* IN: session name */
 } lstio_session_new_args_t;
 
 /* query current session */
 typedef struct {
-       lst_sid_t __user        *lstio_ses_idp;         /* OUT: session id */
+       struct lst_sid __user   *lstio_ses_idp;         /* OUT: session id */
        int __user              *lstio_ses_keyp;        /* OUT: local key */
        /** OUT: session features */
        unsigned int __user     *lstio_ses_featp;
index 994422c62487665e43f9ae8fe58511e4c8b0a4f5..84ae01091b61c0e9de53c35b7b378f0ed7ad824a 100644 (file)
@@ -519,7 +519,7 @@ lstcon_rpc_trans_interpreter(struct lstcon_rpc_trans *trans,
                /* RPC is done */
                rep = (struct srpc_generic_reply *)&msg->msg_body.reply;
 
-               if (copy_to_user(&ent->rpe_sid, &rep->sid, sizeof(lst_sid_t)) ||
+               if (copy_to_user(&ent->rpe_sid, &rep->sid, sizeof(rep->sid)) ||
                    copy_to_user(&ent->rpe_fwk_errno, &rep->status,
                                 sizeof(rep->status)))
                        return -EFAULT;
index 1456d2395cc953ffac4dc2e85dfd636d320d7636..02dbfef94956da88e3dfb8568eab8da8ca6a42d6 100644 (file)
@@ -1688,14 +1688,14 @@ lstcon_nodes_debug(int timeout,
 }
 
 int
-lstcon_session_match(lst_sid_t sid)
+lstcon_session_match(struct lst_sid sid)
 {
        return (console_session.ses_id.ses_nid == sid.ses_nid &&
                console_session.ses_id.ses_stamp == sid.ses_stamp) ? 1 : 0;
 }
 
 static void
-lstcon_new_session_id(lst_sid_t *sid)
+lstcon_new_session_id(struct lst_sid *sid)
 {
        lnet_process_id_t id;
 
@@ -1708,7 +1708,7 @@ lstcon_new_session_id(lst_sid_t *sid)
 
 int
 lstcon_session_new(char *name, int key, unsigned int feats,
-                  int timeout, int force, lst_sid_t __user *sid_up)
+                  int timeout, int force, struct lst_sid __user *sid_up)
 {
        int rc = 0;
        int i;
@@ -1767,7 +1767,7 @@ lstcon_session_new(char *name, int key, unsigned int feats,
        }
 
        if (!copy_to_user(sid_up, &console_session.ses_id,
-                         sizeof(lst_sid_t)))
+                         sizeof(struct lst_sid)))
                return rc;
 
        lstcon_session_end();
@@ -1776,7 +1776,7 @@ lstcon_session_new(char *name, int key, unsigned int feats,
 }
 
 int
-lstcon_session_info(lst_sid_t __user *sid_up, int __user *key_up,
+lstcon_session_info(struct lst_sid __user *sid_up, int __user *key_up,
                    unsigned __user *featp,
                    lstcon_ndlist_ent_t __user *ndinfo_up,
                    char __user *name_up, int len)
@@ -1796,7 +1796,7 @@ lstcon_session_info(lst_sid_t __user *sid_up, int __user *key_up,
                LST_NODE_STATE_COUNTER(ndl->ndl_node, entp);
 
        if (copy_to_user(sid_up, &console_session.ses_id,
-                        sizeof(lst_sid_t)) ||
+                        sizeof(*sid_up)) ||
            copy_to_user(key_up, &console_session.ses_key,
                         sizeof(*key_up)) ||
            copy_to_user(featp, &console_session.ses_features,
index 5dc1de48a10ef25a07d79b79c8874399253e75e9..4bf7ecdce966dc6aa58a8020dbfacd329ebc570c 100644 (file)
@@ -140,7 +140,7 @@ struct lstcon_test {
 
 struct lstcon_session {
        struct mutex        ses_mutex;        /* only 1 thread in session */
-       lst_sid_t           ses_id;           /* global session id */
+       struct lst_sid      ses_id;           /* global session id */
        int                 ses_key;          /* local session key */
        int                 ses_state;        /* state of session */
        int                 ses_timeout;      /* timeout in seconds */
@@ -190,10 +190,10 @@ lstcon_id2hash(lnet_process_id_t id, struct list_head *hash)
 int lstcon_ioctl_entry(unsigned int cmd, struct libcfs_ioctl_hdr *hdr);
 int lstcon_console_init(void);
 int lstcon_console_fini(void);
-int lstcon_session_match(lst_sid_t sid);
+int lstcon_session_match(struct lst_sid sid);
 int lstcon_session_new(char *name, int key, unsigned int version,
-                      int timeout, int flags, lst_sid_t __user *sid_up);
-int lstcon_session_info(lst_sid_t __user *sid_up, int __user *key,
+                      int timeout, int flags, struct lst_sid __user *sid_up);
+int lstcon_session_info(struct lst_sid __user *sid_up, int __user *key,
                        unsigned __user *verp, lstcon_ndlist_ent_t __user *entp,
                        char __user *name_up, int len);
 int lstcon_session_end(void);
index 48dcc330dc9b21e9e732c076e99392852ba87847..4100f67f07451bc7ed5cc2666d7e87d6140e0b32 100644 (file)
@@ -39,7 +39,7 @@
 
 #include "selftest.h"
 
-lst_sid_t LST_INVALID_SID = {LNET_NID_ANY, -1};
+struct lst_sid LST_INVALID_SID = {LNET_NID_ANY, -1};
 
 static int session_timeout = 100;
 module_param(session_timeout, int, 0444);
@@ -254,7 +254,7 @@ sfw_session_expired(void *data)
 }
 
 static inline void
-sfw_init_session(struct sfw_session *sn, lst_sid_t sid,
+sfw_init_session(struct sfw_session *sn, struct lst_sid sid,
                 unsigned int features, const char *name)
 {
        struct stt_timer *timer = &sn->sn_timer;
index f353a634cc8eb52ddeeee6d9bd6cc49ee65a893c..3324c3f1adde2216a40d403893aa1b44575da6bd 100644 (file)
@@ -75,43 +75,43 @@ struct srpc_generic_reqst {
 
 struct srpc_generic_reply {
        __u32                   status;
-       lst_sid_t               sid;
+       struct lst_sid          sid;
 } WIRE_ATTR;
 
 /* FRAMEWORK RPCs */
 struct srpc_mksn_reqst {
        __u64                   mksn_rpyid;     /* reply buffer matchbits */
-       lst_sid_t               mksn_sid;       /* session id */
+       struct lst_sid          mksn_sid;       /* session id */
        __u32                   mksn_force;     /* use brute force */
        char                    mksn_name[LST_NAME_SIZE];
 } WIRE_ATTR; /* make session request */
 
 struct srpc_mksn_reply {
        __u32                   mksn_status;    /* session status */
-       lst_sid_t               mksn_sid;       /* session id */
+       struct lst_sid          mksn_sid;       /* session id */
        __u32                   mksn_timeout;   /* session timeout */
        char                    mksn_name[LST_NAME_SIZE];
 } WIRE_ATTR; /* make session reply */
 
 struct srpc_rmsn_reqst {
        __u64                   rmsn_rpyid;     /* reply buffer matchbits */
-       lst_sid_t               rmsn_sid;       /* session id */
+       struct lst_sid          rmsn_sid;       /* session id */
 } WIRE_ATTR; /* remove session request */
 
 struct srpc_rmsn_reply {
        __u32                   rmsn_status;
-       lst_sid_t               rmsn_sid;       /* session id */
+       struct lst_sid          rmsn_sid;       /* session id */
 } WIRE_ATTR; /* remove session reply */
 
 struct srpc_join_reqst {
        __u64                   join_rpyid;     /* reply buffer matchbits */
-       lst_sid_t               join_sid;       /* session id to join */
+       struct lst_sid          join_sid;       /* session id to join */
        char                    join_group[LST_NAME_SIZE]; /* group name */
 } WIRE_ATTR;
 
 struct srpc_join_reply {
        __u32                   join_status;    /* returned status */
-       lst_sid_t               join_sid;       /* session id */
+       struct lst_sid          join_sid;       /* session id */
        __u32                   join_timeout;   /* # seconds' inactivity to
                                                 * expire
                                                 */
@@ -120,13 +120,13 @@ struct srpc_join_reply {
 
 struct srpc_debug_reqst {
        __u64                   dbg_rpyid;      /* reply buffer matchbits */
-       lst_sid_t               dbg_sid;        /* session id */
+       struct lst_sid          dbg_sid;        /* session id */
        __u32                   dbg_flags;      /* bitmap of debug */
 } WIRE_ATTR;
 
 struct srpc_debug_reply {
        __u32                   dbg_status;     /* returned code */
-       lst_sid_t               dbg_sid;        /* session id */
+       struct lst_sid          dbg_sid;        /* session id */
        __u32                   dbg_timeout;    /* session timeout */
        __u32                   dbg_nbatch;     /* # of batches in the node */
        char                    dbg_name[LST_NAME_SIZE]; /* session name */
@@ -138,7 +138,7 @@ struct srpc_debug_reply {
 
 struct srpc_batch_reqst {
        __u64              bar_rpyid;      /* reply buffer matchbits */
-       lst_sid_t          bar_sid;        /* session id */
+       struct lst_sid     bar_sid;        /* session id */
        lst_bid_t          bar_bid;        /* batch id */
        __u32              bar_opc;        /* create/start/stop batch */
        __u32              bar_testidx;    /* index of test */
@@ -147,20 +147,20 @@ struct srpc_batch_reqst {
 
 struct srpc_batch_reply {
        __u32              bar_status;     /* status of request */
-       lst_sid_t          bar_sid;        /* session id */
+       struct lst_sid     bar_sid;        /* session id */
        __u32              bar_active;     /* # of active tests in batch/test */
        __u32              bar_time;       /* remained time */
 } WIRE_ATTR;
 
 struct srpc_stat_reqst {
        __u64              str_rpyid;      /* reply buffer matchbits */
-       lst_sid_t          str_sid;        /* session id */
+       struct lst_sid     str_sid;        /* session id */
        __u32              str_type;       /* type of stat */
 } WIRE_ATTR;
 
 struct srpc_stat_reply {
        __u32              str_status;
-       lst_sid_t          str_sid;
+       struct lst_sid     str_sid;
        sfw_counters_t     str_fw;
        srpc_counters_t    str_rpc;
        lnet_counters_t    str_lnet;
@@ -187,7 +187,7 @@ struct test_ping_req {
 struct srpc_test_reqst {
        __u64                   tsr_rpyid;      /* reply buffer matchbits */
        __u64                   tsr_bulkid;     /* bulk buffer matchbits */
-       lst_sid_t               tsr_sid;        /* session id */
+       struct lst_sid          tsr_sid;        /* session id */
        lst_bid_t               tsr_bid;        /* batch id */
        __u32                   tsr_service;    /* test type: bulk|ping|... */
        __u32                   tsr_loop;       /* test client loop count or
@@ -207,7 +207,7 @@ struct srpc_test_reqst {
 
 struct srpc_test_reply {
        __u32                   tsr_status;     /* returned code */
-       lst_sid_t               tsr_sid;
+       struct lst_sid          tsr_sid;
 } WIRE_ATTR;
 
 /* TEST RPCs */
index c8833a016b6d225392f646e6d32d567bb6d1ad1d..35f98aed46142d48cf8343c1cdce4712ab16a91b 100644 (file)
@@ -322,7 +322,7 @@ struct srpc_service {
 
 struct sfw_session {
        struct list_head sn_list;    /* chain on fw_zombie_sessions */
-       lst_sid_t        sn_id;      /* unique identifier */
+       struct lst_sid   sn_id;      /* unique identifier */
        unsigned int     sn_timeout; /* # seconds' inactivity to expire */
        int              sn_timer_active;
        unsigned int     sn_features;