From patchwork Sat Jul 16 05:03:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 12919944 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E04B1C433EF for ; Sat, 16 Jul 2022 05:03:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229571AbiGPFDb (ORCPT ); Sat, 16 Jul 2022 01:03:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbiGPFDa (ORCPT ); Sat, 16 Jul 2022 01:03:30 -0400 Received: from mail-ua1-x930.google.com (mail-ua1-x930.google.com [IPv6:2607:f8b0:4864:20::930]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85A7D40BD6 for ; Fri, 15 Jul 2022 22:03:29 -0700 (PDT) Received: by mail-ua1-x930.google.com with SMTP id s3so3245696uaq.2 for ; Fri, 15 Jul 2022 22:03:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=HZHLXxiLbqeOhK3vWCEb1BnM+6kw8U5FC77Jn7TT3U8=; b=pmPNK8GHiIBfxeJj2WROQvCxeolgYIYWE0ONFP6rn52eZcVCIHAj9zojqTP3Z0HHx8 f4266g9iL9qKpjJFjAVBGJt52Gq+9rchqjxX6sCdcaI+a7bZ3wsYxG7TMtIaINqsibrL Imn7UmUsc02DCqFOyo9u1geouMKMVbT11cbsWQJ2Z9kejvGAClt05dS8qx2xBocnK0a7 EzH3wQhuhOHjx4SbZh9jNb53o0/gQD1Gdzy6szpGPojRRkg4NsfmwSL1PblPIaXXsv7r EIbY/l4GPQptx69ayU8cbT1XD8O9XNX1+XqYKbKyf3JUti8T2FRqJ+y9yoZp0fDdR62i kBzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=HZHLXxiLbqeOhK3vWCEb1BnM+6kw8U5FC77Jn7TT3U8=; b=BGc33WdfD2eB2Jq1MtRrSPhjvQgULhavIJr+xN9kSvl2LxP+0vNitQ3mSQaXc7W5Te 5/0pkX1XamNJGehUobjJPFfdCcSDdAyqPpa5Aw5L+mkmX7JUlLJUue9gQhr48Q/B8pOl biCIJwllOD2mBflKQPNE6EtTXN75gQ/27oR9aZ9xXQXsK0DPNCXapFrLT8xwyk3N5t/B 8OlKensk7NsAir2SnsUA08NfZx9J5AmeyOg7eBvCLDaHoWCG/orDE6U7aRrL6kCUc9LJ KZLf/waWxihivRIsGXYcTJwy8pmqmJ3QF6xzeCMc9Tgb0joE7dH1h5d4JKV6xvBO9Vmz Og/Q== X-Gm-Message-State: AJIora8Pp5KtcXP5WzlKCofjfoa6N2xIwAHLmeQ3ALW4mY7Q3Ox/oq66 Y5+CU6A5MxO27ePiYF1Ww9eAYIE1MQURF2tRtvYsNbm4H299Uw== X-Google-Smtp-Source: AGRyM1um/fIOD6QUjayXQhtQxrYpVf2D4D0g6JaioKrcSP/d26OCO4SUovvbVcAwjieOTrqVBGEGyNu0iYzMEez6Z7s= X-Received: by 2002:ab0:148f:0:b0:379:90dc:9116 with SMTP id d15-20020ab0148f000000b0037990dc9116mr7311266uae.19.1657947808301; Fri, 15 Jul 2022 22:03:28 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Sat, 16 Jul 2022 00:03:04 -0500 Message-ID: Subject: [PATCH][CIFS] remove minor build warnings, and fix some camelCase To: CIFS Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Two trivial patches to remove warnings for seven global variables. For example: fs/cifs/cifsglob.h:1984:24: warning: symbol 'midCount' was not declared. Should it be static? Also change five of them from camelCase (e.g. "midCount" to "mid_count") From 6d3ee864cb704bfbedf3e0a61179c0c4d58c14fe Mon Sep 17 00:00:00 2001 From: Steve French Date: Fri, 15 Jul 2022 23:45:45 -0500 Subject: [PATCH 1/2] cifs: remove some camelCase and also some static build warnings Remove warnings for five global variables. For example: fs/cifs/cifsglob.h:1984:24: warning: symbol 'midCount' was not declared. Should it be static? Also change them from camelCase (e.g. "midCount" to "mid_count") Signed-off-by: Steve French --- fs/cifs/cifs_debug.c | 14 +++++++------- fs/cifs/cifsfs.c | 17 ++++++++++++----- fs/cifs/cifsglob.h | 10 +++++----- fs/cifs/connect.c | 2 +- fs/cifs/misc.c | 12 ++++++------ fs/cifs/smb2transport.c | 2 +- fs/cifs/transport.c | 4 ++-- 7 files changed, 34 insertions(+), 27 deletions(-) diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index 97116c1710e2..f5e63dfac2b1 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c @@ -514,8 +514,8 @@ static ssize_t cifs_stats_proc_write(struct file *file, #ifdef CONFIG_CIFS_STATS2 int i; - atomic_set(&totBufAllocCount, 0); - atomic_set(&totSmBufAllocCount, 0); + atomic_set(&total_buf_alloc_count, 0); + atomic_set(&total_small_buf_alloc_count, 0); #endif /* CONFIG_CIFS_STATS2 */ atomic_set(&tcpSesReconnectCount, 0); atomic_set(&tconInfoReconnectCount, 0); @@ -579,17 +579,17 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v) seq_printf(m, "Share (unique mount targets): %d\n", tconInfoAllocCount.counter); seq_printf(m, "SMB Request/Response Buffer: %d Pool size: %d\n", - bufAllocCount.counter, + buf_alloc_count.counter, cifs_min_rcv + tcpSesAllocCount.counter); seq_printf(m, "SMB Small Req/Resp Buffer: %d Pool size: %d\n", - smBufAllocCount.counter, cifs_min_small); + small_buf_alloc_count.counter, cifs_min_small); #ifdef CONFIG_CIFS_STATS2 seq_printf(m, "Total Large %d Small %d Allocations\n", - atomic_read(&totBufAllocCount), - atomic_read(&totSmBufAllocCount)); + atomic_read(&total_buf_alloc_count), + atomic_read(&total_small_buf_alloc_count)); #endif /* CONFIG_CIFS_STATS2 */ - seq_printf(m, "Operations (MIDs): %d\n", atomic_read(&midCount)); + seq_printf(m, "Operations (MIDs): %d\n", atomic_read(&mid_count)); seq_printf(m, "\n%d session %d share reconnects\n", tcpSesReconnectCount.counter, tconInfoReconnectCount.counter); diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 8f2e003e0590..2732953f49e4 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -68,6 +68,13 @@ bool enable_negotiate_signing; /* false by default */ unsigned int global_secflags = CIFSSEC_DEF; /* unsigned int ntlmv2_support = 0; */ unsigned int sign_CIFS_PDUs = 1; +atomic_t mid_count; +atomic_t buf_alloc_count; +atomic_t small_buf_alloc_count; +#ifdef CONFIG_CIFS_STATS2 +atomic_t total_buf_alloc_count; +atomic_t total_small_buf_alloc_count; +#endif/* STATS2 */ static const struct super_operations cifs_super_ops; unsigned int CIFSMaxBufSize = CIFS_MAX_MSGSIZE; module_param(CIFSMaxBufSize, uint, 0444); @@ -1579,11 +1586,11 @@ init_cifs(void) atomic_set(&tcpSesReconnectCount, 0); atomic_set(&tconInfoReconnectCount, 0); - atomic_set(&bufAllocCount, 0); - atomic_set(&smBufAllocCount, 0); + atomic_set(&buf_alloc_count, 0); + atomic_set(&small_buf_alloc_count, 0); #ifdef CONFIG_CIFS_STATS2 - atomic_set(&totBufAllocCount, 0); - atomic_set(&totSmBufAllocCount, 0); + atomic_set(&total_buf_alloc_count, 0); + atomic_set(&total_small_buf_alloc_count, 0); if (slow_rsp_threshold < 1) cifs_dbg(FYI, "slow_response_threshold msgs disabled\n"); else if (slow_rsp_threshold > 32767) @@ -1591,7 +1598,7 @@ init_cifs(void) "slow response threshold set higher than recommended (0 to 32767)\n"); #endif /* CONFIG_CIFS_STATS2 */ - atomic_set(&midCount, 0); + atomic_set(&mid_count, 0); GlobalCurrentXid = 0; GlobalTotalActiveXid = 0; GlobalMaxActiveXid = 0; diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index a643c84ff1e9..c5eecc9522b3 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -1974,14 +1974,13 @@ GLOBAL_EXTERN atomic_t tcpSesReconnectCount; GLOBAL_EXTERN atomic_t tconInfoReconnectCount; /* Various Debug counters */ -GLOBAL_EXTERN atomic_t bufAllocCount; /* current number allocated */ +extern atomic_t buf_alloc_count; /* current number allocated */ +extern atomic_t small_buf_alloc_count; #ifdef CONFIG_CIFS_STATS2 -GLOBAL_EXTERN atomic_t totBufAllocCount; /* total allocated over all time */ -GLOBAL_EXTERN atomic_t totSmBufAllocCount; +extern atomic_t total_buf_alloc_count; /* total allocated over all time */ +extern atomic_t total_small_buf_alloc_count; extern unsigned int slow_rsp_threshold; /* number of secs before logging */ #endif -GLOBAL_EXTERN atomic_t smBufAllocCount; -GLOBAL_EXTERN atomic_t midCount; /* Misc globals */ extern bool enable_oplocks; /* enable or disable oplocks */ @@ -1998,6 +1997,7 @@ extern unsigned int cifs_min_rcv; /* min size of big ntwrk buf pool */ extern unsigned int cifs_min_small; /* min size of small buf pool */ extern unsigned int cifs_max_pending; /* MAX requests at once to server*/ extern bool disable_legacy_dialects; /* forbid vers=1.0 and vers=2.0 mounts */ +extern atomic_t mid_count; void cifs_oplock_break(struct work_struct *work); void cifs_queue_oplock_break(struct cifsFileInfo *cfile); diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 47a161f86662..fdd8452b8450 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -1240,7 +1240,7 @@ cifs_demultiplex_thread(void *p) cifs_dbg(FYI, "Received oplock break\n"); } else { cifs_server_dbg(VFS, "No task to wake, unknown frame received! NumMids %d\n", - atomic_read(&midCount)); + atomic_read(&mid_count)); cifs_dump_mem("Received Data is: ", bufs[i], HEADER_SIZE(server)); smb2_add_credits_from_hdr(bufs[i], server); diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index 0e84e6fcf8ab..16168ebd1a62 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c @@ -172,9 +172,9 @@ cifs_buf_get(void) /* clear the first few header bytes */ /* for most paths, more is cleared in header_assemble */ memset(ret_buf, 0, buf_size + 3); - atomic_inc(&bufAllocCount); + atomic_inc(&buf_alloc_count); #ifdef CONFIG_CIFS_STATS2 - atomic_inc(&totBufAllocCount); + atomic_inc(&total_buf_alloc_count); #endif /* CONFIG_CIFS_STATS2 */ return ret_buf; @@ -189,7 +189,7 @@ cifs_buf_release(void *buf_to_free) } mempool_free(buf_to_free, cifs_req_poolp); - atomic_dec(&bufAllocCount); + atomic_dec(&buf_alloc_count); return; } @@ -205,9 +205,9 @@ cifs_small_buf_get(void) ret_buf = mempool_alloc(cifs_sm_req_poolp, GFP_NOFS); /* No need to clear memory here, cleared in header assemble */ /* memset(ret_buf, 0, sizeof(struct smb_hdr) + 27);*/ - atomic_inc(&smBufAllocCount); + atomic_inc(&small_buf_alloc_count); #ifdef CONFIG_CIFS_STATS2 - atomic_inc(&totSmBufAllocCount); + atomic_inc(&total_small_buf_alloc_count); #endif /* CONFIG_CIFS_STATS2 */ return ret_buf; @@ -223,7 +223,7 @@ cifs_small_buf_release(void *buf_to_free) } mempool_free(buf_to_free, cifs_sm_req_poolp); - atomic_dec(&smBufAllocCount); + atomic_dec(&small_buf_alloc_count); return; } diff --git a/fs/cifs/smb2transport.c b/fs/cifs/smb2transport.c index 55e79f6ee78d..53ff6bc11939 100644 --- a/fs/cifs/smb2transport.c +++ b/fs/cifs/smb2transport.c @@ -750,7 +750,7 @@ smb2_mid_entry_alloc(const struct smb2_hdr *shdr, temp->callback = cifs_wake_up_task; temp->callback_data = current; - atomic_inc(&midCount); + atomic_inc(&mid_count); temp->mid_state = MID_REQUEST_ALLOCATED; trace_smb3_cmd_enter(le32_to_cpu(shdr->Id.SyncId.TreeId), le64_to_cpu(shdr->SessionId), diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index bfc9bd55870a..dac8d6f9b309 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c @@ -68,7 +68,7 @@ AllocMidQEntry(const struct smb_hdr *smb_buffer, struct TCP_Server_Info *server) temp->callback = cifs_wake_up_task; temp->callback_data = current; - atomic_inc(&midCount); + atomic_inc(&mid_count); temp->mid_state = MID_REQUEST_ALLOCATED; return temp; } @@ -91,7 +91,7 @@ static void _cifs_mid_q_entry_release(struct kref *refcount) server->ops->handle_cancelled_mid(midEntry, server); midEntry->mid_state = MID_FREE; - atomic_dec(&midCount); + atomic_dec(&mid_count); if (midEntry->large_buf) cifs_buf_release(midEntry->resp_buf); else -- 2.34.1