All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add support for smb3 alias/fstype in mount.cifs.c
@ 2019-11-13 17:01 Kenneth D'souza
  2019-12-13  0:25 ` Pavel Shilovsky
  0 siblings, 1 reply; 2+ messages in thread
From: Kenneth D'souza @ 2019-11-13 17:01 UTC (permalink / raw)
  To: linux-cifs; +Cc: piastryyy, smfrench, lsahlber

As we will slowly move towards smb3 filesystem,
supporting through "mount -t smb3" is important.

Signed-off-by: Kenneth D'souza <kdsouza@redhat.com>
---
 Makefile.am    |  4 ++++
 mount.cifs.c   |  8 +++++++-
 mount.cifs.rst | 12 +++++++++---
 3 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 8291b99..1af2573 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -111,3 +111,7 @@ CLEANFILES += $(rst_man_pages)
 endif
 
 SUBDIRS = contrib
+
+install-exec-hook:
+	(cd $(ROOTSBINDIR) && ln -sf mount.cifs mount.smb3)
+	(cd $(man8dir) && ln -sf mount.cifs.8 mount.smb3.8)
diff --git a/mount.cifs.c b/mount.cifs.c
index 6935fe1..0ed9d0a 100644
--- a/mount.cifs.c
+++ b/mount.cifs.c
@@ -192,7 +192,7 @@ struct parsed_mount_info {
 };
 
 static const char *thisprogram;
-static const char *cifs_fstype = "cifs";
+static const char *cifs_fstype;
 
 static int parse_unc(const char *unc_name, struct parsed_mount_info *parsed_info);
 
@@ -1986,6 +1986,12 @@ int main(int argc, char **argv)
 	if (thisprogram == NULL)
 		thisprogram = "mount.cifs";
 
+	if(strcmp(thisprogram, "mount.cifs") == 0)
+               cifs_fstype = "cifs";
+
+        if(strcmp(thisprogram, "mount.smb3") == 0)
+              cifs_fstype = "smb3";
+
 	/* allocate parsed_info as shared anonymous memory range */
 	parsed_info = mmap((void *)0, sizeof(*parsed_info), PROT_READ | PROT_WRITE,
 			   MAP_ANONYMOUS | MAP_SHARED, -1, 0);
diff --git a/mount.cifs.rst b/mount.cifs.rst
index ee5086c..67ec629 100644
--- a/mount.cifs.rst
+++ b/mount.cifs.rst
@@ -1,6 +1,6 @@
-==========
-mount.cifs
-==========
+=====================
+mount.cifs mount.smb3
+=====================
 
 --------------------------------------------------
 mount using the Common Internet File System (CIFS)
@@ -23,6 +23,12 @@ protocol and is supported by most Windows servers, Azure (cloud storage),
 Macs and many other commercial servers and Network Attached Storage
 appliances as well as by the popular Open Source server Samba.
 
+``mount.smb3`` mounts only SMB3 filesystem. It is usually invoked
+indirectly by the mount(8) command when using the "-t smb3" option.
+The ``smb3`` filesystem type was added in kernel-4.18 and above.
+It works in a similar fashion as mount.cifs except it passes filesystem
+type as smb3.
+
 The mount.cifs utility attaches the UNC name (exported network
 resource) specified as service (using ``//server/share`` syntax, where
 "server" is the server name or IP address and "share" is the name of
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Add support for smb3 alias/fstype in mount.cifs.c
  2019-11-13 17:01 [PATCH] Add support for smb3 alias/fstype in mount.cifs.c Kenneth D'souza
@ 2019-12-13  0:25 ` Pavel Shilovsky
  0 siblings, 0 replies; 2+ messages in thread
From: Pavel Shilovsky @ 2019-12-13  0:25 UTC (permalink / raw)
  To: Kenneth D'souza; +Cc: linux-cifs, Steve French, Ronnie Sahlberg

ср, 13 нояб. 2019 г. в 09:01, Kenneth D'souza <kdsouza@redhat.com>:
>
> As we will slowly move towards smb3 filesystem,
> supporting through "mount -t smb3" is important.
>
> Signed-off-by: Kenneth D'souza <kdsouza@redhat.com>
> ---
>  Makefile.am    |  4 ++++
>  mount.cifs.c   |  8 +++++++-
>  mount.cifs.rst | 12 +++++++++---
>  3 files changed, 20 insertions(+), 4 deletions(-)
>
> diff --git a/Makefile.am b/Makefile.am
> index 8291b99..1af2573 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -111,3 +111,7 @@ CLEANFILES += $(rst_man_pages)
>  endif
>
>  SUBDIRS = contrib
> +
> +install-exec-hook:
> +       (cd $(ROOTSBINDIR) && ln -sf mount.cifs mount.smb3)
> +       (cd $(man8dir) && ln -sf mount.cifs.8 mount.smb3.8)
> diff --git a/mount.cifs.c b/mount.cifs.c
> index 6935fe1..0ed9d0a 100644
> --- a/mount.cifs.c
> +++ b/mount.cifs.c
> @@ -192,7 +192,7 @@ struct parsed_mount_info {
>  };
>
>  static const char *thisprogram;
> -static const char *cifs_fstype = "cifs";
> +static const char *cifs_fstype;
>
>  static int parse_unc(const char *unc_name, struct parsed_mount_info *parsed_info);
>
> @@ -1986,6 +1986,12 @@ int main(int argc, char **argv)
>         if (thisprogram == NULL)
>                 thisprogram = "mount.cifs";
>
> +       if(strcmp(thisprogram, "mount.cifs") == 0)
> +               cifs_fstype = "cifs";
> +
> +        if(strcmp(thisprogram, "mount.smb3") == 0)
> +              cifs_fstype = "smb3";
> +
>         /* allocate parsed_info as shared anonymous memory range */
>         parsed_info = mmap((void *)0, sizeof(*parsed_info), PROT_READ | PROT_WRITE,
>                            MAP_ANONYMOUS | MAP_SHARED, -1, 0);
> diff --git a/mount.cifs.rst b/mount.cifs.rst
> index ee5086c..67ec629 100644
> --- a/mount.cifs.rst
> +++ b/mount.cifs.rst
> @@ -1,6 +1,6 @@
> -==========
> -mount.cifs
> -==========
> +=====================
> +mount.cifs mount.smb3
> +=====================
>
>  --------------------------------------------------
>  mount using the Common Internet File System (CIFS)
> @@ -23,6 +23,12 @@ protocol and is supported by most Windows servers, Azure (cloud storage),
>  Macs and many other commercial servers and Network Attached Storage
>  appliances as well as by the popular Open Source server Samba.
>
> +``mount.smb3`` mounts only SMB3 filesystem. It is usually invoked
> +indirectly by the mount(8) command when using the "-t smb3" option.
> +The ``smb3`` filesystem type was added in kernel-4.18 and above.
> +It works in a similar fashion as mount.cifs except it passes filesystem
> +type as smb3.
> +
>  The mount.cifs utility attaches the UNC name (exported network
>  resource) specified as service (using ``//server/share`` syntax, where
>  "server" is the server name or IP address and "share" is the name of
> --
> 2.21.0
>

Merged, thanks.
--
Best regards,
Pavel Shilovsky

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-12-13  0:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-13 17:01 [PATCH] Add support for smb3 alias/fstype in mount.cifs.c Kenneth D'souza
2019-12-13  0:25 ` Pavel Shilovsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.