Print this page
NEX-17289 Minimal SMB 3.0.2 support
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
NEX-6276 SMB sparse file support
Reviewed by: Kevin Crowe <kevin.crowe@nexenta.com>
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
NEX-3620 need upstream cleanups for smbsrv
Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com>
SMB-11 SMB2 message parse & dispatch
SMB-12 SMB2 Negotiate Protocol
SMB-13 SMB2 Session Setup
SMB-14 SMB2 Logoff
SMB-15 SMB2 Tree Connect
SMB-16 SMB2 Tree Disconnect
SMB-17 SMB2 Create
SMB-18 SMB2 Close
SMB-19 SMB2 Flush
SMB-20 SMB2 Read
SMB-21 SMB2 Write
SMB-22 SMB2 Lock/Unlock
SMB-23 SMB2 Ioctl
SMB-24 SMB2 Cancel
SMB-25 SMB2 Echo
SMB-26 SMB2 Query Dir
SMB-27 SMB2 Change Notify
SMB-28 SMB2 Query Info
SMB-29 SMB2 Set Info
SMB-30 SMB2 Oplocks
SMB-53 SMB2 Create Context options
(SMB2 code review cleanup 1, 2, 3)
re #7815 SMB server delivers old modification time...
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/common/smbsrv/smb_vops.h
+++ new/usr/src/uts/common/smbsrv/smb_vops.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
|
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
23 - * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
23 + * Copyright 2018 Nexenta Systems, Inc. All rights reserved.
24 24 */
25 25
26 26 #ifndef _SMBSRV_SMB_VOPS_H
27 27 #define _SMBSRV_SMB_VOPS_H
28 28
29 29 /*
30 30 * Common file system interfaces and definitions.
31 31 */
32 32
33 33 #include <sys/types.h>
34 34 #include <sys/param.h>
35 35 #include <sys/file.h>
36 36 #include <sys/time.h>
37 37 #include <sys/mntent.h>
38 38 #include <sys/uio.h>
39 39 #include <sys/vnode.h>
40 40 #include <sys/vfs.h>
41 41 #include <sys/refstr.h>
42 42 #include <sys/acl.h>
43 43 #include <sys/fcntl.h>
44 44 #include <smbsrv/string.h>
45 45
46 46 #ifdef __cplusplus
47 47 extern "C" {
48 48 #endif
49 49
50 50 #define XATTR_DIR "xattr_dir"
51 51
52 52 #define SMB_STREAM_PREFIX "SUNWsmb"
53 53 #define SMB_STREAM_PREFIX_LEN (sizeof (SMB_STREAM_PREFIX) - 1)
54 54
55 55 #define SMB_SHORTNAMELEN 14
56 56 #define SMB_MAXDIRSIZE 0x7FFFFFFF
57 57
58 58 struct smb_node;
59 59 struct smb_request;
60 60
61 61 /*
62 62 * Note: When specifying the mask for an smb_attr_t,
63 63 * the sa_mask, and not the sa_vattr.va_mask, should be
64 64 * filled in. The #define's that should be used are those
65 65 * prefixed with SMB_AT_*. Only FSIL routines should
66 66 * manipulate the sa_vattr.va_mask field.
67 67 */
68 68 typedef struct smb_attr {
69 69 uint_t sa_mask; /* For both vattr and CIFS attr's */
70 70 vattr_t sa_vattr; /* Legacy vattr */
71 71 uint32_t sa_dosattr; /* DOS attributes */
72 72 timestruc_t sa_crtime; /* Creation time */
73 73 u_offset_t sa_allocsz; /* File allocation size in bytes */
74 74 } smb_attr_t;
75 75
76 76 #define SMB_AT_TYPE 0x00001
77 77 #define SMB_AT_MODE 0x00002
78 78 #define SMB_AT_UID 0x00004
79 79 #define SMB_AT_GID 0x00008
80 80 #define SMB_AT_FSID 0x00010
81 81 #define SMB_AT_NODEID 0x00020
82 82 #define SMB_AT_NLINK 0x00040
83 83 #define SMB_AT_SIZE 0x00080
84 84 #define SMB_AT_ATIME 0x00100
85 85 #define SMB_AT_MTIME 0x00200
86 86 #define SMB_AT_CTIME 0x00400
87 87 #define SMB_AT_RDEV 0x00800
88 88 #define SMB_AT_BLKSIZE 0x01000
89 89 #define SMB_AT_NBLOCKS 0x02000
90 90 #define SMB_AT_SEQ 0x08000
91 91
92 92 #define SMB_AT_DOSATTR 0x00100000
93 93 #define SMB_AT_CRTIME 0x00200000
94 94 #define SMB_AT_ALLOCSZ 0x00400000
95 95
96 96 /*
97 97 * Some useful combinations, for convenience. Some of the sets are
98 98 * based on the info levels of SMB Query File Info.
99 99 */
100 100
101 101 #define SMB_AT_SMB (SMB_AT_DOSATTR|SMB_AT_CRTIME|SMB_AT_ALLOCSZ)
102 102
103 103 #define SMB_AT_TIMES (SMB_AT_ATIME | SMB_AT_MTIME |\
104 104 SMB_AT_CTIME | SMB_AT_CRTIME)
105 105
106 106 /* See SMB_FILE_BASIC_INFORMATION */
107 107 #define SMB_AT_BASIC (SMB_AT_DOSATTR | SMB_AT_TIMES)
108 108
109 109 /* SMB_FILE_STANDARD_INFORMATION (also delete-on-close flag) */
110 110 #define SMB_AT_STANDARD (SMB_AT_TYPE | SMB_AT_NLINK |\
111 111 SMB_AT_SIZE | SMB_AT_ALLOCSZ)
112 112
113 113 /*
114 114 * SMB_FILE_ALL_INFORMATION
115 115 * Note: does not include: SMB_AT_UID, SMB_AT_GID, etc.
116 116 * It's not literally "all", but "all SMB cares about"
117 117 * in vattr_t for any of the file query/set info calls.
|
↓ open down ↓ |
84 lines elided |
↑ open up ↑ |
118 118 */
119 119 #define SMB_AT_ALL (SMB_AT_BASIC | SMB_AT_STANDARD | SMB_AT_NODEID)
120 120
121 121 int fhopen(const struct smb_node *, int);
122 122
123 123 int smb_vop_init(void);
124 124 void smb_vop_fini(void);
125 125 void smb_vop_start(void);
126 126 int smb_vop_open(vnode_t **, int, cred_t *);
127 127 void smb_vop_close(vnode_t *, int, cred_t *);
128 -int smb_vop_read(vnode_t *, uio_t *, cred_t *);
128 +int smb_vop_read(vnode_t *, uio_t *, int, cred_t *);
129 129 int smb_vop_write(vnode_t *, uio_t *, int, uint32_t *, cred_t *);
130 +int smb_vop_ioctl(vnode_t *, int, void *, cred_t *);
130 131 int smb_vop_getattr(vnode_t *, vnode_t *, smb_attr_t *, int, cred_t *);
131 132 int smb_vop_setattr(vnode_t *, vnode_t *, smb_attr_t *, int, cred_t *);
132 133 int smb_vop_space(vnode_t *, int, flock64_t *, int, offset_t, cred_t *);
133 134 int smb_vop_access(vnode_t *, int, int, vnode_t *, cred_t *);
134 135 void smb_vop_eaccess(vnode_t *, int *, int, vnode_t *, cred_t *);
135 136 int smb_vop_lookup(vnode_t *, char *, vnode_t **, char *, int, int *, vnode_t *,
136 137 smb_attr_t *, cred_t *);
137 138 int smb_vop_create(vnode_t *, char *, smb_attr_t *, vnode_t **, int, cred_t *,
138 139 vsecattr_t *);
139 140 int smb_vop_link(vnode_t *, vnode_t *, char *, int, cred_t *);
140 141 int smb_vop_remove(vnode_t *, char *, int, cred_t *);
141 142 int smb_vop_rename(vnode_t *, char *, vnode_t *, char *, int, cred_t *);
142 143 int smb_vop_mkdir(vnode_t *, char *, smb_attr_t *, vnode_t **, int, cred_t *,
143 144 vsecattr_t *);
144 145 int smb_vop_rmdir(vnode_t *, char *, int, cred_t *);
145 146 int smb_vop_readdir(vnode_t *, uint32_t, void *, int *, int *,
146 147 uint32_t, cred_t *);
147 148 int smb_vop_commit(vnode_t *, cred_t *);
148 149 int smb_vop_statfs(vnode_t *, struct statvfs64 *, cred_t *);
149 150 int smb_vop_stream_lookup(vnode_t *, char *, vnode_t **, char *, vnode_t **,
150 151 int, vnode_t *, cred_t *);
151 152 int smb_vop_stream_create(vnode_t *, char *, smb_attr_t *, vnode_t **,
152 153 vnode_t **, int, cred_t *);
153 154 int smb_vop_stream_remove(vnode_t *, char *, int, cred_t *);
154 155 int smb_vop_lookup_xattrdir(vnode_t *, vnode_t **, int, cred_t *);
155 156 int smb_vop_traverse_check(vnode_t **);
156 157
157 158 int smb_vop_acl_read(vnode_t *, acl_t **, int, acl_type_t, cred_t *);
158 159 int smb_vop_acl_write(vnode_t *, acl_t *, int, cred_t *);
159 160 acl_type_t smb_vop_acl_type(vnode_t *);
160 161
161 162 int smb_vop_shrlock(vnode_t *, uint32_t, uint32_t, uint32_t, cred_t *);
162 163 int smb_vop_unshrlock(vnode_t *, uint32_t, cred_t *);
163 164
164 165 int smb_vop_frlock(vnode_t *, cred_t *, int, flock64_t *);
165 166
166 167 int smb_vop_other_opens(vnode_t *, int);
167 168
168 169 void smb_vop_catia_v4tov5(char *, char *, int);
169 170 char *smb_vop_catia_v5tov4(char *, char *, int);
170 171
171 172 #ifdef __cplusplus
172 173 }
173 174 #endif
174 175
175 176 #endif /* _SMBSRV_SMB_VOPS_H */
|
↓ open down ↓ |
36 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX