smb3: add some missing definitions from MS-FSCC
authorSteve French <stfrench@microsoft.com>
Fri, 23 Oct 2020 20:21:38 +0000 (15:21 -0500)
committerSteve French <stfrench@microsoft.com>
Fri, 23 Oct 2020 20:38:10 +0000 (15:38 -0500)
Add some structures and defines that were recently added to
the protocol documentation (see MS-FSCC sections 2.3.29-2.3.34).

Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/smb2pdu.h
fs/cifs/smbfsctl.h

index 14244d2..f05f9b1 100644 (file)
@@ -999,6 +999,31 @@ struct copychunk_ioctl_rsp {
        __le32 TotalBytesWritten;
 } __packed;
 
+/* See MS-FSCC 2.3.29 and 2.3.30 */
+struct get_retrieval_pointer_count_req {
+       __le64 StartingVcn; /* virtual cluster number (signed) */
+} __packed;
+
+struct get_retrieval_pointer_count_rsp {
+       __le32 ExtentCount;
+} __packed;
+
+/*
+ * See MS-FSCC 2.3.33 and 2.3.34
+ * request is the same as get_retrieval_point_count_req struct above
+ */
+struct smb3_extents {
+       __le64 NextVcn;
+       __le64 Lcn; /* logical cluster number */
+} __packed;
+
+struct get_retrieval_pointers_refcount_rsp {
+       __le32 ExtentCount;
+       __u32  Reserved;
+       __le64 StartingVcn;
+       struct smb3_extents extents[];
+} __packed;
+
 struct fsctl_set_integrity_information_req {
        __le16  ChecksumAlgorithm;
        __le16  Reserved;
@@ -1640,6 +1665,7 @@ struct smb2_file_rename_info { /* encoding of request for level 10 */
        __u64  RootDirectory;  /* MBZ for network operations (why says spec?) */
        __le32 FileNameLength;
        char   FileName[];     /* New name to be assigned */
+       /* padding - overall struct size must be >= 24 so filename + pad >= 6 */
 } __packed; /* level 10 Set */
 
 struct smb2_file_link_info { /* encoding of request for level 11 */
index 1ff2852..a0e8474 100644 (file)
 #define FSCTL_SET_ZERO_ON_DEALLOC    0x00090194 /* BB add struct */
 #define FSCTL_SET_SHORT_NAME_BEHAVIOR 0x000901B4 /* BB add struct */
 #define FSCTL_GET_INTEGRITY_INFORMATION 0x0009027C
+#define FSCTL_GET_RETRIEVAL_POINTERS_AND_REFCOUNT 0x000903d3
+#define FSCTL_GET_RETRIEVAL_POINTER_COUNT 0x0009042b
 #define FSCTL_QUERY_ALLOCATED_RANGES 0x000940CF
 #define FSCTL_SET_DEFECT_MANAGEMENT  0x00098134 /* BB add struct */
 #define FSCTL_FILE_LEVEL_TRIM        0x00098208 /* BB add struct */