aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/cifs/cifspdu.h49
-rw-r--r--fs/cifs/smbfsctl.h84
2 files changed, 90 insertions, 43 deletions
diff --git a/fs/cifs/cifspdu.h b/fs/cifs/cifspdu.h
index 56127638b91e..b370489c8da5 100644
--- a/fs/cifs/cifspdu.h
+++ b/fs/cifs/cifspdu.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * fs/cifs/cifspdu.h 2 * fs/cifs/cifspdu.h
3 * 3 *
4 * Copyright (c) International Business Machines Corp., 2002,2008 4 * Copyright (c) International Business Machines Corp., 2002,2009
5 * Author(s): Steve French (sfrench@us.ibm.com) 5 * Author(s): Steve French (sfrench@us.ibm.com)
6 * 6 *
7 * This library is free software; you can redistribute it and/or modify 7 * This library is free software; you can redistribute it and/or modify
@@ -23,6 +23,7 @@
23#define _CIFSPDU_H 23#define _CIFSPDU_H
24 24
25#include <net/sock.h> 25#include <net/sock.h>
26#include "smbfsctl.h"
26 27
27#ifdef CONFIG_CIFS_WEAK_PW_HASH 28#ifdef CONFIG_CIFS_WEAK_PW_HASH
28#define LANMAN_PROT 0 29#define LANMAN_PROT 0
@@ -34,11 +35,10 @@
34#define POSIX_PROT (CIFS_PROT+1) 35#define POSIX_PROT (CIFS_PROT+1)
35#define BAD_PROT 0xFFFF 36#define BAD_PROT 0xFFFF
36 37
37/* SMB command codes */ 38/* SMB command codes:
38/* 39 * Note some commands have minimal (wct=0,bcc=0), or uninteresting, responses
39 * Some commands have minimal (wct=0,bcc=0), or uninteresting, responses
40 * (ie which include no useful data other than the SMB error code itself). 40 * (ie which include no useful data other than the SMB error code itself).
41 * Knowing this helps avoid response buffer allocations and copy in some cases 41 * This can allow us to avoid response buffer allocations and copy in some cases
42 */ 42 */
43#define SMB_COM_CREATE_DIRECTORY 0x00 /* trivial response */ 43#define SMB_COM_CREATE_DIRECTORY 0x00 /* trivial response */
44#define SMB_COM_DELETE_DIRECTORY 0x01 /* trivial response */ 44#define SMB_COM_DELETE_DIRECTORY 0x01 /* trivial response */
@@ -1963,39 +1963,6 @@ typedef struct smb_com_transaction_get_dfs_refer_rsp {
1963#define DFSREF_STORAGE_SERVER 0x00000002 /* no further ref requests needed */ 1963#define DFSREF_STORAGE_SERVER 0x00000002 /* no further ref requests needed */
1964#define DFSREF_TARGET_FAILBACK 0x00000004 /* only for DFS referral version 4 */ 1964#define DFSREF_TARGET_FAILBACK 0x00000004 /* only for DFS referral version 4 */
1965 1965
1966/* IOCTL information */
1967/*
1968 * List of ioctl function codes that look to be of interest to remote clients
1969 * like this one. Need to do some experimentation to make sure they all work
1970 * remotely. Some of the following, such as the encryption/compression ones
1971 * would be invoked from tools via a specialized hook into the VFS rather
1972 * than via the standard vfs entry points
1973 */
1974#define FSCTL_REQUEST_OPLOCK_LEVEL_1 0x00090000
1975#define FSCTL_REQUEST_OPLOCK_LEVEL_2 0x00090004
1976#define FSCTL_REQUEST_BATCH_OPLOCK 0x00090008
1977#define FSCTL_LOCK_VOLUME 0x00090018
1978#define FSCTL_UNLOCK_VOLUME 0x0009001C
1979#define FSCTL_GET_COMPRESSION 0x0009003C
1980#define FSCTL_SET_COMPRESSION 0x0009C040
1981#define FSCTL_REQUEST_FILTER_OPLOCK 0x0009008C
1982#define FSCTL_FILESYS_GET_STATISTICS 0x00090090
1983#define FSCTL_SET_REPARSE_POINT 0x000900A4
1984#define FSCTL_GET_REPARSE_POINT 0x000900A8
1985#define FSCTL_DELETE_REPARSE_POINT 0x000900AC
1986#define FSCTL_SET_SPARSE 0x000900C4
1987#define FSCTL_SET_ZERO_DATA 0x000900C8
1988#define FSCTL_SET_ENCRYPTION 0x000900D7
1989#define FSCTL_ENCRYPTION_FSCTL_IO 0x000900DB
1990#define FSCTL_WRITE_RAW_ENCRYPTED 0x000900DF
1991#define FSCTL_READ_RAW_ENCRYPTED 0x000900E3
1992#define FSCTL_SIS_COPYFILE 0x00090100
1993#define FSCTL_SIS_LINK_FILES 0x0009C104
1994
1995#define IO_REPARSE_TAG_MOUNT_POINT 0xA0000003
1996#define IO_REPARSE_TAG_HSM 0xC0000004
1997#define IO_REPARSE_TAG_SIS 0x80000007
1998
1999/* 1966/*
2000 ************************************************************************ 1967 ************************************************************************
2001 * All structs for everything above the SMB PDUs themselves 1968 * All structs for everything above the SMB PDUs themselves
@@ -2515,8 +2482,6 @@ struct data_blob {
2515 6) Use nanosecond timestamps throughout all time fields if 2482 6) Use nanosecond timestamps throughout all time fields if
2516 corresponding attribute flag is set 2483 corresponding attribute flag is set
2517 7) sendfile - handle based copy 2484 7) sendfile - handle based copy
2518 8) Direct i/o
2519 9) Misc fcntls?
2520 2485
2521 what about fixing 64 bit alignment 2486 what about fixing 64 bit alignment
2522 2487
@@ -2635,7 +2600,5 @@ typedef struct file_chattr_info {
2635 __le64 mode; /* list of actual attribute bits on this inode */ 2600 __le64 mode; /* list of actual attribute bits on this inode */
2636} __attribute__((packed)) FILE_CHATTR_INFO; /* ext attributes 2601} __attribute__((packed)) FILE_CHATTR_INFO; /* ext attributes
2637 (chattr, chflags) level 0x206 */ 2602 (chattr, chflags) level 0x206 */
2638 2603#endif /* POSIX */
2639#endif
2640
2641#endif /* _CIFSPDU_H */ 2604#endif /* _CIFSPDU_H */
diff --git a/fs/cifs/smbfsctl.h b/fs/cifs/smbfsctl.h
new file mode 100644
index 000000000000..7056b891e087
--- /dev/null
+++ b/fs/cifs/smbfsctl.h
@@ -0,0 +1,84 @@
1/*
2 * fs/cifs/smbfsctl.h: SMB, CIFS, SMB2 FSCTL definitions
3 *
4 * Copyright (c) International Business Machines Corp., 2002,2009
5 * Author(s): Steve French (sfrench@us.ibm.com)
6 *
7 * This library is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published
9 * by the Free Software Foundation; either version 2.1 of the License, or
10 * (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
15 * the GNU Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22/* IOCTL information */
23/*
24 * List of ioctl/fsctl function codes that are or could be useful in the
25 * future to remote clients like cifs or SMB2 client. There is probably
26 * a slightly larger set of fsctls that NTFS local filesystem could handle,
27 * including the seven below that we do not have struct definitions for.
28 * Even with protocol definitions for most of these now available, we still
29 * need to do some experimentation to identify which are practical to do
30 * remotely. Some of the following, such as the encryption/compression ones
31 * could be invoked from tools via a specialized hook into the VFS rather
32 * than via the standard vfs entry points
33 */
34#define FSCTL_REQUEST_OPLOCK_LEVEL_1 0x00090000
35#define FSCTL_REQUEST_OPLOCK_LEVEL_2 0x00090004
36#define FSCTL_REQUEST_BATCH_OPLOCK 0x00090008
37#define FSCTL_LOCK_VOLUME 0x00090018
38#define FSCTL_UNLOCK_VOLUME 0x0009001C
39#define FSCTL_IS_PATHNAME_VALID 0x0009002C /* BB add struct */
40#define FSCTL_GET_COMPRESSION 0x0009003C /* BB add struct */
41#define FSCTL_SET_COMPRESSION 0x0009C040 /* BB add struct */
42#define FSCTL_QUERY_FAT_BPB 0x00090058 /* BB add struct */
43/* Verify the next FSCTL number, we had it as 0x00090090 before */
44#define FSCTL_FILESYSTEM_GET_STATS 0x00090060 /* BB add struct */
45#define FSCTL_GET_NTFS_VOLUME_DATA 0x00090064 /* BB add struct */
46#define FSCTL_GET_RETRIEVAL_POINTERS 0x00090073 /* BB add struct */
47#define FSCTL_IS_VOLUME_DIRTY 0x00090078 /* BB add struct */
48#define FSCTL_ALLOW_EXTENDED_DASD_IO 0x00090083 /* BB add struct */
49#define FSCTL_REQUEST_FILTER_OPLOCK 0x0009008C
50#define FSCTL_FIND_FILES_BY_SID 0x0009008F /* BB add struct */
51#define FSCTL_SET_OBJECT_ID 0x00090098 /* BB add struct */
52#define FSCTL_GET_OBJECT_ID 0x0009009C /* BB add struct */
53#define FSCTL_DELETE_OBJECT_ID 0x000900A0 /* BB add struct */
54#define FSCTL_SET_REPARSE_POINT 0x000900A4 /* BB add struct */
55#define FSCTL_GET_REPARSE_POINT 0x000900A8 /* BB add struct */
56#define FSCTL_DELETE_REPARSE_POINT 0x000900AC /* BB add struct */
57#define FSCTL_SET_OBJECT_ID_EXTENDED 0x000900BC /* BB add struct */
58#define FSCTL_CREATE_OR_GET_OBJECT_ID 0x000900C0 /* BB add struct */
59#define FSCTL_SET_SPARSE 0x000900C4 /* BB add struct */
60#define FSCTL_SET_ZERO_DATA 0x000900C8 /* BB add struct */
61#define FSCTL_SET_ENCRYPTION 0x000900D7 /* BB add struct */
62#define FSCTL_ENCRYPTION_FSCTL_IO 0x000900DB /* BB add struct */
63#define FSCTL_WRITE_RAW_ENCRYPTED 0x000900DF /* BB add struct */
64#define FSCTL_READ_RAW_ENCRYPTED 0x000900E3 /* BB add struct */
65#define FSCTL_READ_FILE_USN_DATA 0x000900EB /* BB add struct */
66#define FSCTL_WRITE_USN_CLOSE_RECORD 0x000900EF /* BB add struct */
67#define FSCTL_SIS_COPYFILE 0x00090100 /* BB add struct */
68#define FSCTL_RECALL_FILE 0x00090117 /* BB add struct */
69#define FSCTL_QUERY_SPARING_INFO 0x00090138 /* BB add struct */
70#define FSCTL_SET_ZERO_ON_DEALLOC 0x00090194 /* BB add struct */
71#define FSCTL_SET_SHORT_NAME_BEHAVIOR 0x000901B4 /* BB add struct */
72#define FSCTL_QUERY_ALLOCATED_RANGES 0x000940CF /* BB add struct */
73#define FSCTL_SET_DEFECT_MANAGEMENT 0x00098134 /* BB add struct */
74#define FSCTL_SIS_LINK_FILES 0x0009C104
75#define FSCTL_PIPE_PEEK 0x0011400C /* BB add struct */
76#define FSCTL_PIPE_TRANSCEIVE 0x0011C017 /* BB add struct */
77/* strange that the number for this op is not sequential with previous op */
78#define FSCTL_PIPE_WAIT 0x00110018 /* BB add struct */
79#define FSCTL_LMR_GET_LINK_TRACK_INF 0x001400E8 /* BB add struct */
80#define FSCTL_LMR_SET_LINK_TRACK_INF 0x001400EC /* BB add struct */
81
82#define IO_REPARSE_TAG_MOUNT_POINT 0xA0000003
83#define IO_REPARSE_TAG_HSM 0xC0000004
84#define IO_REPARSE_TAG_SIS 0x80000007