Commit dea29037 authored by Jeff Layton's avatar Jeff Layton Committed by Steve French

cifs: move superblock magic defitions to magic.h

Help userland apps to identify cifs and smb2 mounts.
Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 3ac5f2f2
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/random.h> #include <linux/random.h>
#include <linux/uuid.h> #include <linux/uuid.h>
#include <linux/xattr.h> #include <linux/xattr.h>
#include <uapi/linux/magic.h>
#include <net/ipv6.h> #include <net/ipv6.h>
#include "cifsfs.h" #include "cifsfs.h"
#include "cifspdu.h" #include "cifspdu.h"
...@@ -202,7 +203,7 @@ cifs_read_super(struct super_block *sb) ...@@ -202,7 +203,7 @@ cifs_read_super(struct super_block *sb)
sb->s_time_max = ts.tv_sec; sb->s_time_max = ts.tv_sec;
} }
sb->s_magic = CIFS_MAGIC_NUMBER; sb->s_magic = CIFS_SUPER_MAGIC;
sb->s_op = &cifs_super_ops; sb->s_op = &cifs_super_ops;
sb->s_xattr = cifs_xattr_handlers; sb->s_xattr = cifs_xattr_handlers;
rc = super_setup_bdi(sb); rc = super_setup_bdi(sb);
......
...@@ -24,8 +24,6 @@ ...@@ -24,8 +24,6 @@
#include "../smbfs_common/smb2pdu.h" #include "../smbfs_common/smb2pdu.h"
#include "smb2pdu.h" #include "smb2pdu.h"
#define CIFS_MAGIC_NUMBER 0xFF534D42 /* the first four bytes of SMB PDUs */
#define SMB_PATH_MAX 260 #define SMB_PATH_MAX 260
#define CIFS_PORT 445 #define CIFS_PORT 445
#define RFC1001_PORT 139 #define RFC1001_PORT 139
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <linux/pagemap.h> #include <linux/pagemap.h>
#include <linux/vfs.h> #include <linux/vfs.h>
#include <uapi/linux/magic.h>
#include "cifsglob.h" #include "cifsglob.h"
#include "cifsproto.h" #include "cifsproto.h"
#include "cifs_debug.h" #include "cifs_debug.h"
...@@ -887,7 +888,7 @@ cifs_queryfs(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -887,7 +888,7 @@ cifs_queryfs(const unsigned int xid, struct cifs_tcon *tcon,
{ {
int rc = -EOPNOTSUPP; int rc = -EOPNOTSUPP;
buf->f_type = CIFS_MAGIC_NUMBER; buf->f_type = CIFS_SUPER_MAGIC;
/* /*
* We could add a second check for a QFS Unix capability bit * We could add a second check for a QFS Unix capability bit
......
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
#ifndef _SMB2_GLOB_H #ifndef _SMB2_GLOB_H
#define _SMB2_GLOB_H #define _SMB2_GLOB_H
#define SMB2_MAGIC_NUMBER 0xFE534D42
/* /*
***************************************************************** *****************************************************************
* Constants go here * Constants go here
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/sort.h> #include <linux/sort.h>
#include <crypto/aead.h> #include <crypto/aead.h>
#include <linux/fiemap.h> #include <linux/fiemap.h>
#include <uapi/linux/magic.h>
#include "cifsfs.h" #include "cifsfs.h"
#include "cifsglob.h" #include "cifsglob.h"
#include "smb2pdu.h" #include "smb2pdu.h"
...@@ -2757,7 +2758,7 @@ smb2_queryfs(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -2757,7 +2758,7 @@ smb2_queryfs(const unsigned int xid, struct cifs_tcon *tcon,
goto qfs_exit; goto qfs_exit;
rsp = (struct smb2_query_info_rsp *)rsp_iov.iov_base; rsp = (struct smb2_query_info_rsp *)rsp_iov.iov_base;
buf->f_type = SMB2_MAGIC_NUMBER; buf->f_type = SMB2_SUPER_MAGIC;
info = (struct smb2_fs_full_size_info *)( info = (struct smb2_fs_full_size_info *)(
le16_to_cpu(rsp->OutputBufferOffset) + (char *)rsp); le16_to_cpu(rsp->OutputBufferOffset) + (char *)rsp);
rc = smb2_validate_iov(le16_to_cpu(rsp->OutputBufferOffset), rc = smb2_validate_iov(le16_to_cpu(rsp->OutputBufferOffset),
...@@ -2799,7 +2800,7 @@ smb311_queryfs(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -2799,7 +2800,7 @@ smb311_queryfs(const unsigned int xid, struct cifs_tcon *tcon,
rc = SMB311_posix_qfs_info(xid, tcon, fid.persistent_fid, rc = SMB311_posix_qfs_info(xid, tcon, fid.persistent_fid,
fid.volatile_fid, buf); fid.volatile_fid, buf);
buf->f_type = SMB2_MAGIC_NUMBER; buf->f_type = SMB2_SUPER_MAGIC;
SMB2_close(xid, tcon, fid.persistent_fid, fid.volatile_fid); SMB2_close(xid, tcon, fid.persistent_fid, fid.volatile_fid);
return rc; return rc;
} }
......
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
#define QNX6_SUPER_MAGIC 0x68191122 /* qnx6 fs detection */ #define QNX6_SUPER_MAGIC 0x68191122 /* qnx6 fs detection */
#define AFS_FS_MAGIC 0x6B414653 #define AFS_FS_MAGIC 0x6B414653
#define REISERFS_SUPER_MAGIC 0x52654973 /* used by gcc */ #define REISERFS_SUPER_MAGIC 0x52654973 /* used by gcc */
/* used by file system utilities that /* used by file system utilities that
look at the superblock, etc. */ look at the superblock, etc. */
...@@ -59,6 +60,9 @@ ...@@ -59,6 +60,9 @@
#define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs" #define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs"
#define SMB_SUPER_MAGIC 0x517B #define SMB_SUPER_MAGIC 0x517B
#define CIFS_SUPER_MAGIC 0xFF534D42 /* the first four bytes of SMB PDUs */
#define SMB2_SUPER_MAGIC 0xFE534D42
#define CGROUP_SUPER_MAGIC 0x27e0eb #define CGROUP_SUPER_MAGIC 0x27e0eb
#define CGROUP2_SUPER_MAGIC 0x63677270 #define CGROUP2_SUPER_MAGIC 0x63677270
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment