138c8a9a5SSteve French /* SPDX-License-Identifier: LGPL-2.1+ */ 238c8a9a5SSteve French /* 3*bf8a352dSSteve French * fs/smb/server/smbfsctl.h: SMB, CIFS, SMB2 FSCTL definitions 438c8a9a5SSteve French * 538c8a9a5SSteve French * Copyright (c) International Business Machines Corp., 2002,2009 638c8a9a5SSteve French * Author(s): Steve French (sfrench@us.ibm.com) 738c8a9a5SSteve French */ 838c8a9a5SSteve French 938c8a9a5SSteve French /* IOCTL information */ 1038c8a9a5SSteve French /* 1138c8a9a5SSteve French * List of ioctl/fsctl function codes that are or could be useful in the 1238c8a9a5SSteve French * future to remote clients like cifs or SMB2 client. There is probably 1338c8a9a5SSteve French * a slightly larger set of fsctls that NTFS local filesystem could handle, 1438c8a9a5SSteve French * including the seven below that we do not have struct definitions for. 1538c8a9a5SSteve French * Even with protocol definitions for most of these now available, we still 1638c8a9a5SSteve French * need to do some experimentation to identify which are practical to do 1738c8a9a5SSteve French * remotely. Some of the following, such as the encryption/compression ones 1838c8a9a5SSteve French * could be invoked from tools via a specialized hook into the VFS rather 1938c8a9a5SSteve French * than via the standard vfs entry points 2038c8a9a5SSteve French */ 2138c8a9a5SSteve French 2238c8a9a5SSteve French #ifndef __KSMBD_SMBFSCTL_H 2338c8a9a5SSteve French #define __KSMBD_SMBFSCTL_H 2438c8a9a5SSteve French 2538c8a9a5SSteve French #define FSCTL_DFS_GET_REFERRALS 0x00060194 2638c8a9a5SSteve French #define FSCTL_DFS_GET_REFERRALS_EX 0x000601B0 2738c8a9a5SSteve French #define FSCTL_REQUEST_OPLOCK_LEVEL_1 0x00090000 2838c8a9a5SSteve French #define FSCTL_REQUEST_OPLOCK_LEVEL_2 0x00090004 2938c8a9a5SSteve French #define FSCTL_REQUEST_BATCH_OPLOCK 0x00090008 3038c8a9a5SSteve French #define FSCTL_LOCK_VOLUME 0x00090018 3138c8a9a5SSteve French #define FSCTL_UNLOCK_VOLUME 0x0009001C 3238c8a9a5SSteve French #define FSCTL_IS_PATHNAME_VALID 0x0009002C /* BB add struct */ 3338c8a9a5SSteve French #define FSCTL_GET_COMPRESSION 0x0009003C /* BB add struct */ 3438c8a9a5SSteve French #define FSCTL_SET_COMPRESSION 0x0009C040 /* BB add struct */ 3538c8a9a5SSteve French #define FSCTL_QUERY_FAT_BPB 0x00090058 /* BB add struct */ 3638c8a9a5SSteve French /* Verify the next FSCTL number, we had it as 0x00090090 before */ 3738c8a9a5SSteve French #define FSCTL_FILESYSTEM_GET_STATS 0x00090060 /* BB add struct */ 3838c8a9a5SSteve French #define FSCTL_GET_NTFS_VOLUME_DATA 0x00090064 /* BB add struct */ 3938c8a9a5SSteve French #define FSCTL_GET_RETRIEVAL_POINTERS 0x00090073 /* BB add struct */ 4038c8a9a5SSteve French #define FSCTL_IS_VOLUME_DIRTY 0x00090078 /* BB add struct */ 4138c8a9a5SSteve French #define FSCTL_ALLOW_EXTENDED_DASD_IO 0x00090083 /* BB add struct */ 4238c8a9a5SSteve French #define FSCTL_REQUEST_FILTER_OPLOCK 0x0009008C 4338c8a9a5SSteve French #define FSCTL_FIND_FILES_BY_SID 0x0009008F /* BB add struct */ 4438c8a9a5SSteve French #define FSCTL_SET_OBJECT_ID 0x00090098 /* BB add struct */ 4538c8a9a5SSteve French #define FSCTL_GET_OBJECT_ID 0x0009009C /* BB add struct */ 4638c8a9a5SSteve French #define FSCTL_DELETE_OBJECT_ID 0x000900A0 /* BB add struct */ 4738c8a9a5SSteve French #define FSCTL_SET_REPARSE_POINT 0x000900A4 /* BB add struct */ 4838c8a9a5SSteve French #define FSCTL_GET_REPARSE_POINT 0x000900A8 /* BB add struct */ 4938c8a9a5SSteve French #define FSCTL_DELETE_REPARSE_POINT 0x000900AC /* BB add struct */ 5038c8a9a5SSteve French #define FSCTL_SET_OBJECT_ID_EXTENDED 0x000900BC /* BB add struct */ 5138c8a9a5SSteve French #define FSCTL_CREATE_OR_GET_OBJECT_ID 0x000900C0 /* BB add struct */ 5238c8a9a5SSteve French #define FSCTL_SET_SPARSE 0x000900C4 /* BB add struct */ 5338c8a9a5SSteve French #define FSCTL_SET_ZERO_DATA 0x000980C8 /* BB add struct */ 5438c8a9a5SSteve French #define FSCTL_SET_ENCRYPTION 0x000900D7 /* BB add struct */ 5538c8a9a5SSteve French #define FSCTL_ENCRYPTION_FSCTL_IO 0x000900DB /* BB add struct */ 5638c8a9a5SSteve French #define FSCTL_WRITE_RAW_ENCRYPTED 0x000900DF /* BB add struct */ 5738c8a9a5SSteve French #define FSCTL_READ_RAW_ENCRYPTED 0x000900E3 /* BB add struct */ 5838c8a9a5SSteve French #define FSCTL_READ_FILE_USN_DATA 0x000900EB /* BB add struct */ 5938c8a9a5SSteve French #define FSCTL_WRITE_USN_CLOSE_RECORD 0x000900EF /* BB add struct */ 6038c8a9a5SSteve French #define FSCTL_SIS_COPYFILE 0x00090100 /* BB add struct */ 6138c8a9a5SSteve French #define FSCTL_RECALL_FILE 0x00090117 /* BB add struct */ 6238c8a9a5SSteve French #define FSCTL_QUERY_SPARING_INFO 0x00090138 /* BB add struct */ 6338c8a9a5SSteve French #define FSCTL_SET_ZERO_ON_DEALLOC 0x00090194 /* BB add struct */ 6438c8a9a5SSteve French #define FSCTL_SET_SHORT_NAME_BEHAVIOR 0x000901B4 /* BB add struct */ 6538c8a9a5SSteve French #define FSCTL_QUERY_ALLOCATED_RANGES 0x000940CF /* BB add struct */ 6638c8a9a5SSteve French #define FSCTL_SET_DEFECT_MANAGEMENT 0x00098134 /* BB add struct */ 6738c8a9a5SSteve French #define FSCTL_DUPLICATE_EXTENTS_TO_FILE 0x00098344 6838c8a9a5SSteve French #define FSCTL_SIS_LINK_FILES 0x0009C104 6938c8a9a5SSteve French #define FSCTL_PIPE_PEEK 0x0011400C /* BB add struct */ 7038c8a9a5SSteve French #define FSCTL_PIPE_TRANSCEIVE 0x0011C017 /* BB add struct */ 7138c8a9a5SSteve French /* strange that the number for this op is not sequential with previous op */ 7238c8a9a5SSteve French #define FSCTL_PIPE_WAIT 0x00110018 /* BB add struct */ 7338c8a9a5SSteve French #define FSCTL_REQUEST_RESUME_KEY 0x00140078 7438c8a9a5SSteve French #define FSCTL_LMR_GET_LINK_TRACK_INF 0x001400E8 /* BB add struct */ 7538c8a9a5SSteve French #define FSCTL_LMR_SET_LINK_TRACK_INF 0x001400EC /* BB add struct */ 7638c8a9a5SSteve French #define FSCTL_VALIDATE_NEGOTIATE_INFO 0x00140204 7738c8a9a5SSteve French #define FSCTL_QUERY_NETWORK_INTERFACE_INFO 0x001401FC 7838c8a9a5SSteve French #define FSCTL_COPYCHUNK 0x001440F2 7938c8a9a5SSteve French #define FSCTL_COPYCHUNK_WRITE 0x001480F2 8038c8a9a5SSteve French 8138c8a9a5SSteve French #define IO_REPARSE_TAG_MOUNT_POINT 0xA0000003 8238c8a9a5SSteve French #define IO_REPARSE_TAG_HSM 0xC0000004 8338c8a9a5SSteve French #define IO_REPARSE_TAG_SIS 0x80000007 8438c8a9a5SSteve French 8538c8a9a5SSteve French /* WSL reparse tags */ 8638c8a9a5SSteve French #define IO_REPARSE_TAG_LX_SYMLINK_LE cpu_to_le32(0xA000001D) 8738c8a9a5SSteve French #define IO_REPARSE_TAG_AF_UNIX_LE cpu_to_le32(0x80000023) 8838c8a9a5SSteve French #define IO_REPARSE_TAG_LX_FIFO_LE cpu_to_le32(0x80000024) 8938c8a9a5SSteve French #define IO_REPARSE_TAG_LX_CHR_LE cpu_to_le32(0x80000025) 9038c8a9a5SSteve French #define IO_REPARSE_TAG_LX_BLK_LE cpu_to_le32(0x80000026) 9138c8a9a5SSteve French #endif /* __KSMBD_SMBFSCTL_H */ 92