Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cb850bb3 authored by James Simmons's avatar James Simmons Committed by Greg Kroah-Hartman
Browse files

staging: lustre: lnet: change lst_nid_t to proper structure

parent a2db578b
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -68,12 +68,12 @@
#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;
+1 −1
Original line number Diff line number Diff line
@@ -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;
+6 −6
Original line number Diff line number Diff line
@@ -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,
+4 −4
Original line number Diff line number Diff line
@@ -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);
+2 −2
Original line number Diff line number Diff line
@@ -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;
Loading