diff mbox series

[RFC,08/14] cifs: typedef ses status enum

Message ID 20220724151137.7538-9-ematsumiya@suse.de (mailing list archive)
State New, archived
Headers show
Series cifs: rename of several structs and variables | expand

Commit Message

Enzo Matsumiya July 24, 2022, 3:11 p.m. UTC
typedef "enum ses_status_enum" to "cifs_ses_status_t".
Rename the status values.

Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
---
 fs/cifs/cifs_debug.c    |  4 ++--
 fs/cifs/cifsglob.h      | 16 ++++++++--------
 fs/cifs/cifssmb.c       |  2 +-
 fs/cifs/connect.c       | 34 +++++++++++++++++-----------------
 fs/cifs/misc.c          |  2 +-
 fs/cifs/smb2pdu.c       |  2 +-
 fs/cifs/smb2transport.c |  4 ++--
 fs/cifs/transport.c     |  8 ++++----
 8 files changed, 36 insertions(+), 36 deletions(-)
diff mbox series

Patch

diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index eb24928e1298..c88bea9d3ac3 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -382,7 +382,7 @@  static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
 				(ses->serverNOS == NULL)) {
 				seq_printf(m, "\n\t%d) Address: %s Uses: %d Capability: 0x%x\tSession Status: %d ",
 					i, ses->ip_addr, ses->ses_count,
-					ses->capabilities, ses->ses_status);
+					ses->capabilities, ses->status);
 				if (ses->session_flags & SMB2_SESSION_FLAG_IS_GUEST)
 					seq_printf(m, "Guest ");
 				else if (ses->session_flags & SMB2_SESSION_FLAG_IS_NULL)
@@ -394,7 +394,7 @@  static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
 					"\n\tSMB session status: %d ",
 				i, ses->ip_addr, ses->serverDomain,
 				ses->ses_count, ses->serverOS, ses->serverNOS,
-				ses->capabilities, ses->ses_status);
+				ses->capabilities, ses->status);
 			}
 
 			seq_printf(m, "\n\tSecurity type: %s ",
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 49e0821fd61d..0fa23f392bb9 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -121,13 +121,13 @@  typedef enum {
 } cifs_server_status_t;
 
 /* associated with each smb session */
-enum ses_status_enum {
-	SES_NEW = 0,
-	SES_GOOD,
-	SES_EXITING,
-	SES_NEED_RECON,
-	SES_IN_SETUP
-};
+typedef enum {
+	SES_STATUS_NEW = 0,
+	SES_STATUS_GOOD,
+	SES_STATUS_EXITING,
+	SES_STATUS_NEED_RECONNECT,
+	SES_STATUS_IN_SETUP
+} cifs_ses_status_t;
 
 /* associated with each tree connection to the server */
 enum tid_status_enum {
@@ -1011,7 +1011,7 @@  struct cifs_ses {
 	struct mutex session_mutex;
 	struct cifs_server_info *server;	/* pointer to server info */
 	int ses_count;		/* reference counter */
-	enum ses_status_enum ses_status;  /* updates protected by g_servers_lock */
+	cifs_ses_status_t status;  /* updates protected by g_servers_lock */
 	unsigned overrideSecFlg;  /* if non-zero override global sec flags */
 	char *serverOS;		/* name of operating system underlying server */
 	char *serverNOS;	/* name of network operating system of server */
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index c88a42ebb509..25009dd47f96 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -75,7 +75,7 @@  cifs_mark_open_files_invalid(struct cifs_tcon *tcon)
 
 	/* only send once per connect */
 	spin_lock(&g_servers_lock);
-	if ((tcon->ses->ses_status != SES_GOOD) || (tcon->status != TID_NEED_RECON)) {
+	if ((tcon->ses->status != SES_STATUS_GOOD) || (tcon->status != TID_NEED_RECON)) {
 		spin_unlock(&g_servers_lock);
 		return;
 	}
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index ec014e007ff9..55264aef1b83 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -277,7 +277,7 @@  cifs_mark_server_conns_for_reconnect(struct cifs_server_info *server,
 		if (!mark_smb_session && !CIFS_ALL_CHANS_NEED_RECONNECT(ses))
 			goto next_session;
 
-		ses->ses_status = SES_NEED_RECON;
+		ses->status = SES_STATUS_NEED_RECONNECT;
 
 		list_for_each_entry(tcon, &ses->tcon_list, tcon_list) {
 			tcon->need_reconnect = true;
@@ -1863,7 +1863,7 @@  cifs_find_smb_ses(struct cifs_server_info *server, struct smb3_fs_context *ctx)
 
 	spin_lock(&g_servers_lock);
 	list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) {
-		if (ses->ses_status == SES_EXITING)
+		if (ses->status == SES_STATUS_EXITING)
 			continue;
 		if (!match_session(ses, ctx))
 			continue;
@@ -1882,7 +1882,7 @@  void cifs_put_smb_ses(struct cifs_ses *ses)
 	struct cifs_server_info *server = ses->server;
 
 	spin_lock(&g_servers_lock);
-	if (ses->ses_status == SES_EXITING) {
+	if (ses->status == SES_STATUS_EXITING) {
 		spin_unlock(&g_servers_lock);
 		return;
 	}
@@ -1898,13 +1898,13 @@  void cifs_put_smb_ses(struct cifs_ses *ses)
 	/* ses_count can never go negative */
 	WARN_ON(ses->ses_count < 0);
 
-	if (ses->ses_status == SES_GOOD)
-		ses->ses_status = SES_EXITING;
+	if (ses->status == SES_STATUS_GOOD)
+		ses->status = SES_STATUS_EXITING;
 	spin_unlock(&g_servers_lock);
 
 	cifs_free_ipc(ses);
 
-	if (ses->ses_status == SES_EXITING && server->ops->logoff) {
+	if (ses->status == SES_STATUS_EXITING && server->ops->logoff) {
 		xid = get_xid();
 		rc = server->ops->logoff(xid, ses);
 		if (rc)
@@ -2113,7 +2113,7 @@  cifs_get_smb_ses(struct cifs_server_info *server, struct smb3_fs_context *ctx)
 	ses = cifs_find_smb_ses(server, ctx);
 	if (ses) {
 		cifs_dbg(FYI, "Existing smb sess found (status=%d)\n",
-			 ses->ses_status);
+			 ses->status);
 
 		spin_lock(&ses->chan_lock);
 		if (cifs_chan_needs_reconnect(ses, server)) {
@@ -4029,9 +4029,9 @@  cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
 	else
 		scnprintf(ses->ip_addr, sizeof(ses->ip_addr), "%pI4", &addr->sin_addr);
 
-	if (ses->ses_status != SES_GOOD &&
-	    ses->ses_status != SES_NEW &&
-	    ses->ses_status != SES_NEED_RECON) {
+	if (ses->status != SES_STATUS_GOOD &&
+	    ses->status != SES_STATUS_NEW &&
+	    ses->status != SES_STATUS_NEED_RECONNECT) {
 		spin_unlock(&g_servers_lock);
 		return 0;
 	}
@@ -4049,7 +4049,7 @@  cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
 	spin_unlock(&ses->chan_lock);
 
 	if (!is_binding)
-		ses->ses_status = SES_IN_SETUP;
+		ses->status = SES_STATUS_IN_SETUP;
 	spin_unlock(&g_servers_lock);
 
 	if (!is_binding) {
@@ -4075,16 +4075,16 @@  cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
 	if (rc) {
 		cifs_server_dbg(VFS, "Send error in SessSetup = %d\n", rc);
 		spin_lock(&g_servers_lock);
-		if (ses->ses_status == SES_IN_SETUP)
-			ses->ses_status = SES_NEED_RECON;
+		if (ses->status == SES_STATUS_IN_SETUP)
+			ses->status = SES_STATUS_NEED_RECONNECT;
 		spin_lock(&ses->chan_lock);
 		cifs_chan_clear_in_reconnect(ses, server);
 		spin_unlock(&ses->chan_lock);
 		spin_unlock(&g_servers_lock);
 	} else {
 		spin_lock(&g_servers_lock);
-		if (ses->ses_status == SES_IN_SETUP)
-			ses->ses_status = SES_GOOD;
+		if (ses->status == SES_STATUS_IN_SETUP)
+			ses->status = SES_STATUS_GOOD;
 		spin_lock(&ses->chan_lock);
 		cifs_chan_clear_in_reconnect(ses, server);
 		cifs_chan_clear_need_reconnect(ses, server);
@@ -4559,7 +4559,7 @@  int cifs_tree_connect(const unsigned int xid, struct cifs_tcon *tcon, const stru
 
 	/* only send once per connect */
 	spin_lock(&g_servers_lock);
-	if (tcon->ses->ses_status != SES_GOOD ||
+	if (tcon->ses->status != SES_STATUS_GOOD ||
 	    (tcon->status != TID_NEW &&
 	    tcon->status != TID_NEED_TCON)) {
 		spin_unlock(&g_servers_lock);
@@ -4627,7 +4627,7 @@  int cifs_tree_connect(const unsigned int xid, struct cifs_tcon *tcon, const stru
 
 	/* only send once per connect */
 	spin_lock(&g_servers_lock);
-	if (tcon->ses->ses_status != SES_GOOD ||
+	if (tcon->ses->status != SES_STATUS_GOOD ||
 	    (tcon->status != TID_NEW &&
 	    tcon->status != TID_NEED_TCON)) {
 		spin_unlock(&g_servers_lock);
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index a31780cf6d21..e209aa3194de 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -69,7 +69,7 @@  sesInfoAlloc(void)
 	ret_buf = kzalloc(sizeof(struct cifs_ses), GFP_KERNEL);
 	if (ret_buf) {
 		atomic_inc(&g_ses_alloc_count);
-		ret_buf->ses_status = SES_NEW;
+		ret_buf->status = SES_STATUS_NEW;
 		++ret_buf->ses_count;
 		INIT_LIST_HEAD(&ret_buf->smb_ses_list);
 		INIT_LIST_HEAD(&ret_buf->tcon_list);
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 8b06b3267318..e495121f7d99 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -179,7 +179,7 @@  smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon,
 		}
 	}
 	spin_unlock(&g_servers_lock);
-	if ((!tcon->ses) || (tcon->ses->ses_status == SES_EXITING) ||
+	if ((!tcon->ses) || (tcon->ses->status == SES_STATUS_EXITING) ||
 	    (!tcon->ses->server) || !server)
 		return -EIO;
 
diff --git a/fs/cifs/smb2transport.c b/fs/cifs/smb2transport.c
index 5ffe472e692d..5ac2dbffb939 100644
--- a/fs/cifs/smb2transport.c
+++ b/fs/cifs/smb2transport.c
@@ -780,7 +780,7 @@  smb2_get_mid_entry(struct cifs_ses *ses, struct cifs_server_info *server,
 		return -EAGAIN;
 	}
 
-	if (ses->ses_status == SES_NEW) {
+	if (ses->status == SES_STATUS_NEW) {
 		if ((shdr->Command != SMB2_SESSION_SETUP) &&
 		    (shdr->Command != SMB2_NEGOTIATE)) {
 			spin_unlock(&g_servers_lock);
@@ -789,7 +789,7 @@  smb2_get_mid_entry(struct cifs_ses *ses, struct cifs_server_info *server,
 		/* else ok - we are setting up session */
 	}
 
-	if (ses->ses_status == SES_EXITING) {
+	if (ses->status == SES_STATUS_EXITING) {
 		if (shdr->Command != SMB2_LOGOFF) {
 			spin_unlock(&g_servers_lock);
 			return -EAGAIN;
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index 41da942de4a3..b681a0c9b03d 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -726,7 +726,7 @@  static int allocate_mid(struct cifs_ses *ses, struct smb_hdr *in_buf,
 			struct mid_q_entry **ppmidQ)
 {
 	spin_lock(&g_servers_lock);
-	if (ses->ses_status == SES_NEW) {
+	if (ses->status == SES_STATUS_NEW) {
 		if ((in_buf->Command != SMB_COM_SESSION_SETUP_ANDX) &&
 			(in_buf->Command != SMB_COM_NEGOTIATE)) {
 			spin_unlock(&g_servers_lock);
@@ -735,7 +735,7 @@  static int allocate_mid(struct cifs_ses *ses, struct smb_hdr *in_buf,
 		/* else ok - we are setting up session */
 	}
 
-	if (ses->ses_status == SES_EXITING) {
+	if (ses->status == SES_STATUS_EXITING) {
 		/* check if SMB session is bad because we are setting it up */
 		if (in_buf->Command != SMB_COM_LOGOFF_ANDX) {
 			spin_unlock(&g_servers_lock);
@@ -1187,7 +1187,7 @@  compound_send_recv(const unsigned int xid, struct cifs_ses *ses,
 	 * Compounding is never used during session establish.
 	 */
 	spin_lock(&g_servers_lock);
-	if ((ses->ses_status == SES_NEW) || (optype & CIFS_NEG_OP) || (optype & CIFS_SESS_OP)) {
+	if ((ses->status == SES_STATUS_NEW) || (optype & CIFS_NEG_OP) || (optype & CIFS_SESS_OP)) {
 		spin_unlock(&g_servers_lock);
 
 		cifs_server_lock(server);
@@ -1260,7 +1260,7 @@  compound_send_recv(const unsigned int xid, struct cifs_ses *ses,
 	 * Compounding is never used during session establish.
 	 */
 	spin_lock(&g_servers_lock);
-	if ((ses->ses_status == SES_NEW) || (optype & CIFS_NEG_OP) || (optype & CIFS_SESS_OP)) {
+	if ((ses->status == SES_STATUS_NEW) || (optype & CIFS_NEG_OP) || (optype & CIFS_SESS_OP)) {
 		struct kvec iov = {
 			.iov_base = resp_iov[0].iov_base,
 			.iov_len = resp_iov[0].iov_len