Blame view

fs/cifs/smbfsctl.h 6.48 KB
038245774   Steve French   [CIFS] Add defini...
1
2
3
  /*
   *   fs/cifs/smbfsctl.h: SMB, CIFS, SMB2 FSCTL definitions
   *
be7457d38   Steve French   Update headers to...
4
   *   Copyright (c) International Business Machines  Corp., 2002,2013
038245774   Steve French   [CIFS] Add defini...
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
   *   Author(s): Steve French (sfrench@us.ibm.com)
   *
   *   This library is free software; you can redistribute it and/or modify
   *   it under the terms of the GNU Lesser General Public License as published
   *   by the Free Software Foundation; either version 2.1 of the License, or
   *   (at your option) any later version.
   *
   *   This library is distributed in the hope that it will be useful,
   *   but WITHOUT ANY WARRANTY; without even the implied warranty of
   *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
   *   the GNU Lesser General Public License for more details.
   *
   *   You should have received a copy of the GNU Lesser General Public License
   *   along with this library; if not, write to the Free Software
   *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
   */
  
  /* IOCTL information */
  /*
   * List of ioctl/fsctl function codes that are or could be useful in the
be7457d38   Steve French   Update headers to...
25
   * future to remote clients like cifs or SMB2/SMB3 client.  This is probably
038245774   Steve French   [CIFS] Add defini...
26
27
28
29
30
31
32
   * a slightly larger set of fsctls that NTFS local filesystem could handle,
   * including the seven below that we do not have struct definitions for.
   * Even with protocol definitions for most of these now available, we still
   * need to do some experimentation to identify which are practical to do
   * remotely.  Some of the following, such as the encryption/compression ones
   * could be invoked from tools via a specialized hook into the VFS rather
   * than via the standard vfs entry points
be7457d38   Steve French   Update headers to...
33
34
35
36
   *
   * See MS-SMB2 Section 2.2.31 (last checked June 2013, all of that list are
   * below). Additional detail on less common ones can be found in MS-FSCC
   * section 2.3.
038245774   Steve French   [CIFS] Add defini...
37
   */
be7457d38   Steve French   Update headers to...
38
39
  #define FSCTL_DFS_GET_REFERRALS      0x00060194
  #define FSCTL_DFS_GET_REFERRALS_EX   0x000601B0
038245774   Steve French   [CIFS] Add defini...
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
  #define FSCTL_REQUEST_OPLOCK_LEVEL_1 0x00090000
  #define FSCTL_REQUEST_OPLOCK_LEVEL_2 0x00090004
  #define FSCTL_REQUEST_BATCH_OPLOCK   0x00090008
  #define FSCTL_LOCK_VOLUME            0x00090018
  #define FSCTL_UNLOCK_VOLUME          0x0009001C
  #define FSCTL_IS_PATHNAME_VALID      0x0009002C /* BB add struct */
  #define FSCTL_GET_COMPRESSION        0x0009003C /* BB add struct */
  #define FSCTL_SET_COMPRESSION        0x0009C040 /* BB add struct */
  #define FSCTL_QUERY_FAT_BPB          0x00090058 /* BB add struct */
  /* Verify the next FSCTL number, we had it as 0x00090090 before */
  #define FSCTL_FILESYSTEM_GET_STATS   0x00090060 /* BB add struct */
  #define FSCTL_GET_NTFS_VOLUME_DATA   0x00090064 /* BB add struct */
  #define FSCTL_GET_RETRIEVAL_POINTERS 0x00090073 /* BB add struct */
  #define FSCTL_IS_VOLUME_DIRTY        0x00090078 /* BB add struct */
  #define FSCTL_ALLOW_EXTENDED_DASD_IO 0x00090083 /* BB add struct */
  #define FSCTL_REQUEST_FILTER_OPLOCK  0x0009008C
  #define FSCTL_FIND_FILES_BY_SID      0x0009008F /* BB add struct */
  #define FSCTL_SET_OBJECT_ID          0x00090098 /* BB add struct */
  #define FSCTL_GET_OBJECT_ID          0x0009009C /* BB add struct */
  #define FSCTL_DELETE_OBJECT_ID       0x000900A0 /* BB add struct */
  #define FSCTL_SET_REPARSE_POINT      0x000900A4 /* BB add struct */
  #define FSCTL_GET_REPARSE_POINT      0x000900A8 /* BB add struct */
  #define FSCTL_DELETE_REPARSE_POINT   0x000900AC /* BB add struct */
  #define FSCTL_SET_OBJECT_ID_EXTENDED 0x000900BC /* BB add struct */
  #define FSCTL_CREATE_OR_GET_OBJECT_ID 0x000900C0 /* BB add struct */
  #define FSCTL_SET_SPARSE             0x000900C4 /* BB add struct */
31742c5a3   Steve French   enable fallocate ...
66
  #define FSCTL_SET_ZERO_DATA          0x000980C8
038245774   Steve French   [CIFS] Add defini...
67
68
69
70
71
72
73
74
75
76
77
  #define FSCTL_SET_ENCRYPTION         0x000900D7 /* BB add struct */
  #define FSCTL_ENCRYPTION_FSCTL_IO    0x000900DB /* BB add struct */
  #define FSCTL_WRITE_RAW_ENCRYPTED    0x000900DF /* BB add struct */
  #define FSCTL_READ_RAW_ENCRYPTED     0x000900E3 /* BB add struct */
  #define FSCTL_READ_FILE_USN_DATA     0x000900EB /* BB add struct */
  #define FSCTL_WRITE_USN_CLOSE_RECORD 0x000900EF /* BB add struct */
  #define FSCTL_SIS_COPYFILE           0x00090100 /* BB add struct */
  #define FSCTL_RECALL_FILE            0x00090117 /* BB add struct */
  #define FSCTL_QUERY_SPARING_INFO     0x00090138 /* BB add struct */
  #define FSCTL_SET_ZERO_ON_DEALLOC    0x00090194 /* BB add struct */
  #define FSCTL_SET_SHORT_NAME_BEHAVIOR 0x000901B4 /* BB add struct */
9d1b06602   Steve French   Add Get/Set Integ...
78
  #define FSCTL_GET_INTEGRITY_INFORMATION 0x0009027C
038245774   Steve French   [CIFS] Add defini...
79
80
  #define FSCTL_QUERY_ALLOCATED_RANGES 0x000940CF /* BB add struct */
  #define FSCTL_SET_DEFECT_MANAGEMENT  0x00098134 /* BB add struct */
be7457d38   Steve French   Update headers to...
81
  #define FSCTL_FILE_LEVEL_TRIM        0x00098208 /* BB add struct */
02b166654   Steve French   Add reflink copy ...
82
  #define FSCTL_DUPLICATE_EXTENTS_TO_FILE 0x00098344
038245774   Steve French   [CIFS] Add defini...
83
  #define FSCTL_SIS_LINK_FILES         0x0009C104
9d1b06602   Steve French   Add Get/Set Integ...
84
  #define FSCTL_SET_INTEGRITY_INFORMATION 0x0009C280
038245774   Steve French   [CIFS] Add defini...
85
86
87
88
  #define FSCTL_PIPE_PEEK              0x0011400C /* BB add struct */
  #define FSCTL_PIPE_TRANSCEIVE        0x0011C017 /* BB add struct */
  /* strange that the number for this op is not sequential with previous op */
  #define FSCTL_PIPE_WAIT              0x00110018 /* BB add struct */
be7457d38   Steve French   Update headers to...
89
90
91
92
  /* Enumerate previous versions of a file */
  #define FSCTL_SRV_ENUMERATE_SNAPSHOTS 0x00144064
  /* Retrieve an opaque file reference for server-side data movement ie copy */
  #define FSCTL_SRV_REQUEST_RESUME_KEY 0x00140078
b56eae4df   Steve French   [SMB3] Send durab...
93
  #define FSCTL_LMR_REQUEST_RESILIENCY 0x001401D4
038245774   Steve French   [CIFS] Add defini...
94
95
  #define FSCTL_LMR_GET_LINK_TRACK_INF 0x001400E8 /* BB add struct */
  #define FSCTL_LMR_SET_LINK_TRACK_INF 0x001400EC /* BB add struct */
ff1c038ad   Steve French   Check SMB3 dialec...
96
  #define FSCTL_VALIDATE_NEGOTIATE_INFO 0x00140204
be7457d38   Steve French   Update headers to...
97
98
99
100
101
  /* Perform server-side data movement */
  #define FSCTL_SRV_COPYCHUNK 0x001440F2
  #define FSCTL_SRV_COPYCHUNK_WRITE 0x001480F2
  #define FSCTL_QUERY_NETWORK_INTERFACE_INFO 0x001401FC /* BB add struct */
  #define FSCTL_SRV_READ_HASH          0x001441BB /* BB add struct */
038245774   Steve French   [CIFS] Add defini...
102

c31f33071   Steve French   do not treat non-...
103
  /* See FSCC 2.1.2.5 */
038245774   Steve French   [CIFS] Add defini...
104
105
106
  #define IO_REPARSE_TAG_MOUNT_POINT   0xA0000003
  #define IO_REPARSE_TAG_HSM           0xC0000004
  #define IO_REPARSE_TAG_SIS           0x80000007
c31f33071   Steve French   do not treat non-...
107
108
109
110
111
112
113
114
115
116
117
118
119
  #define IO_REPARSE_TAG_HSM2          0x80000006
  #define IO_REPARSE_TAG_DRIVER_EXTENDER 0x80000005
  /* Used by the DFS filter. See MS-DFSC */
  #define IO_REPARSE_TAG_DFS           0x8000000A
  /* Used by the DFS filter See MS-DFSC */
  #define IO_REPARSE_TAG_DFSR          0x80000012
  #define IO_REPARSE_TAG_FILTER_MANAGER 0x8000000B
  /* See section MS-FSCC 2.1.2.4 */
  #define IO_REPARSE_TAG_SYMLINK       0xA000000C
  #define IO_REPARSE_TAG_DEDUP         0x80000013
  #define IO_REPARSE_APPXSTREAM	     0xC0000014
  /* NFS symlinks, Win 8/SMB3 and later */
  #define IO_REPARSE_TAG_NFS           0x80000014
be7457d38   Steve French   Update headers to...
120
121
122
123
  
  /* fsctl flags */
  /* If Flags is set to this value, the request is an FSCTL not ioctl request */
  #define SMB2_0_IOCTL_IS_FSCTL		0x00000001