Skip to contentSkip to conversation

cifs: Organise declarations in the cifs client header files

RFC PATCH In review David Howells 3 participants 7 messages Sep 4, 2025 – Sep 12, 2025

Subsystems (5)
lore
Share & tools
lore

David Howells

author maintainer
#0 lore raw

cover cifs: Organise declarations in the cifs client header files

Hi Steve,

Would you be interested in this pair of patches? The second patch organises the declarations in the cifs client header files, naming the arguments the same as for the implementations, inserting divider comments, ordering them the same as they're found in the files and dividing them better between general, smb1 and smb2/3 categories.

The organisation is entirely scripted with the script in the second patch's commit message. The first patch does a bit of preparation to make sure that the second patch's output will build.

David

David Howells (2):
cifs: Do some preparation prior to organising the function
declarations
cifs: Clean up declarations

 fs/smb/client/cached_dir.h    |   19 -
 fs/smb/client/cifs_debug.c    |    4 +-
 fs/smb/client/cifs_debug.h    |    5 -
 fs/smb/client/cifs_spnego.h   |    2 -
 fs/smb/client/cifs_swn.h      |   15 +-
 fs/smb/client/cifs_unicode.c  |    1 +
 fs/smb/client/cifs_unicode.h  |   16 -
 fs/smb/client/cifsacl.c       |    1 +
 fs/smb/client/cifsfs.c        |    5 +-
 fs/smb/client/cifsfs.h        |   64 --
 fs/smb/client/cifsglob.h      |   19 +-
 fs/smb/client/cifspdu.h       |   12 -
 fs/smb/client/cifsproto.h     | 1228 ++++++++++++++++-----------------
 fs/smb/client/cifssmb.c       |    1 +
 fs/smb/client/cifstransport.c |    1 +
 fs/smb/client/compress.c      |   15 +
 fs/smb/client/compress.h      |   18 +-
 fs/smb/client/connect.c       |    1 +
 fs/smb/client/dfs.h           |    4 -
 fs/smb/client/dfs_cache.h     |   16 -
 fs/smb/client/dir.c           |    1 +
 fs/smb/client/dns_resolve.h   |    3 -
 fs/smb/client/file.c          |    1 +
 fs/smb/client/fs_context.c    |    2 +-
 fs/smb/client/fs_context.h    |    9 -
 fs/smb/client/fscache.h       |   13 +-
 fs/smb/client/inode.c         |    1 +
 fs/smb/client/ioctl.c         |    1 +
 fs/smb/client/link.c          |    1 +
 fs/smb/client/misc.c          |    1 +
 fs/smb/client/netlink.h       |    3 -
 fs/smb/client/netmisc.c       |    2 +-
 fs/smb/client/nterr.h         |    2 -
 fs/smb/client/ntlmssp.h       |   13 -
 fs/smb/client/reparse.h       |   11 -
 fs/smb/client/sess.c          |    1 +
 fs/smb/client/smb1ops.c       |    2 +
 fs/smb/client/smb1proto.h     |  230 ++++++
 fs/smb/client/smb2pdu.h       |    2 -
 fs/smb/client/smb2proto.h     |  536 +++++++-------
 fs/smb/client/smbdirect.h     |   27 +-
 41 files changed, 1157 insertions(+), 1152 deletions(-)
 create mode 100644 fs/smb/client/smb1proto.h
author maintainer
#1 lore raw

RFC PATCH 1/2 cifs: Do some preparation prior to organising the function declarations

Make some preparatory changes prior to running a script to organise the function declarations within the fs/smb/client/ headers. These include:

(1) Creating an smb1proto.h file and #including it in places that will need it. It will be populated by a script in a follow on patch.

(2) Insert a line saying "/* PROTOTYPES */" in the target headers to set the point at which prototypes should be inserted in that file.

(3) Remove "inline" from the dummy cifs_proc_init/clean() functions as they are in a .c file.

(4) Move should_compress()'s kdoc comment to the .c file.

(5) Rename CIFS_ALLOW_INSECURE_LEGACY in #endif comments to have CONFIG_ on the front to allow the script to recognise it.

(6) Don't let comments have bare words at the left margin as that confused the simplistic function detection code in the script.

---
 fs/smb/client/cifs_debug.c    |  4 ++--
 fs/smb/client/cifs_swn.h      |  2 ++
 fs/smb/client/cifs_unicode.c  |  1 +
 fs/smb/client/cifsacl.c       |  1 +
 fs/smb/client/cifsfs.c        |  5 +++--
 fs/smb/client/cifsglob.h      |  2 +-
 fs/smb/client/cifsproto.h     |  9 +++------
 fs/smb/client/cifssmb.c       |  1 +
 fs/smb/client/cifstransport.c |  1 +
 fs/smb/client/compress.c      | 15 +++++++++++++++
 fs/smb/client/compress.h      | 18 ++----------------
 fs/smb/client/connect.c       |  1 +
 fs/smb/client/dir.c           |  1 +
 fs/smb/client/file.c          |  1 +
 fs/smb/client/fs_context.c    |  2 +-
 fs/smb/client/fscache.h       |  4 +---
 fs/smb/client/inode.c         |  1 +
 fs/smb/client/ioctl.c         |  1 +
 fs/smb/client/link.c          |  1 +
 fs/smb/client/misc.c          |  1 +
 fs/smb/client/netmisc.c       |  2 +-
 fs/smb/client/sess.c          |  1 +
 fs/smb/client/smb1ops.c       |  2 ++
 fs/smb/client/smb1proto.h     | 20 ++++++++++++++++++++
 fs/smb/client/smb2proto.h     |  9 ++++-----
 fs/smb/client/smbdirect.h     |  2 ++
 26 files changed, 71 insertions(+), 37 deletions(-)
 create mode 100644 fs/smb/client/smb1proto.h
fs/smb/client/cifs_debug.c +2 -2
index beb4f18f05ef..6f1dd2ee4018 100644
@@ -1262,11 +1262,11 @@ static const struct proc_ops cifs_mount_params_proc_ops = {
 };
 
 #else
-inline void cifs_proc_init(void)
+void cifs_proc_init(void)
 {
 }
 
-inline void cifs_proc_clean(void)
+void cifs_proc_clean(void)
 {
 }
 #endif /* PROC_FS */
fs/smb/client/cifs_swn.h +2 -0
index 8a9d2a5c9077..7063539c41c8 100644
@@ -14,6 +14,8 @@ struct sk_buff;
 struct genl_info;
 
 #ifdef CONFIG_CIFS_SWN_UPCALL
+
+/* PROTOTYPES */
 extern int cifs_swn_register(struct cifs_tcon *tcon);
 
 extern int cifs_swn_unregister(struct cifs_tcon *tcon);
fs/smb/client/cifs_unicode.c +1 -0
index 4cc6e0896fad..e0f9b3e4a25b 100644
@@ -9,6 +9,7 @@
 #include "cifs_fs_sb.h"
 #include "cifs_unicode.h"
 #include "cifspdu.h"
+#include "cifsproto.h"
 #include "cifsglob.h"
 #include "cifs_debug.h"
 
fs/smb/client/cifsacl.c +1 -0
index 63b3b1290bed..d529deb6bd80 100644
@@ -21,6 +21,7 @@
 #include "cifsglob.h"
 #include "cifsacl.h"
 #include "cifsproto.h"
+#include "smb1proto.h"
 #include "cifs_debug.h"
 #include "fs_context.h"
 #include "cifs_fs_sb.h"
fs/smb/client/cifsfs.c +3 -2
index e1848276bab4..0ea8e74b3b06 100644
@@ -28,6 +28,8 @@
 #include <linux/splice.h>
 #include <linux/uuid.h>
 #include <linux/xattr.h>
+#include <linux/mm.h>
+#include <linux/key-type.h>
 #include <uapi/linux/magic.h>
 #include <net/ipv6.h>
 #include "cifsfs.h"
@@ -35,10 +37,9 @@
 #define DECLARE_GLOBALS_HERE
 #include "cifsglob.h"
 #include "cifsproto.h"
+#include "smb2proto.h"
 #include "cifs_debug.h"
 #include "cifs_fs_sb.h"
-#include <linux/mm.h>
-#include <linux/key-type.h>
 #include "cifs_spnego.h"
 #include "fscache.h"
 #ifdef CONFIG_CIFS_DFS_UPCALL
fs/smb/client/cifsglob.h +1 -1
index 1e64a4fb6af0..f052e489e941 100644
@@ -2140,7 +2140,7 @@ extern struct smb_version_operations smb1_operations;
 extern struct smb_version_values smb1_values;
 extern struct smb_version_operations smb20_operations;
 extern struct smb_version_values smb20_values;
-#endif /* CIFS_ALLOW_INSECURE_LEGACY */
+#endif /* CONFIG_CIFS_ALLOW_INSECURE_LEGACY */
 #define SMB21_VERSION_STRING	"2.1"
 extern struct smb_version_operations smb21_operations;
 extern struct smb_version_values smb21_values;
fs/smb/client/cifsproto.h +3 -6
index c34c533b2efa..a4c8b350eaa4 100644
@@ -9,6 +9,7 @@
 #define _CIFSPROTO_H
 #include <linux/nls.h>
 #include <linux/ctype.h>
+#include <net/genetlink.h>
 #include "trace.h"
 #ifdef CONFIG_CIFS_DFS_UPCALL
 #include "dfs_cache.h"
@@ -18,11 +19,7 @@ struct statfs;
 struct smb_rqst;
 struct smb3_fs_context;
 
-/*
- *****************************************************************
- * All Prototypes
- *****************************************************************
- */
+/* PROTOTYPES */
 
 extern struct smb_hdr *cifs_buf_get(void);
 extern void cifs_buf_release(void *);
@@ -602,7 +599,7 @@ extern int cifs_do_set_acl(const unsigned int xid, struct cifs_tcon *tcon,
 			   const struct nls_table *nls_codepage, int remap);
 extern int CIFSGetExtAttr(const unsigned int xid, struct cifs_tcon *tcon,
 			const int netfid, __u64 *pExtAttrBits, __u64 *pMask);
-#endif /* CIFS_ALLOW_INSECURE_LEGACY */
+#endif /* CONFIG_CIFS_ALLOW_INSECURE_LEGACY */
 extern void cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb);
 extern bool couldbe_mf_symlink(const struct cifs_fattr *fattr);
 extern int check_mf_symlink(unsigned int xid, struct cifs_tcon *tcon,
fs/smb/client/cifssmb.c +1 -0
index d20766f664c4..3f6dbfc82a28 100644
@@ -31,6 +31,7 @@
 #include "cifsglob.h"
 #include "cifsacl.h"
 #include "cifsproto.h"
+#include "smb1proto.h"
 #include "cifs_unicode.h"
 #include "cifs_debug.h"
 #include "fscache.h"
fs/smb/client/cifstransport.c +1 -0
index e98b95eff8c9..86f4ebbdf756 100644
@@ -26,6 +26,7 @@
 #include "cifsglob.h"
 #include "cifsproto.h"
 #include "cifs_debug.h"
+#include "smb1proto.h"
 #include "smb2proto.h"
 #include "smbdirect.h"
 #include "compress.h"
fs/smb/client/compress.c +15 -0
index db709f5cd2e1..c04339419cb5 100644
@@ -261,6 +261,21 @@ static bool is_compressible(const struct iov_iter *data)
 	return ret;
 }
 
+/**
+ * should_compress() - Determines if a request (write) or the response to a
+ *		       request (read) should be compressed.
+ * @tcon: tcon of the request is being sent to
+ * @rqst: request to evaluate
+ *
+ * Return: true iff:
+ * - compression was successfully negotiated with server
+ * - server has enabled compression for the share
+ * - it's a read or write request
+ * - (write only) request length is >= SMB_COMPRESS_MIN_LEN
+ * - (write only) is_compressible() returns 1
+ *
+ * Return false otherwise.
+ */
 bool should_compress(const struct cifs_tcon *tcon, const struct smb_rqst *rq)
 {
 	const struct smb2_hdr *shdr = rq->rq_iov->iov_base;
fs/smb/client/compress.h +2 -16
index f3ed1d3e52fb..2a51c31d9387 100644
@@ -29,23 +29,9 @@
 #ifdef CONFIG_CIFS_COMPRESSION
 typedef int (*compress_send_fn)(struct TCP_Server_Info *, int, struct smb_rqst *);
 
-int smb_compress(struct TCP_Server_Info *server, struct smb_rqst *rq, compress_send_fn send_fn);
+/* PROTOTYPES */
 
-/**
- * should_compress() - Determines if a request (write) or the response to a
- *		       request (read) should be compressed.
- * @tcon: tcon of the request is being sent to
- * @rqst: request to evaluate
- *
- * Return: true iff:
- * - compression was successfully negotiated with server
- * - server has enabled compression for the share
- * - it's a read or write request
- * - (write only) request length is >= SMB_COMPRESS_MIN_LEN
- * - (write only) is_compressible() returns 1
- *
- * Return false otherwise.
- */
+int smb_compress(struct TCP_Server_Info *server, struct smb_rqst *rq, compress_send_fn send_fn);
 bool should_compress(const struct cifs_tcon *tcon, const struct smb_rqst *rq);
 
 /**
fs/smb/client/connect.c +1 -0
index dd12f3eb61dc..ec813bd6c53c 100644
@@ -42,6 +42,7 @@
 #include "nterr.h"
 #include "rfc1002pdu.h"
 #include "fscache.h"
+#include "smb1proto.h"
 #include "smb2proto.h"
 #include "smbdirect.h"
 #include "dns_resolve.h"
fs/smb/client/dir.c +1 -0
index 5223edf6d11a..fdde432bca83 100644
@@ -17,6 +17,7 @@
 #include "cifspdu.h"
 #include "cifsglob.h"
 #include "cifsproto.h"
+#include "smb1proto.h"
 #include "cifs_debug.h"
 #include "cifs_fs_sb.h"
 #include "cifs_unicode.h"
fs/smb/client/file.c +1 -0
index 186e061068be..7df0441098b2 100644
@@ -27,6 +27,7 @@
 #include "cifspdu.h"
 #include "cifsglob.h"
 #include "cifsproto.h"
+#include "smb1proto.h"
 #include "smb2proto.h"
 #include "cifs_unicode.h"
 #include "cifs_debug.h"
fs/smb/client/fs_context.c +1 -1
index 072383899e81..a14456accd8d 100644
@@ -505,7 +505,7 @@ cifs_parse_smb_version(struct fs_context *fc, char *value, struct smb3_fs_contex
 	case Smb_20:
 		cifs_errorf(fc, "vers=2.0 mount not permitted when legacy dialects disabled\n");
 		return 1;
-#endif /* CIFS_ALLOW_INSECURE_LEGACY */
+#endif /* CONFIG_CIFS_ALLOW_INSECURE_LEGACY */
 	case Smb_21:
 		ctx->ops = &smb21_operations;
 		ctx->vals = &smb21_values;
fs/smb/client/fscache.h +1 -3
index f06cb24f5f3c..162865381dac 100644
@@ -35,9 +35,7 @@ struct cifs_fscache_inode_coherency_data {
 
 #ifdef CONFIG_CIFS_FSCACHE
 
-/*
- * fscache.c
- */
+/* PROTOTYPES */
 extern int cifs_fscache_get_super_cookie(struct cifs_tcon *);
 extern void cifs_fscache_release_super_cookie(struct cifs_tcon *);
 
fs/smb/client/inode.c +1 -0
index fe453a4b3dc8..78f377ab4159 100644
@@ -18,6 +18,7 @@
 #include "cifspdu.h"
 #include "cifsglob.h"
 #include "cifsproto.h"
+#include "smb1proto.h"
 #include "smb2proto.h"
 #include "cifs_debug.h"
 #include "cifs_fs_sb.h"
fs/smb/client/ioctl.c +1 -0
index 0a9935ce05a5..356dd46b017b 100644
@@ -19,6 +19,7 @@
 #include "cifs_debug.h"
 #include "cifsfs.h"
 #include "cifs_ioctl.h"
+#include "smb1proto.h"
 #include "smb2proto.h"
 #include "smb2glob.h"
 #include <linux/btrfs.h>
fs/smb/client/link.c +1 -0
index fe80e711cd75..d44b089190aa 100644
@@ -16,6 +16,7 @@
 #include "cifs_debug.h"
 #include "cifs_fs_sb.h"
 #include "cifs_unicode.h"
+#include "smb1proto.h"
 #include "smb2proto.h"
 #include "cifs_ioctl.h"
 #include "fs_context.h"
fs/smb/client/misc.c +1 -0
index da23cc12a52c..7659f530c809 100644
@@ -18,6 +18,7 @@
 #include "nterr.h"
 #include "cifs_unicode.h"
 #include "smb2pdu.h"
+#include "smb2proto.h"
 #include "cifsfs.h"
 #ifdef CONFIG_CIFS_DFS_UPCALL
 #include "dns_resolve.h"
fs/smb/client/netmisc.c +1 -1
index 9ec20601cee2..4e0bb1920eae 100644
@@ -200,7 +200,7 @@ cifs_set_port(struct sockaddr *addr, const unsigned short int port)
 }
 
 /*****************************************************************************
-convert a NT status code to a dos class/code
+ *convert a NT status code to a dos class/code
  *****************************************************************************/
 /* NT status -> dos error map */
 static const struct {
fs/smb/client/sess.c +1 -0
index 0a8c2fcc9ded..b5a68d07f829 100644
@@ -20,6 +20,7 @@
 #include <linux/version.h>
 #include "cifsfs.h"
 #include "cifs_spnego.h"
+#include "smb1proto.h"
 #include "smb2proto.h"
 #include "fs_context.h"
 
fs/smb/client/smb1ops.c +2 -0
index 893a1ea8c000..7c30e5c9fa9d 100644
@@ -10,6 +10,8 @@
 #include <uapi/linux/magic.h>
 #include "cifsglob.h"
 #include "cifsproto.h"
+#include "smb1proto.h"
+#include "smb2proto.h"
 #include "cifs_debug.h"
 #include "cifspdu.h"
 #include "cifs_unicode.h"
fs/smb/client/smb1proto.h new file +20 -0
new file mode 100644
index 000000000000..68ab0447b671
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: LGPL-2.1 */
+/*
+ *
+ *   Copyright (c) International Business Machines  Corp., 2002,2008
+ *   Author(s): Steve French ([email protected])
+ *
+ */
+#ifndef _SMB1PROTO_H
+#define _SMB1PROTO_H
+
+#include <linux/nls.h>
+#include <linux/ctype.h>
+#include "trace.h"
+#ifdef CONFIG_CIFS_DFS_UPCALL
+#include "dfs_cache.h"
+#endif
+
+/* PROTOTYPES */
+
+#endif /* _SMB1PROTO_H */
fs/smb/client/smb2proto.h +4 -5
index 6e805ece6a7b..6b0212ccd45c 100644
@@ -9,17 +9,16 @@
  */
 #ifndef _SMB2PROTO_H
 #define _SMB2PROTO_H
+
 #include <linux/nls.h>
 #include <linux/key-type.h>
+#include "cached_dir.h"
 
 struct statfs;
 struct smb_rqst;
 
-/*
- *****************************************************************
- * All Prototypes
- *****************************************************************
- */
+/* PROTOTYPES */
+
 extern int map_smb2_to_linux_error(char *buf, bool log_err);
 extern int smb2_check_message(char *buf, unsigned int length,
 			      struct TCP_Server_Info *server);
fs/smb/client/smbdirect.h +2 -0
index e45aa9ddd71d..e190cb96486f 100644
@@ -156,6 +156,8 @@ struct smbd_mr *smbd_register_mr(
 	bool writing, bool need_invalidate);
 int smbd_deregister_mr(struct smbd_mr *mr);
 
+/* PROTOTYPES */
+
 #else
 #define cifs_rdma_enabled(server)	0
 struct smbd_connection {};
#2 lore raw

Re: [RFC PATCH 1/2] cifs: Do some preparation prior to organising the function declarations

kernel test robot noticed the following build errors:

Hi David,

[This is a private test report for your RFC patch.] kernel test robot noticed the following build errors:

[auto build test ERROR on cifs/for-next]
[also build test ERROR on linus/master v6.17-rc4 next-20250905] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/David-Howells/cifs-Do-some-preparation-prior-to-organising-the-function-declarations/20250905-052128
base:   git://git.samba.org/sfrench/cifs-2.6.git for-next
patch link:    https://lore.kernel.org/r/20250904211839.1152340-2-dhowells%40redhat.com
patch subject: [RFC PATCH 1/2] cifs: Do some preparation prior to organising the function declarations
config: sh-randconfig-001-20250906 (https://download.01.org/0day-ci/archive/20250906/[email protected]/config)
compiler: sh4-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250906/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All error/warnings (new ones prefixed by >>):

In file included from fs/smb/client/cifs_unicode.c:12:

>> fs/smb/client/cifsproto.h:29:28: warning: 'struct TCP_Server_Info' declared inside parameter list will not be visible outside of this definition or declaration
      29 | extern int smb_send(struct TCP_Server_Info *, struct smb_hdr *,
         |                            ^~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:31:33: warning: 'struct TCP_Server_Info' declared inside parameter list will not be visible outside of this definition or declaration
      31 | extern int smb_send_kvec(struct TCP_Server_Info *server,
         |                                 ^~~~~~~~~~~~~~~
>> fs/smb/client/cifsproto.h:79:45: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
      79 |                                      struct cifs_tcon *tcon,
         |                                             ^~~~~~~~~
>> fs/smb/client/cifsproto.h:83:31: warning: 'struct mid_q_entry' declared inside parameter list will not be visible outside of this definition or declaration
      83 | extern void delete_mid(struct mid_q_entry *mid);
         |                               ^~~~~~~~~~~
   fs/smb/client/cifsproto.h:85:38: warning: 'struct mid_q_entry' declared inside parameter list will not be visible outside of this definition or declaration
      85 | extern void cifs_wake_up_task(struct mid_q_entry *mid);
         |                                      ^~~~~~~~~~~
   fs/smb/client/cifsproto.h:87:40: warning: 'struct mid_q_entry' declared inside parameter list will not be visible outside of this definition or declaration
      87 |                                 struct mid_q_entry *mid);
         |                                        ^~~~~~~~~~~
   fs/smb/client/cifsproto.h:86:40: warning: 'struct TCP_Server_Info' declared inside parameter list will not be visible outside of this definition or declaration
      86 | extern int cifs_handle_standard(struct TCP_Server_Info *server,
         |                                        ^~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:94:47: warning: 'struct TCP_Server_Info' declared inside parameter list will not be visible outside of this definition or declaration
      94 | extern int cifs_discard_remaining_data(struct TCP_Server_Info *server);
         |                                               ^~~~~~~~~~~~~~~
>> fs/smb/client/cifsproto.h:97:25: error: unknown type name 'mid_receive_t'
      97 |                         mid_receive_t *receive, mid_callback_t *callback,
         |                         ^~~~~~~~~~~~~
>> fs/smb/client/cifsproto.h:97:49: error: unknown type name 'mid_callback_t'; did you mean 'bpf_callback_t'?
      97 |                         mid_receive_t *receive, mid_callback_t *callback,
         |                                                 ^~~~~~~~~~~~~~
         |                                                 bpf_callback_t
>> fs/smb/client/cifsproto.h:98:25: error: unknown type name 'mid_handle_t'; did you mean 'irq_handler_t'?
      98 |                         mid_handle_t *handle, void *cbdata, const int flags,
         |                         ^~~~~~~~~~~~
         |                         irq_handler_t
>> fs/smb/client/cifsproto.h:100:57: warning: 'struct cifs_ses' declared inside parameter list will not be visible outside of this definition or declaration
     100 | extern struct TCP_Server_Info *cifs_pick_channel(struct cifs_ses *ses);
         |                                                         ^~~~~~~~
   fs/smb/client/cifsproto.h:101:58: warning: 'struct cifs_ses' declared inside parameter list will not be visible outside of this definition or declaration
     101 | extern int cifs_send_recv(const unsigned int xid, struct cifs_ses *ses,
         |                                                          ^~~~~~~~
   fs/smb/client/cifsproto.h:105:62: warning: 'struct cifs_ses' declared inside parameter list will not be visible outside of this definition or declaration
     105 | extern int compound_send_recv(const unsigned int xid, struct cifs_ses *ses,
         |                                                              ^~~~~~~~
   fs/smb/client/cifsproto.h:110:62: warning: 'struct cifs_ses' declared inside parameter list will not be visible outside of this definition or declaration
     110 | extern int SendReceive(const unsigned int /* xid */ , struct cifs_ses *,
         |                                                              ^~~~~~~~
   fs/smb/client/cifsproto.h:114:60: warning: 'struct cifs_ses' declared inside parameter list will not be visible outside of this definition or declaration
     114 | extern int SendReceiveNoRsp(const unsigned int xid, struct cifs_ses *ses,
         |                                                            ^~~~~~~~
   fs/smb/client/cifsproto.h:116:33: warning: 'struct mid_q_entry' declared inside parameter list will not be visible outside of this definition or declaration
     116 | int cifs_sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server);
         |                                 ^~~~~~~~~~~
   fs/smb/client/cifsproto.h:117:54: warning: 'struct cifs_ses' declared inside parameter list will not be visible outside of this definition or declaration
     117 | extern struct mid_q_entry *cifs_setup_request(struct cifs_ses *,
         |                                                      ^~~~~~~~
>> fs/smb/client/cifsproto.h:130:41: warning: 'struct cifs_credits' declared inside parameter list will not be visible outside of this definition or declaration
     130 |                                  struct cifs_credits *credits);
         |                                         ^~~~~~~~~~~~
   fs/smb/client/cifsproto.h: In function 'send_cancel':
>> fs/smb/client/cifsproto.h:136:22: error: invalid use of undefined type 'struct TCP_Server_Info'
     136 |         return server->ops->send_cancel ?
         |                      ^~
   fs/smb/client/cifsproto.h:137:39: error: invalid use of undefined type 'struct TCP_Server_Info'
     137 |                                 server->ops->send_cancel(server, rqst, mid) : 0;
         |                                       ^~
   fs/smb/client/cifsproto.h: At top level:
   fs/smb/client/cifsproto.h:141:63: warning: 'struct cifs_ses' declared inside parameter list will not be visible outside of this definition or declaration
     141 | extern int SendReceive2(const unsigned int /* xid */ , struct cifs_ses *,
         |                                                               ^~~~~~~~
   fs/smb/client/cifsproto.h:146:32: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     146 |                         struct cifs_tcon *ptcon,
         |                                ^~~~~~~~~
>> fs/smb/client/cifsproto.h:163:43: warning: 'struct cifsInodeInfo' declared inside parameter list will not be visible outside of this definition or declaration
     163 | extern bool is_size_safe_to_change(struct cifsInodeInfo *cifsInode, __u64 eof,
         |                                           ^~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:165:36: warning: 'struct cifsInodeInfo' declared inside parameter list will not be visible outside of this definition or declaration
     165 | extern void cifs_update_eof(struct cifsInodeInfo *cifsi, loff_t offset,
         |                                    ^~~~~~~~~~~~~
>> fs/smb/client/cifsproto.h:167:46: warning: 'struct cifs_io_subrequest' declared inside parameter list will not be visible outside of this definition or declaration
     167 | void cifs_write_subrequest_terminated(struct cifs_io_subrequest *wdata, ssize_t result);
         |                                              ^~~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:168:55: warning: 'struct cifsInodeInfo' declared inside parameter list will not be visible outside of this definition or declaration
     168 | extern struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *, int);
         |                                                       ^~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:169:42: warning: 'struct cifsInodeInfo' declared inside parameter list will not be visible outside of this definition or declaration
     169 | extern int cifs_get_writable_file(struct cifsInodeInfo *cifs_inode,
         |                                          ^~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:172:42: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     172 | extern int cifs_get_writable_path(struct cifs_tcon *tcon, const char *name,
         |                                          ^~~~~~~~~
   fs/smb/client/cifsproto.h:175:55: warning: 'struct cifsInodeInfo' declared inside parameter list will not be visible outside of this definition or declaration
     175 | extern struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *, bool);
         |                                                       ^~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:176:42: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     176 | extern int cifs_get_readable_path(struct cifs_tcon *tcon, const char *name,
         |                                          ^~~~~~~~~
   fs/smb/client/cifsproto.h:178:42: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     178 | extern int cifs_get_hardlink_path(struct cifs_tcon *tcon, struct inode *inode,
         |                                          ^~~~~~~~~
   fs/smb/client/cifsproto.h:188:42: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     188 |                             const struct cifs_tcon *, int /* length of
         |                                          ^~~~~~~~~
   fs/smb/client/cifsproto.h:191:40: warning: 'struct cifs_ses' declared inside parameter list will not be visible outside of this definition or declaration
     191 |                                 struct cifs_ses *ses,
         |                                        ^~~~~~~~
   fs/smb/client/cifsproto.h:195:58: warning: 'struct cifs_ses' declared inside parameter list will not be visible outside of this definition or declaration
     195 | extern int CIFS_SessSetup(const unsigned int xid, struct cifs_ses *ses,
         |                                                          ^~~~~~~~
   fs/smb/client/cifsproto.h:202:42: warning: 'struct cifsInodeInfo' declared inside parameter list will not be visible outside of this definition or declaration
     202 | extern void cifs_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock);
         |                                          ^~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:203:35: warning: 'struct cifsInodeInfo' declared inside parameter list will not be visible outside of this definition or declaration
     203 | extern int cifs_get_writer(struct cifsInodeInfo *cinode);
         |                                   ^~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:204:36: warning: 'struct cifsInodeInfo' declared inside parameter list will not be visible outside of this definition or declaration
     204 | extern void cifs_put_writer(struct cifsInodeInfo *cinode);
         |                                    ^~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:205:43: warning: 'struct cifsInodeInfo' declared inside parameter list will not be visible outside of this definition or declaration
     205 | extern void cifs_done_oplock_break(struct cifsInodeInfo *cinode);
         |                                           ^~~~~~~~~~~~~
>> fs/smb/client/cifsproto.h:211:47: warning: 'struct cifs_fid' declared inside parameter list will not be visible outside of this definition or declaration
     211 | struct cifsFileInfo *cifs_new_fileinfo(struct cifs_fid *fid, struct file *file,
         |                                               ^~~~~~~~
>> fs/smb/client/cifsproto.h:218:56: warning: 'struct cifs_fattr' declared inside parameter list will not be visible outside of this definition or declaration
     218 | void cifs_fill_uniqueid(struct super_block *sb, struct cifs_fattr *fattr);
         |                                                        ^~~~~~~~~~
   fs/smb/client/cifsproto.h:219:45: warning: 'struct cifs_fattr' declared inside parameter list will not be visible outside of this definition or declaration
     219 | extern void cifs_unix_basic_to_fattr(struct cifs_fattr *fattr,
         |                                             ^~~~~~~~~~
   fs/smb/client/cifsproto.h:222:43: warning: 'struct cifs_fattr' declared inside parameter list will not be visible outside of this definition or declaration
     222 | extern void cifs_dir_info_to_fattr(struct cifs_fattr *, FILE_DIRECTORY_INFO *,
         |                                           ^~~~~~~~~~
   fs/smb/client/cifsproto.h:224:60: warning: 'struct cifs_fattr' declared inside parameter list will not be visible outside of this definition or declaration
     224 | extern int cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr,
         |                                                            ^~~~~~~~~~
   fs/smb/client/cifsproto.h:227:39: warning: 'struct cifs_fattr' declared inside parameter list will not be visible outside of this definition or declaration
     227 |                                struct cifs_fattr *fattr);
         |                                       ^~~~~~~~~~
   fs/smb/client/cifsproto.h:231:38: warning: 'struct cifs_fid' declared inside parameter list will not be visible outside of this definition or declaration
     231 |                         const struct cifs_fid *fid);
         |                                      ^~~~~~~~
>> fs/smb/client/cifsproto.h:230:32: warning: 'struct cifs_open_info_data' declared inside parameter list will not be visible outside of this definition or declaration
     230 |                         struct cifs_open_info_data *data, struct super_block *sb, int xid,
         |                                ^~~~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:234:47: warning: 'struct cifs_open_info_data' declared inside parameter list will not be visible outside of this definition or declaration
     234 |                                        struct cifs_open_info_data *data,
         |                                               ^~~~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:246:40: warning: 'struct cifs_fattr' declared inside parameter list will not be visible outside of this definition or declaration
     246 |                                 struct cifs_fattr *fattr, uint sidtype);
         |                                        ^~~~~~~~~~
>> fs/smb/client/cifsproto.h:245:59: warning: 'struct smb_sid' declared inside parameter list will not be visible outside of this definition or declaration
     245 | extern int sid_to_id(struct cifs_sb_info *cifs_sb, struct smb_sid *psid,
         |                                                           ^~~~~~~
   fs/smb/client/cifsproto.h:250:62: warning: 'struct cifs_fid' declared inside parameter list will not be visible outside of this definition or declaration
     250 |                               const char *path, const struct cifs_fid *pfid);
         |                                                              ^~~~~~~~
   fs/smb/client/cifsproto.h:248:38: warning: 'struct cifs_fattr' declared inside parameter list will not be visible outside of this definition or declaration
     248 |                               struct cifs_fattr *fattr, struct inode *inode,
         |                                      ^~~~~~~~~~
   fs/smb/client/cifsproto.h:256:46: warning: 'struct cifs_fid' declared inside parameter list will not be visible outside of this definition or declaration
     256 |                                 const struct cifs_fid *pfid, u32 *plen, u32 info);
         |                                              ^~~~~~~~
>> fs/smb/client/cifsproto.h:263:48: warning: 'struct smb_ace' declared inside parameter list will not be visible outside of this definition or declaration
     263 | extern unsigned int setup_authusers_ACE(struct smb_ace *pace);
         |                                                ^~~~~~~
   fs/smb/client/cifsproto.h:264:51: warning: 'struct smb_ace' declared inside parameter list will not be visible outside of this definition or declaration
     264 | extern unsigned int setup_special_mode_ACE(struct smb_ace *pace,
         |                                                   ^~~~~~~
   fs/smb/client/cifsproto.h:267:57: warning: 'struct smb_ace' declared inside parameter list will not be visible outside of this definition or declaration
     267 | extern unsigned int setup_special_user_owner_ACE(struct smb_ace *pace);
         |                                                         ^~~~~~~
>> fs/smb/client/cifsproto.h:278:34: warning: 'struct cifs_mount_ctx' declared inside parameter list will not be visible outside of this definition or declaration
     278 | void cifs_mount_put_conns(struct cifs_mount_ctx *mnt_ctx);
         |                                  ^~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:279:35: warning: 'struct cifs_mount_ctx' declared inside parameter list will not be visible outside of this definition or declaration
     279 | int cifs_mount_get_session(struct cifs_mount_ctx *mnt_ctx);
         |                                   ^~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:280:32: warning: 'struct cifs_mount_ctx' declared inside parameter list will not be visible outside of this definition or declaration
     280 | int cifs_is_path_remote(struct cifs_mount_ctx *mnt_ctx);
         |                                ^~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:281:32: warning: 'struct cifs_mount_ctx' declared inside parameter list will not be visible outside of this definition or declaration
     281 | int cifs_mount_get_tcon(struct cifs_mount_ctx *mnt_ctx);
         |                                ^~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:285:49: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     285 | extern void cifs_mark_open_files_invalid(struct cifs_tcon *tcon);
         |                                                 ^~~~~~~~~
   fs/smb/client/cifsproto.h:286:51: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     286 | extern void cifs_reopen_persistent_handles(struct cifs_tcon *tcon);
         |                                                   ^~~~~~~~~
>> fs/smb/client/cifsproto.h:290:44: warning: 'struct cifsLockInfo' declared inside parameter list will not be visible outside of this definition or declaration
     290 |                                     struct cifsLockInfo **conf_lock,
         |                                            ^~~~~~~~~~~~
>> fs/smb/client/cifsproto.h:294:42: warning: 'struct cifs_pending_open' declared inside parameter list will not be visible outside of this definition or declaration
     294 |                                   struct cifs_pending_open *open);
         |                                          ^~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:292:42: warning: 'struct cifs_fid' declared inside parameter list will not be visible outside of this definition or declaration
     292 | extern void cifs_add_pending_open(struct cifs_fid *fid,
         |                                          ^~~~~~~~
   fs/smb/client/cifsproto.h:297:49: warning: 'struct cifs_pending_open' declared inside parameter list will not be visible outside of this definition or declaration
     297 |                                          struct cifs_pending_open *open);
         |                                                 ^~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:295:49: warning: 'struct cifs_fid' declared inside parameter list will not be visible outside of this definition or declaration
     295 | extern void cifs_add_pending_open_locked(struct cifs_fid *fid,
         |                                                 ^~~~~~~~
   fs/smb/client/cifsproto.h:298:42: warning: 'struct cifs_pending_open' declared inside parameter list will not be visible outside of this definition or declaration
     298 | extern void cifs_del_pending_open(struct cifs_pending_open *open);
         |                                          ^~~~~~~~~~~~~~~~~
>> fs/smb/client/cifsproto.h:301:40: warning: 'struct cifs_deferred_close' declared inside parameter list will not be visible outside of this definition or declaration
     301 |                                 struct cifs_deferred_close **dclose);
         |                                        ^~~~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:304:40: warning: 'struct cifs_deferred_close' declared inside parameter list will not be visible outside of this definition or declaration
     304 |                                 struct cifs_deferred_close *dclose);
         |                                        ^~~~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:308:45: warning: 'struct cifsInodeInfo' declared inside parameter list will not be visible outside of this definition or declaration
     308 | extern void cifs_close_deferred_file(struct cifsInodeInfo *cifs_inode);
         |                                             ^~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:310:50: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     310 | extern void cifs_close_all_deferred_files(struct cifs_tcon *cifs_tcon);
         |                                                  ^~~~~~~~~
   fs/smb/client/cifsproto.h:312:58: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     312 | extern void cifs_close_deferred_file_under_dentry(struct cifs_tcon *cifs_tcon,
         |                                                          ^~~~~~~~~
   fs/smb/client/cifsproto.h:323:34: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     323 | extern void cifs_put_tcon(struct cifs_tcon *tcon, enum smb3_tcon_ref_trace trace);
         |                                  ^~~~~~~~~
   fs/smb/client/cifsproto.h:332:42: warning: 'struct cifsLockInfo' declared inside parameter list will not be visible outside of this definition or declaration
     332 | extern void cifs_del_lock_waiters(struct cifsLockInfo *lock);
         |                                          ^~~~~~~~~~~~
   fs/smb/client/cifsproto.h:334:54: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     334 | int cifs_tree_connect(const unsigned int xid, struct cifs_tcon *tcon);
         |                                                      ^~~~~~~~~
   fs/smb/client/cifsproto.h:337:43: warning: 'struct cifs_ses' declared inside parameter list will not be visible outside of this definition or declaration
     337 |                                    struct cifs_ses *ses,
         |                                           ^~~~~~~~
   fs/smb/client/cifsproto.h:339:62: warning: 'struct cifs_ses' declared inside parameter list will not be visible outside of this definition or declaration
     339 | extern int cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
         |                                                              ^~~~~~~~
   fs/smb/client/cifsproto.h:344:36: warning: 'struct cifs_ses' declared inside parameter list will not be visible outside of this definition or declaration
     344 |                             struct cifs_ses *ses,
         |                                    ^~~~~~~~
   fs/smb/client/cifsproto.h:348:46: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     348 |                     const char *tree, struct cifs_tcon *tcon,
         |                                              ^~~~~~~~~
   fs/smb/client/cifsproto.h:347:52: warning: 'struct cifs_ses' declared inside parameter list will not be visible outside of this definition or declaration
     347 | extern int CIFSTCon(const unsigned int xid, struct cifs_ses *ses,
         |                                                    ^~~~~~~~
   fs/smb/client/cifsproto.h:354:24: warning: 'struct cifs_search_info' declared inside parameter list will not be visible outside of this definition or declaration
     354 |                 struct cifs_search_info *psrch_inf,
         |                        ^~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:351:57: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     351 | extern int CIFSFindFirst(const unsigned int xid, struct cifs_tcon *tcon,
         |                                                         ^~~~~~~~~
   fs/smb/client/cifsproto.h:359:24: warning: 'struct cifs_search_info' declared inside parameter list will not be visible outside of this definition or declaration
     359 |                 struct cifs_search_info *psrch_inf);
         |                        ^~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:357:56: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     357 | extern int CIFSFindNext(const unsigned int xid, struct cifs_tcon *tcon,
         |                                                        ^~~~~~~~~
   fs/smb/client/cifsproto.h:361:57: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     361 | extern int CIFSFindClose(const unsigned int xid, struct cifs_tcon *tcon,
         |                                                         ^~~~~~~~~
   fs/smb/client/cifsproto.h:364:60: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     364 | extern int CIFSSMBQFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
         |                                                            ^~~~~~~~~
   fs/smb/client/cifsproto.h:366:60: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     366 | extern int CIFSSMBQPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
         |                                                            ^~~~~~~~~
   fs/smb/client/cifsproto.h:370:63: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     370 | extern int SMBQueryInformation(const unsigned int xid, struct cifs_tcon *tcon,
         |                                                               ^~~~~~~~~
   fs/smb/client/cifsproto.h:374:64: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     374 | extern int CIFSSMBUnixQFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
         |                                                                ^~~~~~~~~
   fs/smb/client/cifsproto.h:377:32: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     377 |                         struct cifs_tcon *tcon,
         |                                ^~~~~~~~~
   fs/smb/client/cifsproto.h:384:35: warning: 'struct dfs_info3_param' declared inside parameter list will not be visible outside of this definition or declaration
     384 |                            struct dfs_info3_param **target_nodes,
         |                                   ^~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:382:59: warning: 'struct cifs_ses' declared inside parameter list will not be visible outside of this definition or declaration
     382 | extern int CIFSGetDFSRefer(const unsigned int xid, struct cifs_ses *ses,
         |                                                           ^~~~~~~~
   fs/smb/client/cifsproto.h:390:39: warning: 'struct dfs_info3_param' declared inside parameter list will not be visible outside of this definition or declaration
     390 |                                struct dfs_info3_param **target_nodes,
         |                                       ^~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:393:59: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     393 | extern void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *tcon,
         |                                                           ^~~~~~~~~
   fs/smb/client/cifsproto.h:396:58: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     396 | extern int CIFSSMBQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
         |                                                          ^~~~~~~~~
   fs/smb/client/cifsproto.h:398:57: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     398 | extern int SMBOldQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
         |                                                         ^~~~~~~~~
   fs/smb/client/cifsproto.h:400:64: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     400 | extern int CIFSSMBSetFSUnixInfo(const unsigned int xid, struct cifs_tcon *tcon,
         |                                                                ^~~~~~~~~
   fs/smb/client/cifsproto.h:404:32: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     404 |                         struct cifs_tcon *tcon);
         |                                ^~~~~~~~~
   fs/smb/client/cifsproto.h:405:64: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     405 | extern int CIFSSMBQFSDeviceInfo(const unsigned int xid, struct cifs_tcon *tcon);
         |                                                                ^~~~~~~~~
   fs/smb/client/cifsproto.h:406:62: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     406 | extern int CIFSSMBQFSUnixInfo(const unsigned int xid, struct cifs_tcon *tcon);
         |                                                              ^~~~~~~~~

fs/smb/client/cifsproto.h:407:63: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
407 | extern int CIFSSMBQFSPosixInfo(const unsigned int xid, struct cifs_tcon *tcon,

vim +/mid_receive_t +97 fs/smb/client/cifsproto.h

^1da177e4c3f41 fs/cifs/cifsproto.h       Linus Torvalds             2005-04-16   23  
^1da177e4c3f41 fs/cifs/cifsproto.h       Linus Torvalds             2005-04-16   24  extern struct smb_hdr *cifs_buf_get(void);
^1da177e4c3f41 fs/cifs/cifsproto.h       Linus Torvalds             2005-04-16   25  extern void cifs_buf_release(void *);
^1da177e4c3f41 fs/cifs/cifsproto.h       Linus Torvalds             2005-04-16   26  extern struct smb_hdr *cifs_small_buf_get(void);
^1da177e4c3f41 fs/cifs/cifsproto.h       Linus Torvalds             2005-04-16   27  extern void cifs_small_buf_release(void *);
6d81ed1ec22dbe fs/cifs/cifsproto.h       Sachin Prabhu              2014-06-16   28  extern void free_rsp_buf(int, void *);
0496e02d8791e7 fs/cifs/cifsproto.h       Jeff Layton                2008-12-30  @29  extern int smb_send(struct TCP_Server_Info *, struct smb_hdr *,
0496e02d8791e7 fs/cifs/cifsproto.h       Jeff Layton                2008-12-30   30  			unsigned int /* length */);
781802aa5a5950 fs/smb/client/cifsproto.h Pali Rohár                 2024-10-30   31  extern int smb_send_kvec(struct TCP_Server_Info *server,
781802aa5a5950 fs/smb/client/cifsproto.h Pali Rohár                 2024-10-30   32  			 struct msghdr *msg,
781802aa5a5950 fs/smb/client/cifsproto.h Pali Rohár                 2024-10-30   33  			 size_t *sent);
6d5786a34d98bf fs/cifs/cifsproto.h       Pavel Shilovsky            2012-06-20   34  extern unsigned int _get_xid(void);
6d5786a34d98bf fs/cifs/cifsproto.h       Pavel Shilovsky            2012-06-20   35  extern void _free_xid(unsigned int);
6d5786a34d98bf fs/cifs/cifsproto.h       Pavel Shilovsky            2012-06-20   36  #define get_xid()							\
b6b38f704a8193 fs/cifs/cifsproto.h       Joe Perches                2010-04-21   37  ({									\
6d5786a34d98bf fs/cifs/cifsproto.h       Pavel Shilovsky            2012-06-20   38  	unsigned int __xid = _get_xid();				\
a0a3036b81f1f6 fs/cifs/cifsproto.h       Joe Perches                2020-04-14   39  	cifs_dbg(FYI, "VFS: in %s as Xid: %u with uid: %d\n",		\
dbfb98af18194c fs/cifs/cifsproto.h       Eric W. Biederman          2013-02-06   40  		 __func__, __xid,					\
dbfb98af18194c fs/cifs/cifsproto.h       Eric W. Biederman          2013-02-06   41  		 from_kuid(&init_user_ns, current_fsuid()));		\
d683bcd3e5d157 fs/cifs/cifsproto.h       Steve French               2018-05-19   42  	trace_smb3_enter(__xid, __func__);				\
b6b38f704a8193 fs/cifs/cifsproto.h       Joe Perches                2010-04-21   43  	__xid;								\
b6b38f704a8193 fs/cifs/cifsproto.h       Joe Perches                2010-04-21   44  })
b6b38f704a8193 fs/cifs/cifsproto.h       Joe Perches                2010-04-21   45  
6d5786a34d98bf fs/cifs/cifsproto.h       Pavel Shilovsky            2012-06-20   46  #define free_xid(curr_xid)						\
b6b38f704a8193 fs/cifs/cifsproto.h       Joe Perches                2010-04-21   47  do {									\
6d5786a34d98bf fs/cifs/cifsproto.h       Pavel Shilovsky            2012-06-20   48  	_free_xid(curr_xid);						\
a0a3036b81f1f6 fs/cifs/cifsproto.h       Joe Perches                2020-04-14   49  	cifs_dbg(FYI, "VFS: leaving %s (xid = %u) rc = %d\n",		\
b6b38f704a8193 fs/cifs/cifsproto.h       Joe Perches                2010-04-21   50  		 __func__, curr_xid, (int)rc);				\
d683bcd3e5d157 fs/cifs/cifsproto.h       Steve French               2018-05-19   51  	if (rc)								\
d683bcd3e5d157 fs/cifs/cifsproto.h       Steve French               2018-05-19   52  		trace_smb3_exit_err(curr_xid, __func__, (int)rc);	\
d683bcd3e5d157 fs/cifs/cifsproto.h       Steve French               2018-05-19   53  	else								\
d683bcd3e5d157 fs/cifs/cifsproto.h       Steve French               2018-05-19   54  		trace_smb3_exit_done(curr_xid, __func__);		\
b6b38f704a8193 fs/cifs/cifsproto.h       Joe Perches                2010-04-21   55  } while (0)
4d79dba0e00749 fs/cifs/cifsproto.h       Shirish Pargaonkar         2011-04-27   56  extern int init_cifs_idmap(void);
4d79dba0e00749 fs/cifs/cifsproto.h       Shirish Pargaonkar         2011-04-27   57  extern void exit_cifs_idmap(void);
b74cb9a80268be fs/cifs/cifsproto.h       Sachin Prabhu              2016-05-17   58  extern int init_cifs_spnego(void);
b74cb9a80268be fs/cifs/cifsproto.h       Sachin Prabhu              2016-05-17   59  extern void exit_cifs_spnego(void);
f6a9bc336b600e fs/cifs/cifsproto.h       Al Viro                    2021-03-05   60  extern const char *build_path_from_dentry(struct dentry *, void *);
7ad54b98fc1f14 fs/cifs/cifsproto.h       Paulo Alcantara            2022-12-18   61  char *__build_path_from_dentry_optional_prefix(struct dentry *direntry, void *page,
7ad54b98fc1f14 fs/cifs/cifsproto.h       Paulo Alcantara            2022-12-18   62  					       const char *tree, int tree_len,
7ad54b98fc1f14 fs/cifs/cifsproto.h       Paulo Alcantara            2022-12-18   63  					       bool prefix);
268a635d414df4 fs/cifs/cifsproto.h       Aurelien Aptel             2017-02-13   64  extern char *build_path_from_dentry_optional_prefix(struct dentry *direntry,
f6a9bc336b600e fs/cifs/cifsproto.h       Al Viro                    2021-03-05   65  						    void *page, bool prefix);
f6a9bc336b600e fs/cifs/cifsproto.h       Al Viro                    2021-03-05   66  static inline void *alloc_dentry_path(void)
f6a9bc336b600e fs/cifs/cifsproto.h       Al Viro                    2021-03-05   67  {
f6a9bc336b600e fs/cifs/cifsproto.h       Al Viro                    2021-03-05   68  	return __getname();
f6a9bc336b600e fs/cifs/cifsproto.h       Al Viro                    2021-03-05   69  }
f6a9bc336b600e fs/cifs/cifsproto.h       Al Viro                    2021-03-05   70  
f6a9bc336b600e fs/cifs/cifsproto.h       Al Viro                    2021-03-05   71  static inline void free_dentry_path(void *page)
f6a9bc336b600e fs/cifs/cifsproto.h       Al Viro                    2021-03-05   72  {
f6a9bc336b600e fs/cifs/cifsproto.h       Al Viro                    2021-03-05   73  	if (page)
f6a9bc336b600e fs/cifs/cifsproto.h       Al Viro                    2021-03-05   74  		__putname(page);
f6a9bc336b600e fs/cifs/cifsproto.h       Al Viro                    2021-03-05   75  }
f6a9bc336b600e fs/cifs/cifsproto.h       Al Viro                    2021-03-05   76  
3fa1c6d1b8f5c3 fs/cifs/cifsproto.h       Ronnie Sahlberg            2020-12-09   77  extern char *cifs_build_path_to_root(struct smb3_fs_context *ctx,
6d3ea7e4975aed fs/cifs/cifsproto.h       Steve French               2012-11-28   78  				     struct cifs_sb_info *cifs_sb,
374402a2a1dfbb fs/cifs/cifsproto.h       Sachin Prabhu              2016-12-15  @79  				     struct cifs_tcon *tcon,
374402a2a1dfbb fs/cifs/cifsproto.h       Sachin Prabhu              2016-12-15   80  				     int add_treename);
^1da177e4c3f41 fs/cifs/cifsproto.h       Linus Torvalds             2005-04-16   81  extern char *build_wildcard_path_from_dentry(struct dentry *direntry);
abdb1742a31238 fs/cifs/cifsproto.h       Paulo Alcantara            2022-10-04   82  char *cifs_build_devname(char *nodename, const char *prepath);
70f08f914a37a0 fs/cifs/cifsproto.h       Enzo Matsumiya             2022-08-05  @83  extern void delete_mid(struct mid_q_entry *mid);
e6322fd177c688 fs/smb/client/cifsproto.h Paulo Alcantara            2023-10-25   84  void __release_mid(struct kref *refcount);
2dc7e1c0331694 fs/cifs/cifsproto.h       Pavel Shilovsky            2011-12-26   85  extern void cifs_wake_up_task(struct mid_q_entry *mid);
4326ed2f6a16ae fs/cifs/cifsproto.h       Pavel Shilovsky            2016-11-17   86  extern int cifs_handle_standard(struct TCP_Server_Info *server,
4326ed2f6a16ae fs/cifs/cifsproto.h       Pavel Shilovsky            2016-11-17   87  				struct mid_q_entry *mid);
49024ec8795ed2 fs/smb/client/cifsproto.h Paulo Alcantara            2023-06-27   88  extern char *smb3_fs_context_fullpath(const struct smb3_fs_context *ctx,
49024ec8795ed2 fs/smb/client/cifsproto.h Paulo Alcantara            2023-06-27   89  				      char dirsep);
66e7b09c731175 fs/cifs/cifsproto.h       Ronnie Sahlberg            2020-11-05   90  extern int smb3_parse_devname(const char *devname, struct smb3_fs_context *ctx);
0d4873f9aa4ff8 fs/cifs/cifsproto.h       Ronnie Sahlberg            2021-01-28   91  extern int smb3_parse_opt(const char *options, const char *key, char **val);
2991b77409891e fs/smb/client/cifsproto.h Shyam Prasad N             2023-06-09   92  extern int cifs_ipaddr_cmp(struct sockaddr *srcaddr, struct sockaddr *rhs);
e4af35fa55b072 fs/cifs/cifsproto.h       Paulo Alcantara            2020-05-19   93  extern bool cifs_match_ipaddr(struct sockaddr *srcaddr, struct sockaddr *rhs);
350be257ea8302 fs/cifs/cifsproto.h       Pavel Shilovsky            2017-04-10   94  extern int cifs_discard_remaining_data(struct TCP_Server_Info *server);
fec344e3f31aa9 fs/cifs/cifsproto.h       Jeff Layton                2012-09-18   95  extern int cifs_call_async(struct TCP_Server_Info *server,
fec344e3f31aa9 fs/cifs/cifsproto.h       Jeff Layton                2012-09-18   96  			struct smb_rqst *rqst,
fec344e3f31aa9 fs/cifs/cifsproto.h       Jeff Layton                2012-09-18  @97  			mid_receive_t *receive, mid_callback_t *callback,
3349c3a79fb5d7 fs/cifs/cifsproto.h       Pavel Shilovsky            2019-01-15  @98  			mid_handle_t *handle, void *cbdata, const int flags,
3349c3a79fb5d7 fs/cifs/cifsproto.h       Pavel Shilovsky            2019-01-15   99  			const struct cifs_credits *exist_credits);
5f68ea4aa98bcd fs/cifs/cifsproto.h       Aurelien Aptel             2020-04-22 @100  extern struct TCP_Server_Info *cifs_pick_channel(struct cifs_ses *ses);
b8f57ee8aad414 fs/cifs/cifsproto.h       Pavel Shilovsky            2016-11-23  101  extern int cifs_send_recv(const unsigned int xid, struct cifs_ses *ses,
352d96f3acc6e0 fs/cifs/cifsproto.h       Aurelien Aptel             2020-05-31  102  			  struct TCP_Server_Info *server,
b8f57ee8aad414 fs/cifs/cifsproto.h       Pavel Shilovsky            2016-11-23  103  			  struct smb_rqst *rqst, int *resp_buf_type,
b8f57ee8aad414 fs/cifs/cifsproto.h       Pavel Shilovsky            2016-11-23  104  			  const int flags, struct kvec *resp_iov);
e0bba0b8548179 fs/cifs/cifsproto.h       Ronnie Sahlberg            2018-08-01  105  extern int compound_send_recv(const unsigned int xid, struct cifs_ses *ses,
352d96f3acc6e0 fs/cifs/cifsproto.h       Aurelien Aptel             2020-05-31  106  			      struct TCP_Server_Info *server,
e0bba0b8548179 fs/cifs/cifsproto.h       Ronnie Sahlberg            2018-08-01  107  			      const int flags, const int num_rqst,
e0bba0b8548179 fs/cifs/cifsproto.h       Ronnie Sahlberg            2018-08-01  108  			      struct smb_rqst *rqst, int *resp_buf_type,
e0bba0b8548179 fs/cifs/cifsproto.h       Ronnie Sahlberg            2018-08-01  109  			      struct kvec *resp_iov);
96daf2b09178d8 fs/cifs/cifsproto.h       Steve French               2011-05-27  110  extern int SendReceive(const unsigned int /* xid */ , struct cifs_ses *,
^1da177e4c3f41 fs/cifs/cifsproto.h       Linus Torvalds             2005-04-16  111  			struct smb_hdr * /* input */ ,
^1da177e4c3f41 fs/cifs/cifsproto.h       Linus Torvalds             2005-04-16  112  			struct smb_hdr * /* out */ ,
a891f0f895f4a7 fs/cifs/cifsproto.h       Pavel Shilovsky            2012-05-23  113  			int * /* bytes returned */ , const int);
96daf2b09178d8 fs/cifs/cifsproto.h       Steve French               2011-05-27  114  extern int SendReceiveNoRsp(const unsigned int xid, struct cifs_ses *ses,
792af7b05b8a78 fs/cifs/cifsproto.h       Pavel Shilovsky            2012-03-23  115  			    char *in_buf, int flags);
1cdd5a2626d8c9 fs/smb/client/cifsproto.h Steve French               2025-08-05  116  int cifs_sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server);
fec344e3f31aa9 fs/cifs/cifsproto.h       Jeff Layton                2012-09-18  117  extern struct mid_q_entry *cifs_setup_request(struct cifs_ses *,
f780bd3fef17c4 fs/cifs/cifsproto.h       Aurelien Aptel             2019-09-20  118  				struct TCP_Server_Info *,
fec344e3f31aa9 fs/cifs/cifsproto.h       Jeff Layton                2012-09-18  119  				struct smb_rqst *);
fec344e3f31aa9 fs/cifs/cifsproto.h       Jeff Layton                2012-09-18  120  extern struct mid_q_entry *cifs_setup_async_request(struct TCP_Server_Info *,
fec344e3f31aa9 fs/cifs/cifsproto.h       Jeff Layton                2012-09-18  121  						struct smb_rqst *);
1cdd5a2626d8c9 fs/smb/client/cifsproto.h Steve French               2025-08-05  122  int __smb_send_rqst(struct TCP_Server_Info *server, int num_rqst,
1cdd5a2626d8c9 fs/smb/client/cifsproto.h Steve French               2025-08-05  123  		    struct smb_rqst *rqst);
2c8f981d93f830 fs/cifs/cifsproto.h       Jeff Layton                2011-05-19  124  extern int cifs_check_receive(struct mid_q_entry *mid,
2c8f981d93f830 fs/cifs/cifsproto.h       Jeff Layton                2011-05-19  125  			struct TCP_Server_Info *server, bool log_error);
1cdd5a2626d8c9 fs/smb/client/cifsproto.h Steve French               2025-08-05  126  int wait_for_free_request(struct TCP_Server_Info *server, const int flags,
1cdd5a2626d8c9 fs/smb/client/cifsproto.h Steve French               2025-08-05  127  			  unsigned int *instance);
cb7e9eabb2b584 fs/cifs/cifsproto.h       Pavel Shilovsky            2014-06-05  128  extern int cifs_wait_mtu_credits(struct TCP_Server_Info *server,
56257334e8e007 fs/smb/client/cifsproto.h David Howells              2023-10-06  129  				 size_t size, size_t *num,
335b7b62ffb69d fs/cifs/cifsproto.h       Pavel Shilovsky            2019-01-16 @130  				 struct cifs_credits *credits);
1cdd5a2626d8c9 fs/smb/client/cifsproto.h Steve French               2025-08-05  131  
1cdd5a2626d8c9 fs/smb/client/cifsproto.h Steve French               2025-08-05  132  static inline int
1cdd5a2626d8c9 fs/smb/client/cifsproto.h Steve French               2025-08-05  133  send_cancel(struct TCP_Server_Info *server, struct smb_rqst *rqst,
1cdd5a2626d8c9 fs/smb/client/cifsproto.h Steve French               2025-08-05  134  	    struct mid_q_entry *mid)
1cdd5a2626d8c9 fs/smb/client/cifsproto.h Steve French               2025-08-05  135  {
1cdd5a2626d8c9 fs/smb/client/cifsproto.h Steve French               2025-08-05 @136  	return server->ops->send_cancel ?
1cdd5a2626d8c9 fs/smb/client/cifsproto.h Steve French               2025-08-05  137  				server->ops->send_cancel(server, rqst, mid) : 0;
1cdd5a2626d8c9 fs/smb/client/cifsproto.h Steve French               2025-08-05  138  }
1cdd5a2626d8c9 fs/smb/client/cifsproto.h Steve French               2025-08-05  139  
1cdd5a2626d8c9 fs/smb/client/cifsproto.h Steve French               2025-08-05  140  int wait_for_response(struct TCP_Server_Info *server, struct mid_q_entry *midQ);
96daf2b09178d8 fs/cifs/cifsproto.h       Steve French               2011-05-27  141  extern int SendReceive2(const unsigned int /* xid */ , struct cifs_ses *,
84afc29b185334 fs/cifs/cifsproto.h       Steve French               2005-12-02  142  			struct kvec *, int /* nvec to send */,
da502f7df03d2d fs/cifs/cifsproto.h       Pavel Shilovsky            2016-10-25  143  			int * /* type of buf returned */, const int flags,
da502f7df03d2d fs/cifs/cifsproto.h       Pavel Shilovsky            2016-10-25  144  			struct kvec * /* resp vec */);
ad7a2926b9e53c fs/cifs/cifsproto.h       Steve French               2008-02-07  145  extern int SendReceiveBlockingLock(const unsigned int xid,
96daf2b09178d8 fs/cifs/cifsproto.h       Steve French               2011-05-27  146  			struct cifs_tcon *ptcon,
ad7a2926b9e53c fs/cifs/cifsproto.h       Steve French               2008-02-07  147  			struct smb_hdr *in_buf,
ad7a2926b9e53c fs/cifs/cifsproto.h       Steve French               2008-02-07  148  			struct smb_hdr *out_buf,
ad7a2926b9e53c fs/cifs/cifsproto.h       Steve French               2008-02-07  149  			int *bytes_returned);
705fc522fe9d58 fs/smb/client/cifsproto.h Shyam Prasad N             2023-10-13  150  
74ebd02163fde0 fs/smb/client/cifsproto.h Shyam Prasad N             2025-06-30  151  void smb2_query_server_interfaces(struct work_struct *work);
ba978e83255a75 fs/cifs/cifsproto.h       Shyam Prasad N             2022-01-17  152  void
dca65818c80cf0 fs/cifs/cifsproto.h       Shyam Prasad N             2022-02-15  153  cifs_signal_cifsd_for_reconnect(struct TCP_Server_Info *server,
dca65818c80cf0 fs/cifs/cifsproto.h       Shyam Prasad N             2022-02-15  154  				      bool all_channels);
dca65818c80cf0 fs/cifs/cifsproto.h       Shyam Prasad N             2022-02-15  155  void
ba978e83255a75 fs/cifs/cifsproto.h       Shyam Prasad N             2022-01-17  156  cifs_mark_tcp_ses_conns_for_reconnect(struct TCP_Server_Info *server,
ba978e83255a75 fs/cifs/cifsproto.h       Shyam Prasad N             2022-01-17  157  				      bool mark_smb_session);
183eea2ee5ba96 fs/cifs/cifsproto.h       Shyam Prasad N             2021-07-19  158  extern int cifs_reconnect(struct TCP_Server_Info *server,
183eea2ee5ba96 fs/cifs/cifsproto.h       Shyam Prasad N             2021-07-19  159  			  bool mark_smb_session);
373512ec5c105e fs/cifs/cifsproto.h       Steve French               2015-12-18  160  extern int checkSMB(char *buf, unsigned int len, struct TCP_Server_Info *srvr);
d4e4854fd1c85a fs/cifs/cifsproto.h       Pavel Shilovsky            2012-03-23  161  extern bool is_valid_oplock_break(char *, struct TCP_Server_Info *);
3d3ea8e64efbeb fs/cifs/cifsproto.h       Shirish Pargaonkar         2011-09-26  162  extern bool backup_cred(struct cifs_sb_info *);
e4b61f3b1c67f5 fs/smb/client/cifsproto.h Bharath SM                 2024-02-29 @163  extern bool is_size_safe_to_change(struct cifsInodeInfo *cifsInode, __u64 eof,
e4b61f3b1c67f5 fs/smb/client/cifsproto.h Bharath SM                 2024-02-29  164  				   bool from_readdir);
72432ffcf555de fs/cifs/cifsproto.h       Pavel Shilovsky            2011-01-24  165  extern void cifs_update_eof(struct cifsInodeInfo *cifsi, loff_t offset,
72432ffcf555de fs/cifs/cifsproto.h       Pavel Shilovsky            2011-01-24  166  			    unsigned int bytes_written);
20d72b00ca814d fs/smb/client/cifsproto.h David Howells              2025-05-19 @167  void cifs_write_subrequest_terminated(struct cifs_io_subrequest *wdata, ssize_t result);
86f740f2aed5ea fs/cifs/cifsproto.h       Aurelien Aptel             2020-02-21  168  extern struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *, int);
fe768d51c832eb fs/cifs/cifsproto.h       Pavel Shilovsky            2019-01-29  169  extern int cifs_get_writable_file(struct cifsInodeInfo *cifs_inode,
86f740f2aed5ea fs/cifs/cifsproto.h       Aurelien Aptel             2020-02-21  170  				  int flags,
fe768d51c832eb fs/cifs/cifsproto.h       Pavel Shilovsky            2019-01-29  171  				  struct cifsFileInfo **ret_file);
8de9e86c67baa7 fs/cifs/cifsproto.h       Ronnie Sahlberg            2019-08-30  172  extern int cifs_get_writable_path(struct cifs_tcon *tcon, const char *name,
86f740f2aed5ea fs/cifs/cifsproto.h       Aurelien Aptel             2020-02-21  173  				  int flags,
8de9e86c67baa7 fs/cifs/cifsproto.h       Ronnie Sahlberg            2019-08-30  174  				  struct cifsFileInfo **ret_file);
6508d904e6fb66 fs/cifs/cifsproto.h       Jeff Layton                2010-09-29  175  extern struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *, bool);
496902dc173dea fs/cifs/cifsproto.h       Ronnie Sahlberg            2019-09-09  176  extern int cifs_get_readable_path(struct cifs_tcon *tcon, const char *name,
496902dc173dea fs/cifs/cifsproto.h       Ronnie Sahlberg            2019-09-09  177  				  struct cifsFileInfo **ret_file);
262b73ef442e68 fs/smb/client/cifsproto.h Chunjie Zhu                2025-04-12  178  extern int cifs_get_hardlink_path(struct cifs_tcon *tcon, struct inode *inode,
262b73ef442e68 fs/smb/client/cifsproto.h Chunjie Zhu                2025-04-12  179  				  struct file *file);
68ed14496b032b fs/cifs/cifsproto.h       Enzo Matsumiya             2022-08-17  180  extern unsigned int smbCalcSize(void *buf);
^1da177e4c3f41 fs/cifs/cifsproto.h       Linus Torvalds             2005-04-16  181  extern int decode_negTokenInit(unsigned char *security_blob, int length,
26efa0bac9dc35 fs/cifs/cifsproto.h       Jeff Layton                2010-04-24  182  			struct TCP_Server_Info *server);
67b7626a0512d1 fs/cifs/cifsproto.h       David Howells              2010-07-22  183  extern int cifs_convert_address(struct sockaddr *dst, const char *src, int len);
b979aaa1777259 fs/cifs/cifsproto.h       Jeff Layton                2012-11-26  184  extern void cifs_set_port(struct sockaddr *addr, const unsigned short int port);
5ffef7bf1dd582 fs/cifs/cifsproto.h       Pavel Shilovsky            2012-03-23  185  extern int map_smb_to_linux_error(char *buf, bool logErr);
a3713ec3d775ff fs/cifs/cifsproto.h       Roberto Bergantinos Corpas 2020-07-03  186  extern int map_and_check_smb_error(struct mid_q_entry *mid, bool logErr);
^1da177e4c3f41 fs/cifs/cifsproto.h       Linus Torvalds             2005-04-16  187  extern void header_assemble(struct smb_hdr *, char /* command */ ,
96daf2b09178d8 fs/cifs/cifsproto.h       Steve French               2011-05-27  188  			    const struct cifs_tcon *, int /* length of
1982c344f1bf08 fs/cifs/cifsproto.h       Steve French               2005-08-17  189  			    fixed section (word count) in two byte units */);
5815449d1bfcb2 fs/cifs/cifsproto.h       Steve French               2006-02-14  190  extern int small_smb_init_no_tc(const int smb_cmd, const int wct,
96daf2b09178d8 fs/cifs/cifsproto.h       Steve French               2011-05-27  191  				struct cifs_ses *ses,
12b3b8ffb5fd59 fs/cifs/cifsproto.h       Steve French               2006-02-09  192  				void **request_buf);
3f618223dc0bdc fs/cifs/cifsproto.h       Jeff Layton                2013-06-12  193  extern enum securityEnum select_sectype(struct TCP_Server_Info *server,
3f618223dc0bdc fs/cifs/cifsproto.h       Jeff Layton                2013-06-12  194  				enum securityEnum requested);
58c45c58a1cbc8 fs/cifs/cifsproto.h       Pavel Shilovsky            2012-05-25  195  extern int CIFS_SessSetup(const unsigned int xid, struct cifs_ses *ses,
f486ef8e2003f6 fs/cifs/cifsproto.h       Shyam Prasad N             2021-07-19  196  			  struct TCP_Server_Info *server,
5815449d1bfcb2 fs/cifs/cifsproto.h       Steve French               2006-02-14  197  			  const struct nls_table *nls_cp);
95390201e7d8dd fs/cifs/cifsproto.h       Arnd Bergmann              2018-06-19  198  extern struct timespec64 cifs_NTtimeToUnix(__le64 utc_nanoseconds_since_1601);
95390201e7d8dd fs/cifs/cifsproto.h       Arnd Bergmann              2018-06-19  199  extern u64 cifs_UnixTimeToNT(struct timespec64);
95390201e7d8dd fs/cifs/cifsproto.h       Arnd Bergmann              2018-06-19  200  extern struct timespec64 cnvrtDosUnixTm(__le16 le_date, __le16 le_time,
c4a2c08db7d976 fs/cifs/cifsproto.h       Jeff Layton                2009-05-27  201  				      int offset);
c67236281c5d74 fs/cifs/cifsproto.h       Pavel Shilovsky            2010-11-03  202  extern void cifs_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock);
c11f1df5003d53 fs/cifs/cifsproto.h       Sachin Prabhu              2014-03-11  203  extern int cifs_get_writer(struct cifsInodeInfo *cinode);
c11f1df5003d53 fs/cifs/cifsproto.h       Sachin Prabhu              2014-03-11  204  extern void cifs_put_writer(struct cifsInodeInfo *cinode);
c11f1df5003d53 fs/cifs/cifsproto.h       Sachin Prabhu              2014-03-11  205  extern void cifs_done_oplock_break(struct cifsInodeInfo *cinode);
d39a4f710b7a7b fs/cifs/cifsproto.h       Pavel Shilovsky            2012-09-19  206  extern int cifs_unlock_range(struct cifsFileInfo *cfile,
d39a4f710b7a7b fs/cifs/cifsproto.h       Pavel Shilovsky            2012-09-19  207  			     struct file_lock *flock, const unsigned int xid);
d39a4f710b7a7b fs/cifs/cifsproto.h       Pavel Shilovsky            2012-09-19  208  extern int cifs_push_mandatory_locks(struct cifsFileInfo *cfile);
1bd5bbcb653177 fs/cifs/cifsproto.h       Steve French               2006-09-28  209  
d46b0da7a33dd8 fs/cifs/cifsproto.h       Dave Wysochanski           2019-10-23  210  extern void cifs_down_write(struct rw_semaphore *sem);
76894f3e2f7117 fs/cifs/cifsproto.h       Paulo Alcantara            2022-10-03 @211  struct cifsFileInfo *cifs_new_fileinfo(struct cifs_fid *fid, struct file *file,
76894f3e2f7117 fs/cifs/cifsproto.h       Paulo Alcantara            2022-10-03  212  				       struct tcon_link *tlink, __u32 oplock,
76894f3e2f7117 fs/cifs/cifsproto.h       Paulo Alcantara            2022-10-03  213  				       const char *symlink_target);
f6f1f1790775fb fs/cifs/cifsproto.h       Al Viro                    2021-03-18  214  extern int cifs_posix_open(const char *full_path, struct inode **inode,
6d5786a34d98bf fs/cifs/cifsproto.h       Pavel Shilovsky            2012-06-20  215  			   struct super_block *sb, int mode,
6d5786a34d98bf fs/cifs/cifsproto.h       Pavel Shilovsky            2012-06-20  216  			   unsigned int f_flags, __u32 *oplock, __u16 *netfid,
6d5786a34d98bf fs/cifs/cifsproto.h       Pavel Shilovsky            2012-06-20  217  			   unsigned int xid);
4065c802da7484 fs/cifs/cifsproto.h       Jeff Layton                2010-05-17 @218  void cifs_fill_uniqueid(struct super_block *sb, struct cifs_fattr *fattr);
cc0bad7552308e fs/cifs/cifsproto.h       Jeff Layton                2009-06-25  219  extern void cifs_unix_basic_to_fattr(struct cifs_fattr *fattr,
cc0bad7552308e fs/cifs/cifsproto.h       Jeff Layton                2009-06-25  220  				     FILE_UNIX_BASIC_INFO *info,
cc0bad7552308e fs/cifs/cifsproto.h       Jeff Layton                2009-06-25  221  				     struct cifs_sb_info *cifs_sb);
c052e2b423f3ea fs/cifs/cifsproto.h       Shirish Pargaonkar         2012-09-28  222  extern void cifs_dir_info_to_fattr(struct cifs_fattr *, FILE_DIRECTORY_INFO *,
c052e2b423f3ea fs/cifs/cifsproto.h       Shirish Pargaonkar         2012-09-28  223  					struct cifs_sb_info *);
e4b61f3b1c67f5 fs/smb/client/cifsproto.h Bharath SM                 2024-02-29  224  extern int cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr,
e4b61f3b1c67f5 fs/smb/client/cifsproto.h Bharath SM                 2024-02-29  225  			       bool from_readdir);
cc0bad7552308e fs/cifs/cifsproto.h       Jeff Layton                2009-06-25  226  extern struct inode *cifs_iget(struct super_block *sb,
cc0bad7552308e fs/cifs/cifsproto.h       Jeff Layton                2009-06-25  227  			       struct cifs_fattr *fattr);
cc0bad7552308e fs/cifs/cifsproto.h       Jeff Layton                2009-06-25  228  
76894f3e2f7117 fs/cifs/cifsproto.h       Paulo Alcantara            2022-10-03  229  int cifs_get_inode_info(struct inode **inode, const char *full_path,
76894f3e2f7117 fs/cifs/cifsproto.h       Paulo Alcantara            2022-10-03 @230  			struct cifs_open_info_data *data, struct super_block *sb, int xid,
76894f3e2f7117 fs/cifs/cifsproto.h       Paulo Alcantara            2022-10-03  231  			const struct cifs_fid *fid);
102466f303ffcd fs/smb/client/cifsproto.h Paulo Alcantara            2023-11-25  232  extern int smb311_posix_get_inode_info(struct inode **inode,
102466f303ffcd fs/smb/client/cifsproto.h Paulo Alcantara            2023-11-25  233  				       const char *full_path,
102466f303ffcd fs/smb/client/cifsproto.h Paulo Alcantara            2023-11-25  234  				       struct cifs_open_info_data *data,
102466f303ffcd fs/smb/client/cifsproto.h Paulo Alcantara            2023-11-25  235  				       struct super_block *sb,
102466f303ffcd fs/smb/client/cifsproto.h Paulo Alcantara            2023-11-25  236  				       const unsigned int xid);
^1da177e4c3f41 fs/cifs/cifsproto.h       Linus Torvalds             2005-04-16  237  extern int cifs_get_inode_info_unix(struct inode **pinode,
^1da177e4c3f41 fs/cifs/cifsproto.h       Linus Torvalds             2005-04-16  238  			const unsigned char *search_path,
6d5786a34d98bf fs/cifs/cifsproto.h       Pavel Shilovsky            2012-06-20  239  			struct super_block *sb, unsigned int xid);
ed6875e0d6c28e fs/cifs/cifsproto.h       Pavel Shilovsky            2012-09-18  240  extern int cifs_set_file_info(struct inode *inode, struct iattr *attrs,
f6f1f1790775fb fs/cifs/cifsproto.h       Al Viro                    2021-03-18  241  			      unsigned int xid, const char *full_path, __u32 dosattr);
ed6875e0d6c28e fs/cifs/cifsproto.h       Pavel Shilovsky            2012-09-18  242  extern int cifs_rename_pending_delete(const char *full_path,
ed6875e0d6c28e fs/cifs/cifsproto.h       Pavel Shilovsky            2012-09-18  243  				      struct dentry *dentry,
ed6875e0d6c28e fs/cifs/cifsproto.h       Pavel Shilovsky            2012-09-18  244  				      const unsigned int xid);
7f599d8fb3e087 fs/smb/client/cifsproto.h ChenXiaoSong               2024-08-22 @245  extern int sid_to_id(struct cifs_sb_info *cifs_sb, struct smb_sid *psid,
9934430e2178d5 fs/cifs/cifsproto.h       Steve French               2020-10-20  246  				struct cifs_fattr *fattr, uint sidtype);
987b21d7d91d03 fs/cifs/cifsproto.h       Shirish Pargaonkar         2010-11-10  247  extern int cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb,
0b8f18e358384a fs/cifs/cifsproto.h       Jeff Layton                2009-07-09  248  			      struct cifs_fattr *fattr, struct inode *inode,
e2f8fbfb8d09c0 fs/cifs/cifsproto.h       Steve French               2019-07-19  249  			      bool get_mode_from_special_sid,
42eacf9e57b65f fs/cifs/cifsproto.h       Steve French               2014-02-10  250  			      const char *path, const struct cifs_fid *pfid);
0f22053e811ca5 fs/cifs/cifsproto.h       Shyam Prasad N             2020-08-17  251  extern int id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64 *pnmode,
0f22053e811ca5 fs/cifs/cifsproto.h       Shyam Prasad N             2020-08-17  252  					kuid_t uid, kgid_t gid);
3651487607ae77 fs/smb/client/cifsproto.h ChenXiaoSong               2024-08-22  253  extern struct smb_ntsd *get_cifs_acl(struct cifs_sb_info *cifssmb, struct inode *ino,
3651487607ae77 fs/smb/client/cifsproto.h ChenXiaoSong               2024-08-22  254  				      const char *path, u32 *plen, u32 info);
3651487607ae77 fs/smb/client/cifsproto.h ChenXiaoSong               2024-08-22  255  extern struct smb_ntsd *get_cifs_acl_by_fid(struct cifs_sb_info *cifssb,
3651487607ae77 fs/smb/client/cifsproto.h ChenXiaoSong               2024-08-22  256  				const struct cifs_fid *pfid, u32 *plen, u32 info);
77435322777d8a fs/cifs/cifsproto.h       Christian Brauner          2023-01-13  257  extern struct posix_acl *cifs_get_acl(struct mnt_idmap *idmap,
bd9684b042dcbb fs/cifs/cifsproto.h       Christian Brauner          2022-09-22  258  				      struct dentry *dentry, int type);
13e83a4923bea7 fs/cifs/cifsproto.h       Christian Brauner          2023-01-13  259  extern int cifs_set_acl(struct mnt_idmap *idmap,
dc1af4c4b4721a fs/cifs/cifsproto.h       Christian Brauner          2022-09-22  260  			struct dentry *dentry, struct posix_acl *acl, int type);
3651487607ae77 fs/smb/client/cifsproto.h ChenXiaoSong               2024-08-22  261  extern int set_cifs_acl(struct smb_ntsd *pntsd, __u32 len, struct inode *ino,
3651487607ae77 fs/smb/client/cifsproto.h ChenXiaoSong               2024-08-22  262  				const char *path, int flag);
09bedafc1e2c5c fs/smb/client/cifsproto.h ChenXiaoSong               2024-08-22 @263  extern unsigned int setup_authusers_ACE(struct smb_ace *pace);
d413eabff18d64 fs/smb/client/cifsproto.h Ralph Boehme               2024-11-14  264  extern unsigned int setup_special_mode_ACE(struct smb_ace *pace,
d413eabff18d64 fs/smb/client/cifsproto.h Ralph Boehme               2024-11-14  265  					   bool posix,
d413eabff18d64 fs/smb/client/cifsproto.h Ralph Boehme               2024-11-14  266  					   __u64 nmode);
09bedafc1e2c5c fs/smb/client/cifsproto.h ChenXiaoSong               2024-08-22  267  extern unsigned int setup_special_user_owner_ACE(struct smb_ace *pace);
953f868138dbf4 fs/cifs/cifsproto.h       Steve French               2007-10-31  268  
e28bc5b1fdbd6e fs/cifs/cifsproto.h       Jeff Layton                2011-10-19  269  extern void dequeue_mid(struct mid_q_entry *mid, bool malformed);
e28bc5b1fdbd6e fs/cifs/cifsproto.h       Jeff Layton                2011-10-19  270  extern int cifs_read_from_socket(struct TCP_Server_Info *server, char *buf,
e28bc5b1fdbd6e fs/cifs/cifsproto.h       Jeff Layton                2011-10-19  271  			         unsigned int to_read);
cf0604a686b111 fs/cifs/cifsproto.h       David Howells              2021-02-04  272  extern ssize_t cifs_discard_from_socket(struct TCP_Server_Info *server,
cf0604a686b111 fs/cifs/cifsproto.h       David Howells              2021-02-04  273  					size_t to_read);
16541195c6d9bc fs/cifs/cifsproto.h       David Howells              2022-04-06  274  int cifs_read_iter_from_socket(struct TCP_Server_Info *server,
16541195c6d9bc fs/cifs/cifsproto.h       David Howells              2022-04-06  275  			       struct iov_iter *iter,
16541195c6d9bc fs/cifs/cifsproto.h       David Howells              2022-04-06  276  			       unsigned int to_read);
51acd208bd57c8 fs/cifs/cifsproto.h       Ronnie Sahlberg            2020-12-14  277  extern int cifs_setup_cifs_sb(struct cifs_sb_info *cifs_sb);
a1c0d00572fca4 fs/cifs/cifsproto.h       Paulo Alcantara            2022-11-17 @278  void cifs_mount_put_conns(struct cifs_mount_ctx *mnt_ctx);
a73a26d97eca08 fs/cifs/cifsproto.h       Paulo Alcantara            2022-10-11  279  int cifs_mount_get_session(struct cifs_mount_ctx *mnt_ctx);
a1c0d00572fca4 fs/cifs/cifsproto.h       Paulo Alcantara            2022-11-17  280  int cifs_is_path_remote(struct cifs_mount_ctx *mnt_ctx);
a73a26d97eca08 fs/cifs/cifsproto.h       Paulo Alcantara            2022-10-11  281  int cifs_mount_get_tcon(struct cifs_mount_ctx *mnt_ctx);
724d9f1cfba0cb fs/cifs/cifsproto.h       Pavel Shilovsky            2011-05-05  282  extern int cifs_match_super(struct super_block *, void *);
3fa1c6d1b8f5c3 fs/cifs/cifsproto.h       Ronnie Sahlberg            2020-12-09  283  extern int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx);
2a9b99516c662d fs/cifs/cifsproto.h       Al Viro                    2011-06-17  284  extern void cifs_umount(struct cifs_sb_info *);
aa24d1e9692411 fs/cifs/cifsproto.h       Pavel Shilovsky            2011-12-27  285  extern void cifs_mark_open_files_invalid(struct cifs_tcon *tcon);
52ace1ef1259e1 fs/cifs/cifsproto.h       Steve French               2016-09-22  286  extern void cifs_reopen_persistent_handles(struct cifs_tcon *tcon);
52ace1ef1259e1 fs/cifs/cifsproto.h       Steve French               2016-09-22  287  
579f9053236c79 fs/cifs/cifsproto.h       Pavel Shilovsky            2012-09-19  288  extern bool cifs_find_lock_conflict(struct cifsFileInfo *cfile, __u64 offset,
9645759ce6b390 fs/cifs/cifsproto.h       Ronnie Sahlberg            2018-10-04  289  				    __u64 length, __u8 type, __u16 flags,
579f9053236c79 fs/cifs/cifsproto.h       Pavel Shilovsky            2012-09-19 @290  				    struct cifsLockInfo **conf_lock,
081c0414dcdfd1 fs/cifs/cifsproto.h       Pavel Shilovsky            2012-11-27  291  				    int rw_check);
233839b1df65a2 fs/cifs/cifsproto.h       Pavel Shilovsky            2012-09-19  292  extern void cifs_add_pending_open(struct cifs_fid *fid,
233839b1df65a2 fs/cifs/cifsproto.h       Pavel Shilovsky            2012-09-19  293  				  struct tcon_link *tlink,
233839b1df65a2 fs/cifs/cifsproto.h       Pavel Shilovsky            2012-09-19 @294  				  struct cifs_pending_open *open);
233839b1df65a2 fs/cifs/cifsproto.h       Pavel Shilovsky            2012-09-19  295  extern void cifs_add_pending_open_locked(struct cifs_fid *fid,
233839b1df65a2 fs/cifs/cifsproto.h       Pavel Shilovsky            2012-09-19  296  					 struct tcon_link *tlink,
233839b1df65a2 fs/cifs/cifsproto.h       Pavel Shilovsky            2012-09-19  297  					 struct cifs_pending_open *open);
233839b1df65a2 fs/cifs/cifsproto.h       Pavel Shilovsky            2012-09-19  298  extern void cifs_del_pending_open(struct cifs_pending_open *open);
c3f207ab29f793 fs/cifs/cifsproto.h       Rohith Surabattula         2021-04-13  299  
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
author maintainer
#3 lore raw

RFC PATCH 2/2 cifs: Clean up declarations

In reply to David Howells

Use this script, run as "cifs_proto.pl fs/smb/client/*.[ch]" to organise the function declarations. Most of the declarations will be split between cifsproto.h, smb1proto.h and smb2proto.h but with exceptions for compress.h, fscache.h and cifs_swn.h.

The declarations are inserted into each target proto file in place of line containing a comment of the form "/* PROTOTYPES */". The old header declarations are removed. Note that this script, as it stands, cannot be used again on its output as it inserts dividing comments to categorise the prototypes list by source filename.

The declarations are copied from the .c file, so that the argument names will match and ordered by appearance in the .c file.

Note that this must be applied on top of the preparatory patch otherwise it won't work.

use strict;

unless (@ARGV) {
    die "Usage: $0 <c_file1> [<c_file2> ...]\n";
}

my $filename = "-";
my $lineno = 0;
my @proto = "";
my @smb1proto = "";
my @smb2proto = "";
my @smbdirect = "";
my @compress = "";
my @fscache = "";
my @swn = "";
my %funcs = ();

sub error(@) {
    print STDERR $filename, ":", $lineno, ": ", @_, "\n";
    exit(1);
}
foreach my $file (@ARGV) {
    # Open the file for reading.
    next if $file =~ /trace[.]h$/;
    open my $fh, "<$file"
        or die "Could not open file '$file'";
    $filename = $file;
    $lineno = 0;
    my $state = 0;
    my $qual = "";
    my $type = "";
    my $func = "";
    my $funcdef = "";
    my $bracket = 0;
    my $comment = 0;
    my $filemarker = 0;
    my $insecure = 0;
    my $header = 0;
    my $inline = 0;
    my $f_content = "";
    my $copy = "";
    my $config = "";
    $header = 1 if ($file =~ m!.h$!);
    $insecure = 1 if ($file =~ m!/smb1ops.c|/cifssmb.c|/cifstransport.c!);
    foreach my $line (<$fh>) {
	$lineno++;
	$copy .= $line;
	unless ($line) {
	    $f_content .= $copy;
	    $copy = "";
	    next;
	}
	if ($comment) {
	    $comment = 0 if ($line =~ m![*]/!);
	    $f_content .= $copy;
	    $copy = "";
	    next;
	}
	if ($line =~ /^[#]/) {
	    # if ($line =~ /ifdef.*CONFIG_CIFS_ALLOW_INSECURE_LEGACY/) {
	    # 	$insecure++;
	    # } elsif ($line =~ /endif.*CONFIG_CIFS_ALLOW_INSECURE_LEGACY/) {
	    # 	$insecure--;
	    # }
	    if ($header) {
		if ($line =~ /ifdef.*(CONFIG_[A-Z0-9_])/) {
		    error("multiconfig") if $config;
		    $config = $1;
		    $insecure++ if ($config eq "CONFIG_CIFS_ALLOW_INSECURE_LEGACY");
		} elsif ($line =~ /endif/) {
		    $insecure-- if ($config eq "CONFIG_CIFS_ALLOW_INSECURE_LEGACY");
		    $config = "";
		}
	    }
	    $f_content .= $copy;
	    $copy = "";
	    next;
	}
	if ($line =~ /^[{]/ ||
	    $line =~ /##/ ||
	    $line =~ /^[_a-z0-9A-Z]+:$/ || # goto label
	    $line =~ /^do [{]/ ||
	    $line =~ m!^//!) {
	    $f_content .= $copy;
	    $copy = "";
	    next;
	}
	if ($line =~ m!^/[*]!) {
	    $comment = 1 unless ($line =~ m![*]/!);
	    $f_content .= $copy;
	    $copy = "";
	    next;
	}
	if ($line =~ /^[}]/) {
		$type = "";
		$qual = "";
		$func = "";
		$funcdef = "";
		$f_content .= $copy;
		$copy = "";
		next;
	}
	if ($line =~ /^typedef/) {
	    $type = "";
	    $qual = "";
	    $func = "";
	    $funcdef = "";
	    $f_content .= $copy;
	    $copy = "";
	    next;
	}
	if ($line =~ /^(static|extern|inline|noinline|noinline_for_stack|__always_inline)\W/) {
	    error("Unexpected qualifier '$1'") if ($state != 0);
	    while ($line =~ /^(static|extern|inline|noinline|noinline_for_stack|__always_inline)\W/) {
		$qual .= $1 . " ";
		$inline = 1 if ($1 eq "inline");
		$inline = 1 if ($1 eq "__always_inline");
		$line = substr($line, length($1));
		$line =~ s/^\s+//;
	    }
	}
	if ($state == 0) {
	    if ($line =~ /^\s/) {
		$f_content .= $copy;
		$copy = "";
		next;
	    }
	    while ($line =~ /^(unsigned|signed|bool|char|short|int|long|void|const|volatile|(struct|union|enum)\s+[_a-zA-Z][_a-zA-Z0-9]*|[*]|__init|__exit|__le16|__le32|__le64|__be16|__be32|__be64)/) {
		$type .= " " if $type;
		$type .= $1;
		$line = substr($line, length($1));
		$line =~ s/^\s+//;
	    }
	    if ($line =~ /^struct [{]/) {
		$type = "";
		$qual = "";
		$func = "";
		$funcdef = "";
		$f_content .= $copy;
		$copy = "";
		next;
	    }
	    if (index($line, "=") >= 0) {
		$type = "";
		$qual = "";
		$func = "";
		$funcdef = "";
		$f_content .= $copy;
		$copy = "";
		next;
	    }
	    while ($line =~ /(^[_a-zA-Z][_a-zA-Z0-9]*)/) {
		my $name = $1;
		$line = substr($line, length($name));
		next if ($line =~ /^[{]/);
		$line =~ s/^\s+//;
		if (substr($line, 0, 1) eq "(") {
		    $state = 1;
		    $line = substr($line, 1);
		    $func = $name;
		    $funcdef = $qual . $type . " " . $func . "(";
		    $funcdef =~ s/[*] /*/;
		    $bracket = 1;
		    last;
		} elsif (substr($line, 0, 1) eq "[") {
		    last;
		} elsif (substr($line, 0, 1) eq ";") {
		    last;
		} else {
		    if ($type) {
			if (index($line, ";") >= 0 && index($line, "(") == -1) {
			    last;
			}
			error("Unexpected name '$name' after '$type'");
		    }
		    $type .= " " if $type;
		    $type .= $name;
		    if ($line =~ /^(\s*[*]+)/) {
			my $ptr = $1;
			$type .= $ptr;
			$line = substr($line, length($ptr));
		    }
		}
	    }
	}
	if ($state == 1) {
	    my $o;
	    my $c;
	    while ($o = index($line, "("),
		   $c = index($line, ")"), 1) {
		my $b;
		if ($o == -1) {
		    if ($c == -1) {
			$funcdef .= $line;
			last;
		    } else {
			$b = $c;
			$bracket--;
			unless ($bracket) {
			    $funcdef .= substr($line, 0, $b + 1);
			    $line = substr($line, $b + 1);
			    $state = 2;
			    last;
			}
		    }
		} else {
		    $b = $o;
		    if ($c == -1) {
			$bracket++;
		    } elsif ($c < $o) {
			$b = $c;
			$bracket--;
			unless ($bracket) {
			    $funcdef .= substr($line, 0, $b + 1);
			    $line = substr($line, $b + 1);
			    $state = 2;
			    last;
			}
		    } else {
			$bracket++;
		    }
		}
		$funcdef .= substr($line, 0, $b);
		$line = substr($line, $b + 1);
	    }
	}
	if ($state == 2) {
	    $inline = 1 if ($qual =~ /inline/);
	    if (!$header &&
		$qual !~ /static/ &&
		$func ne "module_init" &&
		$func ne "module_exit" &&
		$func ne "module_param" &&
		$func ne "PROC_FILE_DEFINE" &&
		$func !~ /MODULE_/ &&
		$func !~ /DEFINE_/) {
		my $p;
		if ($insecure) {
		    $p = \@smb1proto;
		} elsif ($file =~ m!/smb2! ||
			 $file =~ m!/cached_dir!) {
		    $p = \@smb2proto;
		} elsif ($file =~ m!/smbdirect.c!) {
		    $p = \@smbdirect;
		} elsif ($file =~ m!/compress.c!) {
		    $p = \@compress;
		} elsif ($file =~ m!/fscache.c!) {
		    $p = \@fscache;
		} elsif ($file =~ m!/cifs_swn.c!) {
		    $p = \@swn;
		} else {
		    $p = \@proto;
		}
		unless ($filemarker) {
		    my $n = $file;
		    $n =~ s!.*/!!;
		    push @{$p}, "\n/*\n * $n\n */\n";
		    $filemarker = 1;
		}
		push @{$p}, $funcdef . ";\n";
	    } elsif (!$header || $inline) {
		$f_content .= $copy;
	    }

	    $funcdef = "";
	    $type = "";
	    $qual = "";
	    $func = "";
	    $inline = 0;
	    $state = 0;
	    $copy = "";
	}
	if ($line =~ /;/) {
	    $type = "";
	    $qual = "";
	    $func = "";
	    $funcdef = "";
	    $state = 0;
	    $f_content .= $copy;
	    $copy = "";
	}
    }
    close($fh);
    if ($header) {
	$f_content =~ s/[\n]{3,}/\n\n/g;
	open my $fh, ">$file"
	    or die "Could not open file '$file' for writing";
	print($fh $f_content) or die $file;
	close($fh) or die $file;
    }
}
sub insert_protos($$)
{
    my ($file, $protos) = @_;
    open my $fh, "<$file"
	or die "Could not open file '$file'";
    my @lines = <$fh>;
    close($fh);
    open $fh, ">$file"
	or die "Could not open file '$file' for writing";
    foreach my $line (@lines) {
	if ($line eq "/* PROTOTYPES */\n") {
	    print($fh @{$protos}) or die $file;
	} else {
	    print($fh $line) or die $file;
	}
    }
    close($fh) or die $file;
}

insert_protos("fs/smb/client/cifsproto.h", \@proto); insert_protos("fs/smb/client/smb1proto.h", \@smb1proto); insert_protos("fs/smb/client/smb2proto.h", \@smb2proto); insert_protos("fs/smb/client/smbdirect.h", \@smbdirect); insert_protos("fs/smb/client/compress.h", \@compress); insert_protos("fs/smb/client/fscache.h", \@fscache); insert_protos("fs/smb/client/cifs_swn.h", \@swn);

---
 fs/smb/client/cached_dir.h   |   19 -
 fs/smb/client/cifs_debug.h   |    5 -
 fs/smb/client/cifs_spnego.h  |    2 -
 fs/smb/client/cifs_swn.h     |   17 +-
 fs/smb/client/cifs_unicode.h |   16 -
 fs/smb/client/cifsfs.h       |   64 --
 fs/smb/client/cifsglob.h     |   17 -
 fs/smb/client/cifspdu.h      |   12 -
 fs/smb/client/cifsproto.h    | 1223 ++++++++++++++++------------------
 fs/smb/client/compress.h     |    6 +-
 fs/smb/client/dfs.h          |    4 -
 fs/smb/client/dfs_cache.h    |   16 -
 fs/smb/client/dns_resolve.h  |    3 -
 fs/smb/client/fs_context.h   |    9 -
 fs/smb/client/fscache.h      |   15 +-
 fs/smb/client/netlink.h      |    3 -
 fs/smb/client/nterr.h        |    2 -
 fs/smb/client/ntlmssp.h      |   13 -
 fs/smb/client/reparse.h      |   11 -
 fs/smb/client/smb1proto.h    |  212 +++++-
 fs/smb/client/smb2pdu.h      |    2 -
 fs/smb/client/smb2proto.h    |  533 ++++++++-------
 fs/smb/client/smbdirect.h    |   27 +-
 23 files changed, 1101 insertions(+), 1130 deletions(-)
fs/smb/client/cached_dir.h +0 -19
index 46b5a2fdf15b..0c8b6b13ad4b 100644
@@ -8,7 +8,6 @@
 #ifndef _CACHED_DIR_H
 #define _CACHED_DIR_H
 
-
 struct cached_dirent {
 	struct list_head entry;
 	char *name;
@@ -64,22 +63,4 @@ struct cached_fids {
 	struct delayed_work laundromat_work;
 };
 
-extern struct cached_fids *init_cached_dirs(void);
-extern void free_cached_dirs(struct cached_fids *cfids);
-extern int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
-			   const char *path,
-			   struct cifs_sb_info *cifs_sb,
-			   bool lookup_only, struct cached_fid **cfid);
-extern int open_cached_dir_by_dentry(struct cifs_tcon *tcon,
-				     struct dentry *dentry,
-				     struct cached_fid **cfid);
-extern void close_cached_dir(struct cached_fid *cfid);
-extern void drop_cached_dir_by_name(const unsigned int xid,
-				    struct cifs_tcon *tcon,
-				    const char *name,
-				    struct cifs_sb_info *cifs_sb);
-extern void close_all_cached_dirs(struct cifs_sb_info *cifs_sb);
-extern void invalidate_all_cached_dirs(struct cifs_tcon *tcon);
-extern bool cached_dir_lease_break(struct cifs_tcon *tcon, __u8 lease_key[16]);
-
 #endif			/* _CACHED_DIR_H */
fs/smb/client/cifs_debug.h +0 -5
index ce5cfd236fdb..38da0663304b 100644
@@ -14,11 +14,7 @@
 
 #define pr_fmt(fmt) "CIFS: " fmt
 
-void cifs_dump_mem(char *label, void *data, int length);
-void cifs_dump_detail(void *buf, struct TCP_Server_Info *ptcp_info);
-void cifs_dump_mids(struct TCP_Server_Info *);
 extern bool traceSMB;		/* flag which enables the function below */
-void dump_smb(void *, int);
 #define CIFS_INFO	0x01
 #define CIFS_RC		0x02
 #define CIFS_TIMER	0x04
@@ -39,7 +35,6 @@ extern int cifsFYI;
  */
 #ifdef CONFIG_CIFS_DEBUG
 
-
 /*
  * When adding tracepoints and debug messages we have various choices.
  * Some considerations:
fs/smb/client/cifs_spnego.h +0 -2
index e4d751b0c812..8eb57900b9ee 100644
@@ -29,8 +29,6 @@ struct cifs_spnego_msg {
 
 #ifdef __KERNEL__
 extern struct key_type cifs_spnego_key_type;
-extern struct key *cifs_get_spnego_key(struct cifs_ses *sesInfo,
-				       struct TCP_Server_Info *server);
 #endif /* KERNEL */
 
 #endif /* _CIFS_SPNEGO_H */
fs/smb/client/cifs_swn.h +8 -9
index 7063539c41c8..6d4ad7e35953 100644
@@ -15,16 +15,15 @@ struct genl_info;
 
 #ifdef CONFIG_CIFS_SWN_UPCALL
 
-/* PROTOTYPES */
-extern int cifs_swn_register(struct cifs_tcon *tcon);
 
-extern int cifs_swn_unregister(struct cifs_tcon *tcon);
-
-extern int cifs_swn_notify(struct sk_buff *skb, struct genl_info *info);
-
-extern void cifs_swn_dump(struct seq_file *m);
-
-extern void cifs_swn_check(void);
+/*
+ * cifs_swn.c
+ */
+int cifs_swn_notify(struct sk_buff *skb, struct genl_info *info);
+int cifs_swn_register(struct cifs_tcon *tcon);
+int cifs_swn_unregister(struct cifs_tcon *tcon);
+void cifs_swn_dump(struct seq_file *m);
+void cifs_swn_check(void);
 
 static inline bool cifs_swn_set_server_dstaddr(struct TCP_Server_Info *server)
 {
fs/smb/client/cifs_unicode.h +0 -16
index e137a0dfbbe9..55400e7ba70b 100644
@@ -55,22 +55,6 @@
 #define SFU_MAP_UNI_RSVD	2
 
 #ifdef __KERNEL__
-int cifs_from_utf16(char *to, const __le16 *from, int tolen, int fromlen,
-		    const struct nls_table *cp, int map_type);
-int cifs_utf16_bytes(const __le16 *from, int maxbytes,
-		     const struct nls_table *codepage);
-int cifs_strtoUTF16(__le16 *, const char *, int, const struct nls_table *);
-char *cifs_strndup_from_utf16(const char *src, const int maxlen,
-			      const bool is_unicode,
-			      const struct nls_table *codepage);
-extern int cifsConvertToUTF16(__le16 *target, const char *source, int maxlen,
-			      const struct nls_table *cp, int mapChars);
-extern int cifs_remap(struct cifs_sb_info *cifs_sb);
-extern __le16 *cifs_strndup_to_utf16(const char *src, const int maxlen,
-				     int *utf16_len, const struct nls_table *cp,
-				     int remap);
 #endif
 
-wchar_t cifs_toupper(wchar_t in);
-
 #endif /* _CIFS_UNICODE_H */
fs/smb/client/cifsfs.h +0 -64

100 lines not on this page · raw message

fs/smb/client/cifsglob.h +0 -17
index f052e489e941..806ab1eb05cc 100644
@@ -1357,9 +1357,6 @@ struct tcon_link {
 	struct cifs_tcon	*tl_tcon;
 };
 
-extern struct tcon_link *cifs_sb_tlink(struct cifs_sb_info *cifs_sb);
-extern void smb3_free_compound_rqst(int num_rqst, struct smb_rqst *rqst);
-
 static inline struct cifs_tcon *
 tlink_tcon(struct tcon_link *tlink)
 {
@@ -1372,8 +1369,6 @@ cifs_sb_master_tlink(struct cifs_sb_info *cifs_sb)
 	return cifs_sb->master_tlink;
 }
 
-extern void cifs_put_tlink(struct tcon_link *tlink);
-
 static inline struct tcon_link *
 cifs_get_tlink(struct tcon_link *tlink)
 {
@@ -1383,7 +1378,6 @@ cifs_get_tlink(struct tcon_link *tlink)
 }
 
 /* This function is always expected to succeed */
-extern struct cifs_tcon *cifs_sb_master_tcon(struct cifs_sb_info *cifs_sb);
 
 #define CIFS_OPLOCK_NO_CHANGE 0xfe
 
@@ -1555,11 +1549,6 @@ cifsFileInfo_get_locked(struct cifsFileInfo *cifs_file)
 	++cifs_file->count;
 }
 
-struct cifsFileInfo *cifsFileInfo_get(struct cifsFileInfo *cifs_file);
-void _cifsFileInfo_put(struct cifsFileInfo *cifs_file, bool wait_oplock_hdlr,
-		       bool offload);
-void cifsFileInfo_put(struct cifsFileInfo *cifs_file);
-
 #define CIFS_CACHE_READ_FLG	1
 #define CIFS_CACHE_HANDLE_FLG	2
 #define CIFS_CACHE_RH_FLG	(CIFS_CACHE_READ_FLG | CIFS_CACHE_HANDLE_FLG)
@@ -1673,7 +1662,6 @@ static inline void cifs_stats_bytes_read(struct cifs_tcon *tcon,
 	spin_unlock(&tcon->stat_lock);
 }
 
-
 /*
  * This is the prototype for the mid receive function. This function is for
  * receiving the rest of the SMB frame, starting with the WordCount (which is
@@ -1880,7 +1868,6 @@ static inline bool is_replayable_error(int error)
 	return false;
 }
 
-
 /* cifs_get_writable_file() flags */
 #define FIND_WR_ANY         0
 #define FIND_WR_FSUID_ONLY  1
@@ -2112,10 +2099,6 @@ extern unsigned int dir_cache_timeout; /* max time for directory lease caching o
 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);
-void smb2_deferred_work_close(struct work_struct *work);
-
 extern const struct slow_work_ops cifs_oplock_break_ops;
 extern struct workqueue_struct *cifsiod_wq;
 extern struct workqueue_struct *decrypt_wq;
fs/smb/client/cifspdu.h +0 -12
index d9cf7db0ac35..5a5f378f58cc 100644
@@ -292,7 +292,6 @@
 #define SET_MINIMUM_RIGHTS (FILE_READ_EA | FILE_READ_ATTRIBUTES \
 				| READ_CONTROL | SYNCHRONIZE)
 
-
 /*
  * Invalid readdir handle
  */
@@ -708,7 +707,6 @@ struct ntlmv2_resp {
 	/* array of name entries could follow ending in minimum 4 byte struct */
 } __attribute__((packed));
 
-
 #define CIFS_NETWORK_OPSYS "CIFS VFS Client for Linux"
 
 /* Capabilities bits (for NTLM SessSetup request) */
@@ -762,7 +760,6 @@ typedef struct smb_com_tconx_rsp_ext {
 	/* STRING NativeFileSystem */
 } __attribute__((packed)) TCONX_RSP_EXT;
 
-
 /* tree connect Flags */
 #define DISCONNECT_TID          0x0001
 #define TCON_EXTENDED_SIGNATURES 0x0004
@@ -962,7 +959,6 @@ typedef struct smb_com_open_rsp_ext {
 	__u16 ByteCount;        /* bct = 0 */
 } __attribute__((packed)) OPEN_RSP_EXT;
 
-
 /* format of legacy open request */
 typedef struct smb_com_openx_req {
 	struct smb_hdr	hdr;	/* wct = 15 */
@@ -1427,7 +1423,6 @@ typedef struct smb_com_transaction_qsec_req {
 	__le32 AclFlags;
 } __attribute__((packed)) QUERY_SEC_DESC_REQ;
 
-
 typedef struct smb_com_transaction_ssec_req {
 	struct smb_hdr hdr;     /* wct = 19 */
 	__u8 MaxSetupCount;
@@ -1622,7 +1617,6 @@ struct smb_t2_rsp {
 #define SMB_QUERY_FILE_MODE_INFO        0x3f8
 #define SMB_QUERY_FILE_ALGN_INFO        0x3f9
 
-
 #define SMB_SET_FILE_BASIC_INFO	        0x101
 #define SMB_SET_FILE_DISPOSITION_INFO   0x102
 #define SMB_SET_FILE_ALLOCATION_INFO    0x103
@@ -2172,7 +2166,6 @@ typedef struct {
 #define CIFS_UNIX_CAP_MASK              0x00000013
 #endif /* CONFIG_CIFS_POSIX */
 
-
 #define CIFS_POSIX_EXTENSIONS           0x00000010 /* support for new QFSInfo */
 
 typedef struct {
@@ -2239,7 +2232,6 @@ typedef struct {
 /* minimum includes first three fields, and empty FS Name */
 #define MIN_FS_ATTR_INFO_SIZE 12
 
-
 /* List of FileSystemAttributes - see 2.5.1 of MS-FSCC */
 #define FILE_SUPPORTS_SPARSE_VDL	0x10000000 /* faster nonsparse extend */
 #define FILE_SUPPORTS_BLOCK_REFCOUNTING	0x08000000 /* allow ioctl dup extents */
@@ -2308,7 +2300,6 @@ typedef struct {
 	__u16 Pad;
 } __attribute__((packed)) FILE_STANDARD_INFO;	/* level 0x102 QPathInfo */
 
-
 /* defines for enumerating possible values of the Unix type field below */
 #define UNIX_FILE      0
 #define UNIX_DIR       1
@@ -2483,7 +2474,6 @@ struct file_attrib_tag {
 	__le32 ReparseTag;
 } __attribute__((packed));      /* level 0x40b */
 
-
 /********************************************************/
 /*  FindFirst/FindNext transact2 data buffer formats    */
 /********************************************************/
@@ -2577,7 +2567,6 @@ typedef struct {
 	char FileName[];
 } __attribute__((packed)) FIND_FILE_STANDARD_INFO; /* level 0x1 FF resp data */
 
-
 struct fea {
 	unsigned char EA_flags;
 	__u8 name_len;
@@ -2600,7 +2589,6 @@ struct data_blob {
 	void (*free) (struct data_blob *data_blob);
 } __attribute__((packed));
 
-
 #ifdef CONFIG_CIFS_POSIX
 /*
 	For better POSIX semantics from Linux client, (even better
fs/smb/client/cifsproto.h +590 -633

1,267 lines not on this page · raw message

fs/smb/client/compress.h +4 -2
index 2a51c31d9387..fd9b67192c01 100644
@@ -29,10 +29,12 @@
 #ifdef CONFIG_CIFS_COMPRESSION
 typedef int (*compress_send_fn)(struct TCP_Server_Info *, int, struct smb_rqst *);
 
-/* PROTOTYPES */
 
-int smb_compress(struct TCP_Server_Info *server, struct smb_rqst *rq, compress_send_fn send_fn);
+/*
+ * compress.c
+ */
 bool should_compress(const struct cifs_tcon *tcon, const struct smb_rqst *rq);
+int smb_compress(struct TCP_Server_Info *server, struct smb_rqst *rq, compress_send_fn send_fn);
 
 /**
  * smb_compress_alg_valid() - Validate a compression algorithm.
fs/smb/client/dfs.h +0 -4
index e60f0a24a8a1..4b9d2675509d 100644
@@ -151,10 +151,6 @@ static inline void ref_walk_mark_end(struct dfs_ref_walk *rw)
 	ref->tit = ERR_PTR(-ENOENT); /* end marker */
 }
 
-int dfs_parse_target_referral(const char *full_path, const struct dfs_info3_param *ref,
-			      struct smb3_fs_context *ctx);
-int dfs_mount_share(struct cifs_mount_ctx *mnt_ctx);
-
 static inline char *dfs_get_path(struct cifs_sb_info *cifs_sb, const char *path)
 {
 	return dfs_cache_canonical_path(path, cifs_sb->local_nls, cifs_remap(cifs_sb));
fs/smb/client/dfs_cache.h +0 -16
index 18a08a2ca93b..8a106cd44111 100644
@@ -33,24 +33,8 @@ struct dfs_cache_tgt_iterator {
 	struct list_head it_list;
 };
 
-int dfs_cache_init(void);
-void dfs_cache_destroy(void);
 extern const struct proc_ops dfscache_proc_ops;
 
-int dfs_cache_find(const unsigned int xid, struct cifs_ses *ses, const struct nls_table *cp,
-		   int remap, const char *path, struct dfs_info3_param *ref,
-		   struct dfs_cache_tgt_list *tgt_list);
-int dfs_cache_noreq_find(const char *path, struct dfs_info3_param *ref,
-			 struct dfs_cache_tgt_list *tgt_list);
-void dfs_cache_noreq_update_tgthint(const char *path, const struct dfs_cache_tgt_iterator *it);
-int dfs_cache_get_tgt_referral(const char *path, const struct dfs_cache_tgt_iterator *it,
-			       struct dfs_info3_param *ref);
-int dfs_cache_get_tgt_share(char *path, const struct dfs_cache_tgt_iterator *it, char **share,
-			    char **prefix);
-char *dfs_cache_canonical_path(const char *path, const struct nls_table *cp, int remap);
-int dfs_cache_remount_fs(struct cifs_sb_info *cifs_sb);
-void dfs_cache_refresh(struct work_struct *work);
-
 static inline struct dfs_cache_tgt_iterator *
 dfs_cache_get_next_tgt(struct dfs_cache_tgt_list *tl,
 		       struct dfs_cache_tgt_iterator *it)
fs/smb/client/dns_resolve.h +0 -3
index 0dc706f2c422..69dc80533714 100644
@@ -17,9 +17,6 @@
 
 #ifdef __KERNEL__
 
-int dns_resolve_name(const char *dom, const char *name,
-		     size_t namelen, struct sockaddr *ip_addr);
-
 static inline int dns_resolve_unc(const char *dom, const char *unc,
 				  struct sockaddr *ip_addr)
 {
fs/smb/client/fs_context.h +0 -9
index b0fec6b9a23b..6e1a14e98b57 100644
@@ -359,26 +359,17 @@ static inline enum cifs_symlink_type cifs_symlink_type(struct cifs_sb_info *cifs
 	return CIFS_SYMLINK_TYPE_NONE;
 }
 
-extern int smb3_init_fs_context(struct fs_context *fc);
-extern void smb3_cleanup_fs_context_contents(struct smb3_fs_context *ctx);
-extern void smb3_cleanup_fs_context(struct smb3_fs_context *ctx);
-
 static inline struct smb3_fs_context *smb3_fc2context(const struct fs_context *fc)
 {
 	return fc->fs_private;
 }
 
-extern int smb3_fs_context_dup(struct smb3_fs_context *new_ctx, struct smb3_fs_context *ctx);
-extern int smb3_sync_session_ctx_passwords(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses);
-extern void smb3_update_mnt_flags(struct cifs_sb_info *cifs_sb);
-
 /*
  * max deferred close timeout (jiffies) - 2^30
  */
 #define SMB3_MAX_DCLOSETIMEO (1 << 30)
 #define SMB3_DEF_DCLOSETIMEO (1 * HZ) /* even 1 sec enough to help eg open/write/close/open/read */
 #define MAX_CACHED_FIDS 16
-extern char *cifs_sanitize_prepath(char *prepath, gfp_t gfp);
 
 extern struct mutex cifs_mount_mutex;
 
fs/smb/client/fscache.h +8 -7
index 162865381dac..54b64f0f45da 100644
@@ -35,13 +35,15 @@ struct cifs_fscache_inode_coherency_data {
 
 #ifdef CONFIG_CIFS_FSCACHE
 
-/* PROTOTYPES */
-extern int cifs_fscache_get_super_cookie(struct cifs_tcon *);
-extern void cifs_fscache_release_super_cookie(struct cifs_tcon *);
 
-extern void cifs_fscache_get_inode_cookie(struct inode *inode);
-extern void cifs_fscache_release_inode_cookie(struct inode *);
-extern void cifs_fscache_unuse_inode_cookie(struct inode *inode, bool update);
+/*
+ * fscache.c
+ */
+int cifs_fscache_get_super_cookie(struct cifs_tcon *tcon);
+void cifs_fscache_release_super_cookie(struct cifs_tcon *tcon);
+void cifs_fscache_get_inode_cookie(struct inode *inode);
+void cifs_fscache_unuse_inode_cookie(struct inode *inode, bool update);
+void cifs_fscache_release_inode_cookie(struct inode *inode);
 
 static inline
 void cifs_fscache_fill_coherency(struct inode *inode,
@@ -57,7 +59,6 @@ void cifs_fscache_fill_coherency(struct inode *inode,
 	cd->last_change_time_nsec = cpu_to_le32(ctime.tv_nsec);
 }
 
-
 static inline struct fscache_cookie *cifs_inode_cookie(struct inode *inode)
 {
 	return netfs_i_cookie(&CIFS_I(inode)->netfs);
fs/smb/client/netlink.h +0 -3
index e2fa8ed24c54..152a53997558 100644
@@ -10,7 +10,4 @@
 
 extern struct genl_family cifs_genl_family;
 
-extern int cifs_genl_init(void);
-extern void cifs_genl_exit(void);
-
 #endif /* _CIFS_NETLINK_H */
fs/smb/client/nterr.h +0 -2
index 180602c22355..104cf2c2179b 100644
@@ -10,8 +10,6 @@
 
 */
 
-
-
 #ifndef _NTERR_H
 #define _NTERR_H
 
fs/smb/client/ntlmssp.h +0 -13
index 875de43b72de..be3825e26815 100644
@@ -142,16 +142,3 @@ typedef struct _AUTHENTICATE_MESSAGE {
  * Size of the session key (crypto key encrypted with the password
  */
 
-int decode_ntlmssp_challenge(char *bcc_ptr, int blob_len, struct cifs_ses *ses);
-int build_ntlmssp_negotiate_blob(unsigned char **pbuffer, u16 *buflen,
-				 struct cifs_ses *ses,
-				 struct TCP_Server_Info *server,
-				 const struct nls_table *nls_cp);
-int build_ntlmssp_smb3_negotiate_blob(unsigned char **pbuffer, u16 *buflen,
-				 struct cifs_ses *ses,
-				 struct TCP_Server_Info *server,
-				 const struct nls_table *nls_cp);
-int build_ntlmssp_auth_blob(unsigned char **pbuffer, u16 *buflen,
-			struct cifs_ses *ses,
-			struct TCP_Server_Info *server,
-			const struct nls_table *nls_cp);
fs/smb/client/reparse.h +0 -11
index 66269c10beba..4465c6cc93eb 100644
@@ -126,15 +126,4 @@ static inline bool cifs_open_data_reparse(struct cifs_open_info_data *data)
 	return ret;
 }
 
-bool cifs_reparse_point_to_fattr(struct cifs_sb_info *cifs_sb,
-				 struct cifs_fattr *fattr,
-				 struct cifs_open_info_data *data);
-int create_reparse_symlink(const unsigned int xid, struct inode *inode,
-				struct dentry *dentry, struct cifs_tcon *tcon,
-				const char *full_path, const char *symname);
-int mknod_reparse(unsigned int xid, struct inode *inode,
-		       struct dentry *dentry, struct cifs_tcon *tcon,
-		       const char *full_path, umode_t mode, dev_t dev);
-struct reparse_data_buffer *smb2_get_reparse_point_buffer(const struct kvec *rsp_iov, u32 *len);
-
 #endif /* _CIFS_REPARSE_H */
fs/smb/client/smb1proto.h +211 -1

217 lines not on this page · raw message

fs/smb/client/smb2pdu.h +0 -2
index 3c09a58dfd07..ebde8938e226 100644
@@ -133,7 +133,6 @@ struct share_redirect_error_context_rsp {
 #define SMB2_LEASE_HANDLE_CACHING_HE	0x02
 #define SMB2_LEASE_WRITE_CACHING_HE	0x04
 
-
 /* See MS-SMB2 2.2.13.2.11 */
 /* Flags */
 #define SMB2_DHANDLE_FLAG_PERSISTENT	0x00000002
@@ -193,7 +192,6 @@ struct crt_sd_ctxt {
 	struct smb3_sd sd;
 } __packed;
 
-
 #define COPY_CHUNK_RES_KEY_SIZE	24
 struct resume_key_req {
 	char ResumeKey[COPY_CHUNK_RES_KEY_SIZE];
fs/smb/client/smb2proto.h +265 -268

565 lines not on this page · raw message

fs/smb/client/smbdirect.h +15 -12
index e190cb96486f..6ed6d293824a 100644
@@ -114,18 +114,11 @@ struct smbd_connection {
 };
 
 /* Create a SMBDirect session */
-struct smbd_connection *smbd_get_connection(
-	struct TCP_Server_Info *server, struct sockaddr *dstaddr);
 
 /* Reconnect SMBDirect session */
-int smbd_reconnect(struct TCP_Server_Info *server);
 /* Destroy SMBDirect session */
-void smbd_destroy(struct TCP_Server_Info *server);
 
 /* Interface for carrying upper layer I/O through send/recv */
-int smbd_recv(struct smbd_connection *info, struct msghdr *msg);
-int smbd_send(struct TCP_Server_Info *server,
-	int num_rqst, struct smb_rqst *rqst);
 
 enum mr_state {
 	MR_READY,
@@ -151,12 +144,22 @@ struct smbd_mr {
 };
 
 /* Interfaces to register and deregister MR for RDMA read/write */
-struct smbd_mr *smbd_register_mr(
-	struct smbd_connection *info, struct iov_iter *iter,
-	bool writing, bool need_invalidate);
-int smbd_deregister_mr(struct smbd_mr *mr);
 
-/* PROTOTYPES */
+
+/*
+ * smbdirect.c
+ */
+void smbd_destroy(struct TCP_Server_Info *server);
+int smbd_reconnect(struct TCP_Server_Info *server);
+struct smbd_connection *smbd_get_connection(
+	struct TCP_Server_Info *server, struct sockaddr *dstaddr);
+int smbd_recv(struct smbd_connection *info, struct msghdr *msg);
+int smbd_send(struct TCP_Server_Info *server,
+	int num_rqst, struct smb_rqst *rqst_array);
+struct smbd_mr *smbd_register_mr(struct smbd_connection *info,
+				 struct iov_iter *iter,
+				 bool writing, bool need_invalidate);
+int smbd_deregister_mr(struct smbd_mr *smbdirect_mr);
 
 #else
 #define cifs_rdma_enabled(server)	0
#4 lore raw

Re: [RFC PATCH 2/2] cifs: Clean up declarations

kernel test robot noticed the following build errors:

Hi David,

[This is a private test report for your RFC patch.] kernel test robot noticed the following build errors:

[auto build test ERROR on cifs/for-next]
[also build test ERROR on linus/master v6.17-rc4 next-20250905] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/David-Howells/cifs-Do-some-preparation-prior-to-organising-the-function-declarations/20250905-052128
base:   git://git.samba.org/sfrench/cifs-2.6.git for-next
patch link:    https://lore.kernel.org/r/20250904211839.1152340-3-dhowells%40redhat.com
patch subject: [RFC PATCH 2/2] cifs: Clean up declarations
config: sh-randconfig-001-20250906 (https://download.01.org/0day-ci/archive/20250907/[email protected]/config)
compiler: sh4-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250907/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All error/warnings (new ones prefixed by >>):

In file included from fs/smb/client/smb2inode.c:18:

>> fs/smb/client/cifsproto.h:204:27: warning: 'struct dfs_cache_tgt_list' declared inside parameter list will not be visible outside of this definition or declaration
     204 |                    struct dfs_cache_tgt_list *tgt_list);
         |                           ^~~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:206:33: warning: 'struct dfs_cache_tgt_list' declared inside parameter list will not be visible outside of this definition or declaration
     206 |                          struct dfs_cache_tgt_list *tgt_list);
         |                                 ^~~~~~~~~~~~~~~~~~
>> fs/smb/client/cifsproto.h:207:68: warning: 'struct dfs_cache_tgt_iterator' declared inside parameter list will not be visible outside of this definition or declaration
     207 | void dfs_cache_noreq_update_tgthint(const char *path, const struct dfs_cache_tgt_iterator *it);
         |                                                                    ^~~~~~~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:208:63: warning: 'struct dfs_cache_tgt_iterator' declared inside parameter list will not be visible outside of this definition or declaration
     208 | int dfs_cache_get_tgt_referral(const char *path, const struct dfs_cache_tgt_iterator *it,
         |                                                               ^~~~~~~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:210:54: warning: 'struct dfs_cache_tgt_iterator' declared inside parameter list will not be visible outside of this definition or declaration
     210 | int dfs_cache_get_tgt_share(char *path, const struct dfs_cache_tgt_iterator *it, char **share,
         |                                                      ^~~~~~~~~~~~~~~~~~~~~~
>> fs/smb/client/cifsproto.h:675:19: error: static declaration of 'cifs_inval_name_dfs_link_error' follows non-static declaration

675 | static inline int cifs_inval_name_dfs_link_error(const unsigned int xid,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/smb/client/cifsproto.h:451:5: note: previous declaration of 'cifs_inval_name_dfs_link_error' with type 'int(const unsigned int, struct cifs_tcon *, struct cifs_sb_info *, const char *, bool *)' {aka 'int(const unsigned int, struct cifs_tcon *, struct cifs_sb_info *, const char *, _Bool *)'}
451 | int cifs_inval_name_dfs_link_error(const unsigned int xid,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
| ^~~~~~~~~~
fs/smb/client/cifsproto.h:68:41: warning: 'struct TCP_Server_Info' declared inside parameter list will not be visible outside of this definition or declaration

      68 | void cifs_dump_detail(void *buf, struct TCP_Server_Info *server);
         |                                         ^~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:69:28: warning: 'struct TCP_Server_Info' declared inside parameter list will not be visible outside of this definition or declaration
      69 | void cifs_dump_mids(struct TCP_Server_Info *server);
         |                            ^~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:80:34: warning: 'struct shash_desc' declared inside parameter list will not be visible outside of this definition or declaration
      80 |                           struct shash_desc *shash);
         |                                  ^~~~~~~~~~
   fs/smb/client/cifsproto.h:79:34: warning: 'struct TCP_Server_Info' declared inside parameter list will not be visible outside of this definition or declaration
      79 |                           struct TCP_Server_Info *server, char *signature,
         |                                  ^~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:81:50: warning: 'struct TCP_Server_Info' declared inside parameter list will not be visible outside of this definition or declaration
      81 | int cifs_sign_rqst(struct smb_rqst *rqst, struct TCP_Server_Info *server,
         |                                                  ^~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:83:56: warning: 'struct TCP_Server_Info' declared inside parameter list will not be visible outside of this definition or declaration
      83 | int cifs_sign_smbv(struct kvec *iov, int n_vec, struct TCP_Server_Info *server,
         |                                                        ^~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:85:52: warning: 'struct TCP_Server_Info' declared inside parameter list will not be visible outside of this definition or declaration
      85 | int cifs_sign_smb(struct smb_hdr *cifs_pdu, struct TCP_Server_Info *server,
         |                                                    ^~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:88:34: warning: 'struct TCP_Server_Info' declared inside parameter list will not be visible outside of this definition or declaration
      88 |                           struct TCP_Server_Info *server,
         |                                  ^~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:90:29: warning: 'struct cifs_ses' declared inside parameter list will not be visible outside of this definition or declaration
      90 | int setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp);
         |                             ^~~~~~~~
   fs/smb/client/cifsproto.h:91:24: warning: 'struct cifs_ses' declared inside parameter list will not be visible outside of this definition or declaration
      91 | int calc_seckey(struct cifs_ses *ses);
         |                        ^~~~~~~~
   fs/smb/client/cifsproto.h:92:41: warning: 'struct TCP_Server_Info' declared inside parameter list will not be visible outside of this definition or declaration
      92 | void cifs_crypto_secmech_release(struct TCP_Server_Info *server);
         |                                         ^~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:117:28: warning: 'struct TCP_Server_Info' declared inside parameter list will not be visible outside of this definition or declaration
     117 |                     struct TCP_Server_Info *server);
         |                            ^~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:116:40: warning: 'struct cifs_ses' declared inside parameter list will not be visible outside of this definition or declaration
     116 | struct key *cifs_get_spnego_key(struct cifs_ses *sesInfo,
         |                                        ^~~~~~~~
   fs/smb/client/cifsproto.h:142:45: warning: 'struct TCP_Server_Info' declared inside parameter list will not be visible outside of this definition or declaration
     142 | void cifs_signal_cifsd_for_reconnect(struct TCP_Server_Info *server,
         |                                             ^~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:144:51: warning: 'struct TCP_Server_Info' declared inside parameter list will not be visible outside of this definition or declaration
     144 | void cifs_mark_tcp_ses_conns_for_reconnect(struct TCP_Server_Info *server,
         |                                                   ^~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:146:27: warning: 'struct TCP_Server_Info' declared inside parameter list will not be visible outside of this definition or declaration
     146 | int cifs_reconnect(struct TCP_Server_Info *server, bool mark_smb_session);
         |                           ^~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:147:34: warning: 'struct TCP_Server_Info' declared inside parameter list will not be visible outside of this definition or declaration
     147 | int cifs_read_from_socket(struct TCP_Server_Info *server, char *buf,
         |                                  ^~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:149:41: warning: 'struct TCP_Server_Info' declared inside parameter list will not be visible outside of this definition or declaration
     149 | ssize_t cifs_discard_from_socket(struct TCP_Server_Info *server, size_t to_read);
         |                                         ^~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:150:39: warning: 'struct TCP_Server_Info' declared inside parameter list will not be visible outside of this definition or declaration
     150 | int cifs_read_iter_from_socket(struct TCP_Server_Info *server, struct iov_iter *iter,
         |                                       ^~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:152:25: warning: 'struct mid_q_entry' declared inside parameter list will not be visible outside of this definition or declaration
     152 | void dequeue_mid(struct mid_q_entry *mid, bool malformed);
         |                         ^~~~~~~~~~~
   fs/smb/client/cifsproto.h:153:32: warning: 'struct TCP_Server_Info' declared inside parameter list will not be visible outside of this definition or declaration
     153 | int cifs_enable_signing(struct TCP_Server_Info *server, bool mnt_sign_required);
         |                                ^~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:154:65: warning: 'struct mid_q_entry' declared inside parameter list will not be visible outside of this definition or declaration
     154 | int cifs_handle_standard(struct TCP_Server_Info *server, struct mid_q_entry *mid);
         |                                                                 ^~~~~~~~~~~
   fs/smb/client/cifsproto.h:154:33: warning: 'struct TCP_Server_Info' declared inside parameter list will not be visible outside of this definition or declaration
     154 | int cifs_handle_standard(struct TCP_Server_Info *server, struct mid_q_entry *mid);
         |                                 ^~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:161:32: warning: 'struct cifs_ses' declared inside parameter list will not be visible outside of this definition or declaration
     161 | void __cifs_put_smb_ses(struct cifs_ses *ses);
         |                                ^~~~~~~~
   fs/smb/client/cifsproto.h:163:27: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     163 | void cifs_put_tcon(struct cifs_tcon *tcon, enum smb3_tcon_ref_trace trace);
         |                           ^~~~~~~~~
   fs/smb/client/cifsproto.h:166:52: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     166 | void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *tcon,
         |                                                    ^~~~~~~~~
   fs/smb/client/cifsproto.h:169:34: warning: 'struct cifs_mount_ctx' declared inside parameter list will not be visible outside of this definition or declaration
     169 | void cifs_mount_put_conns(struct cifs_mount_ctx *mnt_ctx);
         |                                  ^~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:170:35: warning: 'struct cifs_mount_ctx' declared inside parameter list will not be visible outside of this definition or declaration
     170 | int cifs_mount_get_session(struct cifs_mount_ctx *mnt_ctx);
         |                                   ^~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:171:32: warning: 'struct cifs_mount_ctx' declared inside parameter list will not be visible outside of this definition or declaration
     171 | int cifs_mount_get_tcon(struct cifs_mount_ctx *mnt_ctx);
         |                                ^~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:172:32: warning: 'struct cifs_mount_ctx' declared inside parameter list will not be visible outside of this definition or declaration
     172 | int cifs_is_path_remote(struct cifs_mount_ctx *mnt_ctx);
         |                                ^~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:176:35: warning: 'struct cifs_tcon' declared inside parameter list will not be visible outside of this definition or declaration
     176 |          const char *tree, struct cifs_tcon *tcon,
         |                                   ^~~~~~~~~
   fs/smb/client/cifsproto.h:191:67: warning: 'struct dfs_info3_param' declared inside parameter list will not be visible outside of this definition or declaration
     191 | int dfs_parse_target_referral(const char *full_path, const struct dfs_info3_param *ref,
         |                                                                   ^~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:193:28: warning: 'struct cifs_mount_ctx' declared inside parameter list will not be visible outside of this definition or declaration
     193 | int dfs_mount_share(struct cifs_mount_ctx *mnt_ctx);
         |                            ^~~~~~~~~~~~~~
>> fs/smb/client/cifsproto.h:204:27: warning: 'struct dfs_cache_tgt_list' declared inside parameter list will not be visible outside of this definition or declaration
     204 |                    struct dfs_cache_tgt_list *tgt_list);
         |                           ^~~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:203:56: warning: 'struct dfs_info3_param' declared inside parameter list will not be visible outside of this definition or declaration
     203 |                    int remap, const char *path, struct dfs_info3_param *ref,
         |                                                        ^~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:206:33: warning: 'struct dfs_cache_tgt_list' declared inside parameter list will not be visible outside of this definition or declaration
     206 |                          struct dfs_cache_tgt_list *tgt_list);
         |                                 ^~~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:205:51: warning: 'struct dfs_info3_param' declared inside parameter list will not be visible outside of this definition or declaration
     205 | int dfs_cache_noreq_find(const char *path, struct dfs_info3_param *ref,
         |                                                   ^~~~~~~~~~~~~~~
>> fs/smb/client/cifsproto.h:207:68: warning: 'struct dfs_cache_tgt_iterator' declared inside parameter list will not be visible outside of this definition or declaration
     207 | void dfs_cache_noreq_update_tgthint(const char *path, const struct dfs_cache_tgt_iterator *it);
         |                                                                    ^~~~~~~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:209:39: warning: 'struct dfs_info3_param' declared inside parameter list will not be visible outside of this definition or declaration
     209 |                                struct dfs_info3_param *ref);
         |                                       ^~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:208:63: warning: 'struct dfs_cache_tgt_iterator' declared inside parameter list will not be visible outside of this definition or declaration
     208 | int dfs_cache_get_tgt_referral(const char *path, const struct dfs_cache_tgt_iterator *it,
         |                                                               ^~~~~~~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:210:54: warning: 'struct dfs_cache_tgt_iterator' declared inside parameter list will not be visible outside of this definition or declaration
     210 | int dfs_cache_get_tgt_share(char *path, const struct dfs_cache_tgt_iterator *it, char **share,
         |                                                      ^~~~~~~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:250:47: warning: 'struct cifs_fid' declared inside parameter list will not be visible outside of this definition or declaration
     250 | struct cifsFileInfo *cifs_new_fileinfo(struct cifs_fid *fid, struct file *file,
         |                                               ^~~~~~~~
   fs/smb/client/cifsproto.h:263:35: warning: 'struct cifsLockInfo' declared inside parameter list will not be visible outside of this definition or declaration
     263 | void cifs_del_lock_waiters(struct cifsLockInfo *lock);
         |                                   ^~~~~~~~~~~~
   fs/smb/client/cifsproto.h:266:32: warning: 'struct cifsLockInfo' declared inside parameter list will not be visible outside of this definition or declaration
     266 |                         struct cifsLockInfo **conf_lock, int rw_check);
         |                                ^~~~~~~~~~~~
   fs/smb/client/cifsproto.h:276:46: warning: 'struct cifs_io_subrequest' declared inside parameter list will not be visible outside of this definition or declaration
     276 | void cifs_write_subrequest_terminated(struct cifs_io_subrequest *wdata, ssize_t result);
         |                                              ^~~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:277:48: warning: 'struct cifsInodeInfo' declared inside parameter list will not be visible outside of this definition or declaration
     277 | struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode,
         |                                                ^~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:279:35: warning: 'struct cifsInodeInfo' declared inside parameter list will not be visible outside of this definition or declaration
     279 | int cifs_get_writable_file(struct cifsInodeInfo *cifs_inode, int flags,
         |                                   ^~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:281:48: warning: 'struct cifsInodeInfo' declared inside parameter list will not be visible outside of this definition or declaration
     281 | struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode, int flags);
         |                                                ^~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:297:36: warning: 'struct cifsInodeInfo' declared inside parameter list will not be visible outside of this definition or declaration
     297 | bool is_size_safe_to_change(struct cifsInodeInfo *cifsInode, __u64 end_of_file,
         |                                    ^~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:318:53: warning: 'struct cifs_fattr' declared inside parameter list will not be visible outside of this definition or declaration
     318 | int cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr,
         |                                                     ^~~~~~~~~~
   fs/smb/client/cifsproto.h:320:56: warning: 'struct cifs_fattr' declared inside parameter list will not be visible outside of this definition or declaration
     320 | void cifs_fill_uniqueid(struct super_block *sb, struct cifs_fattr *fattr);
         |                                                        ^~~~~~~~~~
   fs/smb/client/cifsproto.h:321:38: warning: 'struct cifs_fattr' declared inside parameter list will not be visible outside of this definition or declaration
     321 | void cifs_unix_basic_to_fattr(struct cifs_fattr *fattr, FILE_UNIX_BASIC_INFO *info,
         |                                      ^~~~~~~~~~
   fs/smb/client/cifsproto.h:334:38: warning: 'struct cifs_fid' declared inside parameter list will not be visible outside of this definition or declaration
     334 |                         const struct cifs_fid *fid);
         |                                      ^~~~~~~~
   fs/smb/client/cifsproto.h:332:32: warning: 'struct cifs_open_info_data' declared inside parameter list will not be visible outside of this definition or declaration
     332 |                         struct cifs_open_info_data *data,
         |                                ^~~~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:337:40: warning: 'struct cifs_open_info_data' declared inside parameter list will not be visible outside of this definition or declaration
     337 |                                 struct cifs_open_info_data *data,
         |                                        ^~~~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:340:56: warning: 'struct cifs_fattr' declared inside parameter list will not be visible outside of this definition or declaration
     340 | struct inode *cifs_iget(struct super_block *sb, struct cifs_fattr *fattr);
         |                                                        ^~~~~~~~~~
   fs/smb/client/cifsproto.h:375:38: warning: 'struct cifs_fattr' declared inside parameter list will not be visible outside of this definition or declaration
     375 | bool couldbe_mf_symlink(const struct cifs_fattr *fattr);
         |                                      ^~~~~~~~~~
   fs/smb/client/cifsproto.h:377:55: warning: 'struct cifs_fattr' declared inside parameter list will not be visible outside of this definition or declaration
     377 |                  struct cifs_sb_info *cifs_sb, struct cifs_fattr *fattr,
         |                                                       ^~~~~~~~~~
   fs/smb/client/cifsproto.h:417:35: warning: 'struct cifsInodeInfo' declared inside parameter list will not be visible outside of this definition or declaration
     417 | void cifs_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock);
         |                                   ^~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:418:28: warning: 'struct cifsInodeInfo' declared inside parameter list will not be visible outside of this definition or declaration
     418 | int cifs_get_writer(struct cifsInodeInfo *cinode);
         |                            ^~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:419:29: warning: 'struct cifsInodeInfo' declared inside parameter list will not be visible outside of this definition or declaration
     419 | void cifs_put_writer(struct cifsInodeInfo *cinode);
         |                             ^~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:421:36: warning: 'struct cifsInodeInfo' declared inside parameter list will not be visible outside of this definition or declaration
     421 | void cifs_done_oplock_break(struct cifsInodeInfo *cinode);
         |                                    ^~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:423:35: warning: 'struct cifs_pending_open' declared inside parameter list will not be visible outside of this definition or declaration
     423 | void cifs_del_pending_open(struct cifs_pending_open *open);
         |                                   ^~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:425:37: warning: 'struct cifs_pending_open' declared inside parameter list will not be visible outside of this definition or declaration
     425 |                              struct cifs_pending_open *open);
         |                                     ^~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:424:42: warning: 'struct cifs_fid' declared inside parameter list will not be visible outside of this definition or declaration
     424 | void cifs_add_pending_open_locked(struct cifs_fid *fid, struct tcon_link *tlink,
         |                                          ^~~~~~~~
   fs/smb/client/cifsproto.h:427:30: warning: 'struct cifs_pending_open' declared inside parameter list will not be visible outside of this definition or declaration
     427 |                       struct cifs_pending_open *open);
         |                              ^~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:426:35: warning: 'struct cifs_fid' declared inside parameter list will not be visible outside of this definition or declaration
     426 | void cifs_add_pending_open(struct cifs_fid *fid, struct tcon_link *tlink,
         |                                   ^~~~~~~~
   fs/smb/client/cifsproto.h:428:64: warning: 'struct cifs_deferred_close' declared inside parameter list will not be visible outside of this definition or declaration
     428 | bool cifs_is_deferred_close(struct cifsFileInfo *cfile, struct cifs_deferred_close **pdclose);
         |                                                                ^~~~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:429:65: warning: 'struct cifs_deferred_close' declared inside parameter list will not be visible outside of this definition or declaration
     429 | void cifs_add_deferred_close(struct cifsFileInfo *cfile, struct cifs_deferred_close *dclose);
         |                                                                 ^~~~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:431:38: warning: 'struct cifsInodeInfo' declared inside parameter list will not be visible outside of this definition or declaration
     431 | void cifs_close_deferred_file(struct cifsInodeInfo *cifs_inode);
         |                                      ^~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:438:28: warning: 'struct dfs_info3_param' declared inside parameter list will not be visible outside of this definition or declaration
     438 |                     struct dfs_info3_param **target_nodes,
         |                            ^~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:441:46: warning: 'struct shash_desc' declared inside parameter list will not be visible outside of this definition or declaration
     441 | int cifs_alloc_hash(const char *name, struct shash_desc **sdesc);
         |                                              ^~~~~~~~~~
   fs/smb/client/cifsproto.h:442:28: warning: 'struct shash_desc' declared inside parameter list will not be visible outside of this definition or declaration
     442 | void cifs_free_hash(struct shash_desc **sdesc);
         |                            ^~~~~~~~~~
   fs/smb/client/cifsproto.h:477:36: warning: 'struct mid_q_entry' declared inside parameter list will not be visible outside of this definition or declaration
     477 | int map_and_check_smb_error(struct mid_q_entry *mid, bool logErr);
         |                                    ^~~~~~~~~~~
   fs/smb/client/cifsproto.h:486:36: warning: 'struct cifs_fattr' declared inside parameter list will not be visible outside of this definition or declaration
     486 | void cifs_dir_info_to_fattr(struct cifs_fattr *fattr, FILE_DIRECTORY_INFO *info,
         |                                    ^~~~~~~~~~
   fs/smb/client/cifsproto.h:506:32: warning: 'struct cifs_open_info_data' declared inside parameter list will not be visible outside of this definition or declaration
     506 |                         struct cifs_open_info_data *data);
         |                                ^~~~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:503:32: warning: 'struct reparse_data_buffer' declared inside parameter list will not be visible outside of this definition or declaration
     503 | int parse_reparse_point(struct reparse_data_buffer *buf,
         |                                ^~~~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:511:41: warning: 'struct cifs_open_info_data' declared inside parameter list will not be visible outside of this definition or declaration
     511 |                                  struct cifs_open_info_data *data);
         |                                         ^~~~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:510:41: warning: 'struct cifs_fattr' declared inside parameter list will not be visible outside of this definition or declaration
     510 |                                  struct cifs_fattr *fattr,
         |                                         ^~~~~~~~~~
   fs/smb/client/cifsproto.h:516:54: warning: 'struct cifs_server_iface' declared inside parameter list will not be visible outside of this definition or declaration
     516 | bool is_ses_using_iface(struct cifs_ses *ses, struct cifs_server_iface *iface);
         |                                                      ^~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:565:31: warning: 'struct mid_q_entry' declared inside parameter list will not be visible outside of this definition or declaration
     565 | void cifs_wake_up_task(struct mid_q_entry *mid);
         |                               ^~~~~~~~~~~
   fs/smb/client/cifsproto.h:567:24: warning: 'struct mid_q_entry' declared inside parameter list will not be visible outside of this definition or declaration
     567 | void delete_mid(struct mid_q_entry *mid);
         |                        ^~~~~~~~~~~
   fs/smb/client/cifsproto.h:576:43: warning: 'struct cifs_credits' declared inside parameter list will not be visible outside of this definition or declaration
     576 |                       size_t *num, struct cifs_credits *credits);
         |                                           ^~~~~~~~~~~~
   fs/smb/client/cifsproto.h:577:62: warning: 'struct mid_q_entry' declared inside parameter list will not be visible outside of this definition or declaration
     577 | int wait_for_response(struct TCP_Server_Info *server, struct mid_q_entry *midQ);
         |                                                              ^~~~~~~~~~~
   fs/smb/client/cifsproto.h:579:17: error: unknown type name 'mid_receive_t'
     579 |                 mid_receive_t *receive, mid_callback_t *callback,
         |                 ^~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:579:41: error: unknown type name 'mid_callback_t'; did you mean 'bpf_callback_t'?
     579 |                 mid_receive_t *receive, mid_callback_t *callback,
         |                                         ^~~~~~~~~~~~~~
         |                                         bpf_callback_t
   fs/smb/client/cifsproto.h:580:17: error: unknown type name 'mid_handle_t'; did you mean 'irq_handler_t'?
     580 |                 mid_handle_t *handle, void *cbdata, const int flags,
         |                 ^~~~~~~~~~~~
         |                 irq_handler_t
   fs/smb/client/cifsproto.h:582:33: warning: 'struct mid_q_entry' declared inside parameter list will not be visible outside of this definition or declaration
     582 | int cifs_sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server);
         |                                 ^~~~~~~~~~~
   fs/smb/client/cifsproto.h:593:63: warning: 'struct mid_q_entry' declared inside parameter list will not be visible outside of this definition or declaration
     593 | int cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid);
         |                                                               ^~~~~~~~~~~
   fs/smb/client/cifsproto.h:645:20: warning: 'struct mid_q_entry' declared inside parameter list will not be visible outside of this definition or declaration
     645 |             struct mid_q_entry *mid)
         |                    ^~~~~~~~~~~
   fs/smb/client/cifsproto.h: In function 'send_cancel':
   fs/smb/client/cifsproto.h:647:22: error: invalid use of undefined type 'struct TCP_Server_Info'
     647 |         return server->ops->send_cancel ?
         |                      ^~
   fs/smb/client/cifsproto.h:648:39: error: invalid use of undefined type 'struct TCP_Server_Info'
     648 |                                 server->ops->send_cancel(server, rqst, mid) : 0;
         |                                       ^~
   fs/smb/client/cifsproto.h: At top level:
>> fs/smb/client/cifsproto.h:675:19: error: static declaration of 'cifs_inval_name_dfs_link_error' follows non-static declaration
     675 | static inline int cifs_inval_name_dfs_link_error(const unsigned int xid,
         |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h:451:5: note: previous declaration of 'cifs_inval_name_dfs_link_error' with type 'int(const unsigned int,  struct cifs_tcon *, struct cifs_sb_info *, const char *, bool *)' {aka 'int(const unsigned int,  struct cifs_tcon *, struct cifs_sb_info *, const char *, _Bool *)'}
     451 | int cifs_inval_name_dfs_link_error(const unsigned int xid,
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h: In function 'cifs_put_smb_ses':
>> fs/smb/client/cifsproto.h:696:28: error: passing argument 1 of '__cifs_put_smb_ses' from incompatible pointer type [-Wincompatible-pointer-types]
     696 |         __cifs_put_smb_ses(ses);
         |                            ^~~
         |                            |
         |                            struct cifs_ses *
   fs/smb/client/cifsproto.h:161:42: note: expected 'struct cifs_ses *' but argument is of type 'struct cifs_ses *'
     161 | void __cifs_put_smb_ses(struct cifs_ses *ses);
         |                         ~~~~~~~~~~~~~~~~~^~~
   In file included from include/linux/spinlock.h:63,
                    from include/linux/wait.h:9,
                    from include/linux/wait_bit.h:8,
                    from include/linux/fs.h:7,
                    from fs/smb/client/cifs_unicode.c:7:
   fs/smb/client/cifsproto.h: In function 'cifs_smb_ses_inc_refcount':
   fs/smb/client/cifsproto.h:709:30: error: 'cifs_tcp_ses_lock' undeclared (first use in this function); did you mean 'cifs_posix_lock'?
     709 |         lockdep_assert_held(&cifs_tcp_ses_lock);
         |                              ^~~~~~~~~~~~~~~~~
   include/linux/lockdep.h:392:61: note: in definition of macro 'lockdep_assert_held'
     392 | #define lockdep_assert_held(l)                  do { (void)(l); } while (0)
         |                                                             ^
   fs/smb/client/cifsproto.h:709:30: note: each undeclared identifier is reported only once for each function it appears in
     709 |         lockdep_assert_held(&cifs_tcp_ses_lock);
         |                              ^~~~~~~~~~~~~~~~~
   include/linux/lockdep.h:392:61: note: in definition of macro 'lockdep_assert_held'
     392 | #define lockdep_assert_held(l)                  do { (void)(l); } while (0)
         |                                                             ^
   fs/smb/client/cifsproto.h:710:12: error: invalid use of undefined type 'struct cifs_ses'
     710 |         ses->ses_count++;
         |            ^~
   fs/smb/client/cifsproto.h: At top level:
   fs/smb/client/cifsproto.h:727:39: warning: 'struct mid_q_entry' declared inside parameter list will not be visible outside of this definition or declaration
     727 | static inline void release_mid(struct mid_q_entry *mid)
         |                                       ^~~~~~~~~~~
   fs/smb/client/cifsproto.h: In function 'release_mid':
   fs/smb/client/cifsproto.h:729:22: error: invalid use of undefined type 'struct mid_q_entry'
     729 |         kref_put(&mid->refcount, __release_mid);
         |                      ^~
   fs/smb/client/cifsproto.h: At top level:
   fs/smb/client/cifsproto.h:732:47: warning: 'struct cifs_open_info_data' declared inside parameter list will not be visible outside of this definition or declaration
     732 | static inline void cifs_free_open_info(struct cifs_open_info_data *data)
         |                                               ^~~~~~~~~~~~~~~~~~~
   fs/smb/client/cifsproto.h: In function 'cifs_free_open_info':
   fs/smb/client/cifsproto.h:734:19: error: invalid use of undefined type 'struct cifs_open_info_data'
     734 |         kfree(data->symlink_target);
         |                   ^~
   fs/smb/client/cifsproto.h:735:26: error: invalid use of undefined type 'struct cifs_open_info_data'
     735 |         free_rsp_buf(data->reparse.io.buftype, data->reparse.io.iov.iov_base);
         |                          ^~
   fs/smb/client/cifsproto.h:735:52: error: invalid use of undefined type 'struct cifs_open_info_data'
     735 |         free_rsp_buf(data->reparse.io.buftype, data->reparse.io.iov.iov_base);
         |                                                    ^~
   fs/smb/client/cifsproto.h:736:31: error: invalid application of 'sizeof' to incomplete type 'struct cifs_open_info_data'
     736 |         memset(data, 0, sizeof(*data));
         |                               ^

..

vim +/cifs_inval_name_dfs_link_error +675 fs/smb/client/cifsproto.h

e4af35fa55b0721 fs/cifs/cifsproto.h Paulo Alcantara   2020-05-19  673  
b9ee2e307c6b063 fs/cifs/cifsproto.h Paulo Alcantara   2023-02-28  674  #else
b9ee2e307c6b063 fs/cifs/cifsproto.h Paulo Alcantara   2023-02-28 @675  static inline int cifs_inval_name_dfs_link_error(const unsigned int xid,
a2809d0e16963fd fs/cifs/cifsproto.h Eugene Korenevsky 2022-01-14  676  				   struct cifs_tcon *tcon,
a2809d0e16963fd fs/cifs/cifsproto.h Eugene Korenevsky 2022-01-14  677  				   struct cifs_sb_info *cifs_sb,
b9ee2e307c6b063 fs/cifs/cifsproto.h Paulo Alcantara   2023-02-28  678  				   const char *full_path,
b9ee2e307c6b063 fs/cifs/cifsproto.h Paulo Alcantara   2023-02-28  679  				   bool *islink)
b9ee2e307c6b063 fs/cifs/cifsproto.h Paulo Alcantara   2023-02-28  680  {
b9ee2e307c6b063 fs/cifs/cifsproto.h Paulo Alcantara   2023-02-28  681  	*islink = false;
b9ee2e307c6b063 fs/cifs/cifsproto.h Paulo Alcantara   2023-02-28  682  	return 0;
b9ee2e307c6b063 fs/cifs/cifsproto.h Paulo Alcantara   2023-02-28  683  }
1c780228e9d47b9 fs/cifs/cifsproto.h Paulo Alcantara   2018-11-14  684  #endif
1c780228e9d47b9 fs/cifs/cifsproto.h Paulo Alcantara   2018-11-14  685  
0f060936e490c62 fs/cifs/cifsproto.h Amir Goldstein    2020-02-03  686  static inline int cifs_create_options(struct cifs_sb_info *cifs_sb, int options)
0f060936e490c62 fs/cifs/cifsproto.h Amir Goldstein    2020-02-03  687  {
87f93d82e0952da fs/cifs/cifsproto.h Steve French      2020-02-04  688  	if (cifs_sb && (backup_cred(cifs_sb)))
0f060936e490c62 fs/cifs/cifsproto.h Amir Goldstein    2020-02-03  689  		return options | CREATE_OPEN_BACKUP_INTENT;
0f060936e490c62 fs/cifs/cifsproto.h Amir Goldstein    2020-02-03  690  	else
0f060936e490c62 fs/cifs/cifsproto.h Amir Goldstein    2020-02-03  691  		return options;
0f060936e490c62 fs/cifs/cifsproto.h Amir Goldstein    2020-02-03  692  }
0f060936e490c62 fs/cifs/cifsproto.h Amir Goldstein    2020-02-03  693  
8e3554150d6c80a fs/cifs/cifsproto.h Paulo Alcantara   2023-04-23  694  static inline void cifs_put_smb_ses(struct cifs_ses *ses)
8e3554150d6c80a fs/cifs/cifsproto.h Paulo Alcantara   2023-04-23  695  {
8e3554150d6c80a fs/cifs/cifsproto.h Paulo Alcantara   2023-04-23 @696  	__cifs_put_smb_ses(ses);
8e3554150d6c80a fs/cifs/cifsproto.h Paulo Alcantara   2023-04-23  697  }
8e3554150d6c80a fs/cifs/cifsproto.h Paulo Alcantara   2023-04-23  698  
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#5 lore raw

Re: [RFC PATCH 2/2] cifs: Clean up declarations

In reply to David Howells

Hi David,

can you please drop the changes to smbdirect.h? (This is the only part I really looked at). They leave strange comments around and will likely cause conflicts with my current work.

Most or all functions will go soon anyway.

Thanks!
metze

Quoted 52 lines
fs/smb/client/smbdirect.h +15 -12
index e190cb96486f..6ed6d293824a 100644
@@ -114,18 +114,11 @@ struct smbd_connection {
  };
 
  /* Create a SMBDirect session */
-struct smbd_connection *smbd_get_connection(
-	struct TCP_Server_Info *server, struct sockaddr *dstaddr);
 
  /* Reconnect SMBDirect session */
-int smbd_reconnect(struct TCP_Server_Info *server);
  /* Destroy SMBDirect session */
-void smbd_destroy(struct TCP_Server_Info *server);
 
  /* Interface for carrying upper layer I/O through send/recv */
-int smbd_recv(struct smbd_connection *info, struct msghdr *msg);
-int smbd_send(struct TCP_Server_Info *server,
-	int num_rqst, struct smb_rqst *rqst);
 
  enum mr_state {
  	MR_READY,
@@ -151,12 +144,22 @@ struct smbd_mr {
  };
 
  /* Interfaces to register and deregister MR for RDMA read/write */
-struct smbd_mr *smbd_register_mr(
-	struct smbd_connection *info, struct iov_iter *iter,
-	bool writing, bool need_invalidate);
-int smbd_deregister_mr(struct smbd_mr *mr);
 
-/* PROTOTYPES */
+
+/*
+ * smbdirect.c
+ */
+void smbd_destroy(struct TCP_Server_Info *server);
+int smbd_reconnect(struct TCP_Server_Info *server);
+struct smbd_connection *smbd_get_connection(
+	struct TCP_Server_Info *server, struct sockaddr *dstaddr);
+int smbd_recv(struct smbd_connection *info, struct msghdr *msg);
+int smbd_send(struct TCP_Server_Info *server,
+	int num_rqst, struct smb_rqst *rqst_array);
+struct smbd_mr *smbd_register_mr(struct smbd_connection *info,
+				 struct iov_iter *iter,
+				 bool writing, bool need_invalidate);
+int smbd_deregister_mr(struct smbd_mr *smbdirect_mr);
 
  #else
  #define cifs_rdma_enabled(server)	0
author maintainer
#6 lore raw

Re: [RFC PATCH 2/2] cifs: Clean up declarations

Quoted 4 lines · Stefan Metzmacher

can you please drop the changes to smbdirect.h? (This is the only part I really looked at). They leave strange comments around and will likely cause conflicts with my current work.

Sure... Assuming Steve is willing to take these patches. There's also an issue with one of the configuration combinations I didn't test - it probably just needs a #include adding.

David