cifs: add witness mount option and data structs

Add 'witness' mount option to register for witness notifications.

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
diff --git a/fs/cifs/fs_context.c b/fs/cifs/fs_context.c
index 9120d14..fe5cc60 100644
--- a/fs/cifs/fs_context.c
+++ b/fs/cifs/fs_context.c
@@ -119,6 +119,7 @@ const struct fs_parameter_spec smb3_fs_parameters[] = {
 	fsparam_flag("modesid", Opt_modesid),
 	fsparam_flag("rootfs", Opt_rootfs),
 	fsparam_flag("compress", Opt_compress),
+	fsparam_flag("witness", Opt_witness),
 
 	/* Mount options which take numeric value */
 	fsparam_u32("backupuid", Opt_backupuid),
@@ -1004,6 +1005,13 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
 		if (cifs_parse_cache_flavor(param->string, ctx) != 0)
 			goto cifs_parse_mount_err;
 		break;
+	case Opt_witness:
+#ifndef CONFIG_CIFS_SWN_UPCALL
+		cifs_dbg(VFS, "Witness support needs CONFIG_CIFS_SWN_UPCALL config option\n");
+			goto cifs_parse_mount_err;
+#endif
+		ctx->witness = true;
+		break;
 	case Opt_rootfs:
 #ifdef CONFIG_CIFS_ROOT
 		ctx->rootfs = true;