2 Unix SMB/CIFS implementation.
4 Copyright (C) Stefan (metze) Metzmacher 2003
5 Copyright (C) Volker Lendecke 2009
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program 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 the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
25 * These macros SMB_VFS_<FOO> (and SMB_VFS_NEXT_<FOO>) are our
26 * interface for the VFS.
28 * Don't access conn->vfs_handles[->next]->fns->* directly!
32 #define SMB_VFS_CONNECT(conn, service, user) \
33 smb_vfs_call_connect((conn)->vfs_handles, (service), (user))
34 #define SMB_VFS_NEXT_CONNECT(handle, service, user) \
35 smb_vfs_call_connect((handle)->next, (service), (user))
37 #define SMB_VFS_DISCONNECT(conn) \
38 smb_vfs_call_disconnect((conn)->vfs_handles)
39 #define SMB_VFS_NEXT_DISCONNECT(handle) \
40 smb_vfs_call_disconnect((handle)->next)
42 #define SMB_VFS_DISK_FREE(conn, smb_fname, bsize, dfree ,dsize) \
43 smb_vfs_call_disk_free((conn)->vfs_handles, (smb_fname), (bsize), (dfree), (dsize))
44 #define SMB_VFS_NEXT_DISK_FREE(handle, smb_fname, bsize, dfree ,dsize)\
45 smb_vfs_call_disk_free((handle)->next, (smb_fname), (bsize), (dfree), (dsize))
47 #define SMB_VFS_GET_QUOTA(conn, smb_fname, qtype, id, qt) \
48 smb_vfs_call_get_quota((conn)->vfs_handles, (smb_fname), (qtype), (id), (qt))
49 #define SMB_VFS_NEXT_GET_QUOTA(handle, smb_fname, qtype, id, qt) \
50 smb_vfs_call_get_quota((handle)->next, (smb_fname), (qtype), (id), (qt))
52 #define SMB_VFS_SET_QUOTA(conn, qtype, id, qt) \
53 smb_vfs_call_set_quota((conn)->vfs_handles, (qtype), (id), (qt))
54 #define SMB_VFS_NEXT_SET_QUOTA(handle, qtype, id, qt) \
55 smb_vfs_call_set_quota((handle)->next, (qtype), (id), (qt))
57 #define SMB_VFS_GET_SHADOW_COPY_DATA(fsp,shadow_copy_data,labels) \
58 smb_vfs_call_get_shadow_copy_data((fsp)->conn->vfs_handles, (fsp), (shadow_copy_data), (labels))
59 #define SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle, fsp, shadow_copy_data ,labels) \
60 smb_vfs_call_get_shadow_copy_data((handle)->next, (fsp), (shadow_copy_data), (labels))
62 #define SMB_VFS_STATVFS(conn, smb_fname, statbuf) \
63 smb_vfs_call_statvfs((conn)->vfs_handles, (smb_fname), (statbuf))
64 #define SMB_VFS_NEXT_STATVFS(handle, smb_fname, statbuf) \
65 smb_vfs_call_statvfs((handle)->next, (smb_fname), (statbuf))
67 #define SMB_VFS_FS_CAPABILITIES(conn, p_ts_res) \
68 smb_vfs_call_fs_capabilities((conn)->vfs_handles, (p_ts_res))
69 #define SMB_VFS_NEXT_FS_CAPABILITIES(handle, p_ts_res) \
70 smb_vfs_call_fs_capabilities((handle)->next, (p_ts_res))
73 * Note: that "struct dfs_GetDFSReferral *r"
74 * needs to be a valid TALLOC_CTX
76 #define SMB_VFS_GET_DFS_REFERRALS(conn, r) \
77 smb_vfs_call_get_dfs_referrals((conn)->vfs_handles, (r))
78 #define SMB_VFS_NEXT_GET_DFS_REFERRALS(handle, r) \
79 smb_vfs_call_get_dfs_referrals((handle)->next, (r))
81 #define SMB_VFS_CREATE_DFS_PATHAT(conn, dirfsp, smb_fname, reflist, count) \
82 smb_vfs_call_create_dfs_pathat((conn)->vfs_handles, \
87 #define SMB_VFS_NEXT_CREATE_DFS_PATHAT(handle, dirfsp, smb_fname, reflist, count) \
88 smb_vfs_call_create_dfs_pathat((handle)->next, \
93 #define SMB_VFS_READ_DFS_PATHAT(conn, mem_ctx, dirfsp, smb_fname, ppreflist, pcount) \
94 smb_vfs_call_read_dfs_pathat((conn)->vfs_handles, \
100 #define SMB_VFS_NEXT_READ_DFS_PATHAT(handle, mem_ctx, dirfsp, smb_fname, ppreflist, pcount) \
101 smb_vfs_call_read_dfs_pathat((handle)->next, \
108 /* Directory operations */
109 #define SMB_VFS_FDOPENDIR(fsp, mask, attr) \
110 smb_vfs_call_fdopendir((fsp)->conn->vfs_handles, (fsp), (mask), (attr))
111 #define SMB_VFS_NEXT_FDOPENDIR(handle, fsp, mask, attr) \
112 smb_vfs_call_fdopendir((handle)->next, (fsp), (mask), (attr))
114 #define SMB_VFS_READDIR(conn, dirfsp, dirp, sbuf) \
115 smb_vfs_call_readdir((conn)->vfs_handles, (dirfsp), (dirp), (sbuf))
116 #define SMB_VFS_NEXT_READDIR(handle, dirfsp, dirp, sbuf) \
117 smb_vfs_call_readdir((handle)->next, (dirfsp), (dirp), (sbuf))
119 #define SMB_VFS_SEEKDIR(conn, dirp, offset) \
120 smb_vfs_call_seekdir((conn)->vfs_handles, (dirp), (offset))
121 #define SMB_VFS_NEXT_SEEKDIR(handle, dirp, offset) \
122 smb_vfs_call_seekdir((handle)->next, (dirp), (offset))
124 #define SMB_VFS_TELLDIR(conn, dirp) \
125 smb_vfs_call_telldir((conn)->vfs_handles, (dirp))
126 #define SMB_VFS_NEXT_TELLDIR(handle, dirp) \
127 smb_vfs_call_telldir((handle)->next, (dirp))
129 #define SMB_VFS_REWINDDIR(conn, dirp) \
130 smb_vfs_call_rewind_dir((conn)->vfs_handles, (dirp))
131 #define SMB_VFS_NEXT_REWINDDIR(handle, dirp) \
132 smb_vfs_call_rewind_dir((handle)->next, (dirp))
134 #define SMB_VFS_MKDIRAT(conn, dirfsp, smb_fname, mode) \
135 smb_vfs_call_mkdirat((conn)->vfs_handles,(dirfsp), (smb_fname), (mode))
136 #define SMB_VFS_NEXT_MKDIRAT(handle, dirfsp, smb_fname, mode) \
137 smb_vfs_call_mkdirat((handle)->next,(dirfsp), (smb_fname), (mode))
139 #define SMB_VFS_CLOSEDIR(conn, dir) \
140 smb_vfs_call_closedir((conn)->vfs_handles, dir)
141 #define SMB_VFS_NEXT_CLOSEDIR(handle, dir) \
142 smb_vfs_call_closedir((handle)->next, (dir))
144 /* File operations */
145 #define SMB_VFS_OPENAT(conn, dirfsp, smb_fname, fsp, flags, mode) \
146 smb_vfs_call_openat((conn)->vfs_handles, (dirfsp), (smb_fname), (fsp), (flags), (mode))
147 #define SMB_VFS_NEXT_OPENAT(handle, dirfsp, smb_fname, fsp, flags, mode) \
148 smb_vfs_call_openat((handle)->next, (dirfsp), (smb_fname), (fsp), (flags), (mode))
150 #define SMB_VFS_CREATE_FILE(conn, req, smb_fname, access_mask, share_access, create_disposition, \
151 create_options, file_attributes, oplock_request, lease, allocation_size, private_flags, sd, ea_list, result, pinfo, in_context_blobs, out_context_blobs) \
152 smb_vfs_call_create_file((conn)->vfs_handles, (req), (smb_fname), (access_mask), (share_access), (create_disposition), \
153 (create_options), (file_attributes), (oplock_request), (lease), (allocation_size), (private_flags), (sd), (ea_list), (result), (pinfo), \
154 (in_context_blobs), (out_context_blobs))
155 #define SMB_VFS_NEXT_CREATE_FILE(handle, req, smb_fname, access_mask, share_access, create_disposition, \
156 create_options, file_attributes, oplock_request, lease, allocation_size, private_flags, sd, ea_list, result, pinfo, in_context_blobs, out_context_blobs) \
157 smb_vfs_call_create_file((handle)->next, (req), (smb_fname), (access_mask), (share_access), (create_disposition), \
158 (create_options), (file_attributes), (oplock_request), (lease), (allocation_size), (private_flags), (sd), (ea_list), (result), (pinfo), \
159 (in_context_blobs), (out_context_blobs))
161 #define SMB_VFS_CLOSE(fsp) \
162 smb_vfs_call_close((fsp)->conn->vfs_handles, (fsp))
163 #define SMB_VFS_NEXT_CLOSE(handle, fsp) \
164 smb_vfs_call_close((handle)->next, (fsp))
166 #define SMB_VFS_PREAD(fsp, data, n, off) \
167 smb_vfs_call_pread((fsp)->conn->vfs_handles, (fsp), (data), (n), (off))
168 #define SMB_VFS_NEXT_PREAD(handle, fsp, data, n, off) \
169 smb_vfs_call_pread((handle)->next, (fsp), (data), (n), (off))
171 #define SMB_VFS_PREAD_SEND(mem_ctx, ev, fsp, data, n, off) \
172 smb_vfs_call_pread_send((fsp)->conn->vfs_handles, (mem_ctx), (ev), \
173 (fsp), (data), (n), (off))
174 #define SMB_VFS_NEXT_PREAD_SEND(mem_ctx, ev, handle, fsp, data, n, off) \
175 smb_vfs_call_pread_send((handle)->next, (mem_ctx), (ev), (fsp), \
178 #define SMB_VFS_PWRITE(fsp, data, n, off) \
179 smb_vfs_call_pwrite((fsp)->conn->vfs_handles, (fsp), (data), (n), (off))
180 #define SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, off) \
181 smb_vfs_call_pwrite((handle)->next, (fsp), (data), (n), (off))
183 #define SMB_VFS_PWRITE_SEND(mem_ctx, ev, fsp, data, n, off) \
184 smb_vfs_call_pwrite_send((fsp)->conn->vfs_handles, (mem_ctx), (ev), \
185 (fsp), (data), (n), (off))
186 #define SMB_VFS_NEXT_PWRITE_SEND(mem_ctx, ev, handle, fsp, data, n, off) \
187 smb_vfs_call_pwrite_send((handle)->next, (mem_ctx), (ev), (fsp), \
190 #define SMB_VFS_LSEEK(fsp, offset, whence) \
191 smb_vfs_call_lseek((fsp)->conn->vfs_handles, (fsp), (offset), (whence))
192 #define SMB_VFS_NEXT_LSEEK(handle, fsp, offset, whence) \
193 smb_vfs_call_lseek((handle)->next, (fsp), (offset), (whence))
195 #define SMB_VFS_SENDFILE(tofd, fromfsp, header, offset, count) \
196 smb_vfs_call_sendfile((fromfsp)->conn->vfs_handles, (tofd), (fromfsp), (header), (offset), (count))
197 #define SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp, header, offset, count) \
198 smb_vfs_call_sendfile((handle)->next, (tofd), (fromfsp), (header), (offset), (count))
200 #define SMB_VFS_RECVFILE(fromfd, tofsp, offset, count) \
201 smb_vfs_call_recvfile((tofsp)->conn->vfs_handles, (fromfd), (tofsp), (offset), (count))
202 #define SMB_VFS_NEXT_RECVFILE(handle, fromfd, tofsp, offset, count) \
203 smb_vfs_call_recvfile((handle)->next, (fromfd), (tofsp), (offset), (count))
205 #define SMB_VFS_RENAMEAT(conn, oldfsp, old, newfsp, new) \
206 smb_vfs_call_renameat((conn)->vfs_handles, (oldfsp), (old), (newfsp), (new))
207 #define SMB_VFS_NEXT_RENAMEAT(handle, oldfsp, old, newfsp, new) \
208 smb_vfs_call_renameat((handle)->next, (oldfsp), (old), (newfsp), (new))
210 #define SMB_VFS_FSYNC(fsp) \
211 smb_vfs_call_fsync((fsp)->conn->vfs_handles, (fsp))
212 #define SMB_VFS_NEXT_FSYNC(handle, fsp) \
213 smb_vfs_call_fsync((handle)->next, (fsp))
215 #define SMB_VFS_FSYNC_SEND(mem_ctx, ev, fsp) \
216 smb_vfs_call_fsync_send((fsp)->conn->vfs_handles, (mem_ctx), (ev), \
218 #define SMB_VFS_NEXT_FSYNC_SEND(mem_ctx, ev, handle, fsp) \
219 smb_vfs_call_fsync_send((handle)->next, (mem_ctx), (ev), (fsp))
221 #define SMB_VFS_STAT(conn, smb_fname) \
222 smb_vfs_call_stat((conn)->vfs_handles, (smb_fname))
223 #define SMB_VFS_NEXT_STAT(handle, smb_fname) \
224 smb_vfs_call_stat((handle)->next, (smb_fname))
226 #define SMB_VFS_FSTAT(fsp, sbuf) \
227 smb_vfs_call_fstat((fsp)->conn->vfs_handles, (fsp), (sbuf))
228 #define SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf) \
229 smb_vfs_call_fstat((handle)->next, (fsp), (sbuf))
231 #define SMB_VFS_LSTAT(conn, smb_fname) \
232 smb_vfs_call_lstat((conn)->vfs_handles, (smb_fname))
233 #define SMB_VFS_NEXT_LSTAT(handle, smb_fname) \
234 smb_vfs_call_lstat((handle)->next, (smb_fname))
236 #define SMB_VFS_GET_ALLOC_SIZE(conn, fsp, sbuf) \
237 smb_vfs_call_get_alloc_size((conn)->vfs_handles, (fsp), (sbuf))
238 #define SMB_VFS_NEXT_GET_ALLOC_SIZE(conn, fsp, sbuf) \
239 smb_vfs_call_get_alloc_size((conn)->next, (fsp), (sbuf))
241 #define SMB_VFS_UNLINKAT(conn, dirfsp, path, flags) \
242 smb_vfs_call_unlinkat((conn)->vfs_handles, (dirfsp), (path), (flags))
243 #define SMB_VFS_NEXT_UNLINKAT(handle, dirfsp, path, flags) \
244 smb_vfs_call_unlinkat((handle)->next, (dirfsp), (path), (flags))
246 #define SMB_VFS_CHMOD(conn, smb_fname, mode) \
247 smb_vfs_call_chmod((conn)->vfs_handles, (smb_fname), (mode))
248 #define SMB_VFS_NEXT_CHMOD(handle, smb_fname, mode) \
249 smb_vfs_call_chmod((handle)->next, (smb_fname), (mode))
251 #define SMB_VFS_FCHMOD(fsp, mode) \
252 smb_vfs_call_fchmod((fsp)->conn->vfs_handles, (fsp), (mode))
253 #define SMB_VFS_NEXT_FCHMOD(handle, fsp, mode) \
254 smb_vfs_call_fchmod((handle)->next, (fsp), (mode))
256 #define SMB_VFS_FCHOWN(fsp, uid, gid) \
257 smb_vfs_call_fchown((fsp)->conn->vfs_handles, (fsp), (uid), (gid))
258 #define SMB_VFS_NEXT_FCHOWN(handle, fsp, uid, gid) \
259 smb_vfs_call_fchown((handle)->next, (fsp), (uid), (gid))
261 #define SMB_VFS_LCHOWN(conn, smb_fname, uid, gid) \
262 smb_vfs_call_lchown((conn)->vfs_handles, (smb_fname), (uid), (gid))
263 #define SMB_VFS_NEXT_LCHOWN(handle, smb_fname, uid, gid) \
264 smb_vfs_call_lchown((handle)->next, (smb_fname), (uid), (gid))
266 #define SMB_VFS_CHDIR(conn, smb_fname) \
267 smb_vfs_call_chdir((conn)->vfs_handles, (smb_fname))
268 #define SMB_VFS_NEXT_CHDIR(handle, smb_fname) \
269 smb_vfs_call_chdir((handle)->next, (smb_fname))
271 #define SMB_VFS_GETWD(conn, ctx) \
272 smb_vfs_call_getwd((conn)->vfs_handles, (ctx))
273 #define SMB_VFS_NEXT_GETWD(handle, ctx) \
274 smb_vfs_call_getwd((handle)->next, (ctx))
276 #define SMB_VFS_NTIMES(conn, path, ts) \
277 smb_vfs_call_ntimes((conn)->vfs_handles, (path), (ts))
278 #define SMB_VFS_NEXT_NTIMES(handle, path, ts) \
279 smb_vfs_call_ntimes((handle)->next, (path), (ts))
281 #define SMB_VFS_FTRUNCATE(fsp, offset) \
282 smb_vfs_call_ftruncate((fsp)->conn->vfs_handles, (fsp), (offset))
283 #define SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset) \
284 smb_vfs_call_ftruncate((handle)->next, (fsp), (offset))
286 #define SMB_VFS_FALLOCATE(fsp, mode, offset, len) \
287 smb_vfs_call_fallocate((fsp)->conn->vfs_handles, (fsp), (mode), (offset), (len))
288 #define SMB_VFS_NEXT_FALLOCATE(handle, fsp, mode, offset, len) \
289 smb_vfs_call_fallocate((handle)->next, (fsp), (mode), (offset), (len))
291 #define SMB_VFS_LOCK(fsp, op, offset, count, type) \
292 smb_vfs_call_lock((fsp)->conn->vfs_handles, (fsp), (op), (offset), (count), (type))
293 #define SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type) \
294 smb_vfs_call_lock((handle)->next, (fsp), (op), (offset), (count), (type))
296 #define SMB_VFS_KERNEL_FLOCK(fsp, share_access, access_mask) \
297 smb_vfs_call_kernel_flock((fsp)->conn->vfs_handles, (fsp), (share_access), (access_mask))
298 #define SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_access, access_mask) \
299 smb_vfs_call_kernel_flock((handle)->next, (fsp), (share_access), (access_mask))
301 #define SMB_VFS_FCNTL(fsp, cmd, ...) \
302 smb_vfs_call_fcntl((fsp)->conn->vfs_handles, (fsp), (cmd), (__VA_ARGS__))
303 #define SMB_VFS_NEXT_FCNTL(handle, fsp, cmd, ...) \
304 smb_vfs_call_fcntl((handle)->next, (fsp), (cmd), (__VA_ARGS__))
306 #define SMB_VFS_LINUX_SETLEASE(fsp, leasetype) \
307 smb_vfs_call_linux_setlease((fsp)->conn->vfs_handles, (fsp), (leasetype))
308 #define SMB_VFS_NEXT_LINUX_SETLEASE(handle, fsp, leasetype) \
309 smb_vfs_call_linux_setlease((handle)->next, (fsp), (leasetype))
311 #define SMB_VFS_GETLOCK(fsp, poffset, pcount, ptype, ppid) \
312 smb_vfs_call_getlock((fsp)->conn->vfs_handles, (fsp), (poffset), (pcount), (ptype), (ppid))
313 #define SMB_VFS_NEXT_GETLOCK(handle, fsp, poffset, pcount, ptype, ppid) \
314 smb_vfs_call_getlock((handle)->next, (fsp), (poffset), (pcount), (ptype), (ppid))
316 #define SMB_VFS_SYMLINKAT(conn, oldpath, dirfsp, newpath) \
317 smb_vfs_call_symlinkat((conn)->vfs_handles, (oldpath), (dirfsp), (newpath))
318 #define SMB_VFS_NEXT_SYMLINKAT(handle, oldpath, dirfsp, newpath) \
319 smb_vfs_call_symlinkat((handle)->next, (oldpath), (dirfsp), (newpath))
321 #define SMB_VFS_READLINKAT(conn, dirfsp, smb_fname, buf, bufsiz) \
322 smb_vfs_call_readlinkat((conn)->vfs_handles, (dirfsp), (smb_fname), (buf), (bufsiz))
323 #define SMB_VFS_NEXT_READLINKAT(handle, dirfsp, smb_fname, buf, bufsiz) \
324 smb_vfs_call_readlinkat((handle)->next, (dirfsp), (smb_fname), (buf), (bufsiz))
326 #define SMB_VFS_LINKAT(conn, srcfsp, oldpath, dstfsp, newpath, flags) \
327 smb_vfs_call_linkat((conn)->vfs_handles, (srcfsp), (oldpath), (dstfsp), (newpath), (flags))
328 #define SMB_VFS_NEXT_LINKAT(handle, srcfsp, oldpath, dstfsp, newpath, flags) \
329 smb_vfs_call_linkat((handle)->next, (srcfsp), (oldpath), (dstfsp), (newpath), (flags))
331 #define SMB_VFS_MKNODAT(conn, dirfsp, smb_fname, mode, dev) \
332 smb_vfs_call_mknodat((conn)->vfs_handles, (dirfsp), (smb_fname), (mode), (dev))
333 #define SMB_VFS_NEXT_MKNODAT(handle, dirfsp, smb_fname, mode, dev) \
334 smb_vfs_call_mknodat((handle)->next, (dirfsp), (smb_fname), (mode), (dev))
336 #define SMB_VFS_REALPATH(conn, ctx, smb_fname) \
337 smb_vfs_call_realpath((conn)->vfs_handles, (ctx), (smb_fname))
338 #define SMB_VFS_NEXT_REALPATH(handle, ctx, smb_fname) \
339 smb_vfs_call_realpath((handle)->next, (ctx), (smb_fname))
341 #define SMB_VFS_CHFLAGS(conn, smb_fname, flags) \
342 smb_vfs_call_chflags((conn)->vfs_handles, (smb_fname), (flags))
343 #define SMB_VFS_NEXT_CHFLAGS(handle, smb_fname, flags) \
344 smb_vfs_call_chflags((handle)->next, (smb_fname), (flags))
346 #define SMB_VFS_FILE_ID_CREATE(conn, sbuf) \
347 smb_vfs_call_file_id_create((conn)->vfs_handles, (sbuf))
348 #define SMB_VFS_NEXT_FILE_ID_CREATE(handle, sbuf) \
349 smb_vfs_call_file_id_create((handle)->next, (sbuf))
351 #define SMB_VFS_FS_FILE_ID(conn, sbuf) \
352 smb_vfs_call_fs_file_id((conn)->vfs_handles, (sbuf))
353 #define SMB_VFS_NEXT_FS_FILE_ID(handle, sbuf) \
354 smb_vfs_call_fs_file_id((handle)->next, (sbuf))
356 #define SMB_VFS_STREAMINFO(conn, fsp, smb_fname, mem_ctx, num_streams, streams) \
357 smb_vfs_call_streaminfo((conn)->vfs_handles, (fsp), (smb_fname), (mem_ctx), (num_streams), (streams))
358 #define SMB_VFS_NEXT_STREAMINFO(handle, fsp, smb_fname, mem_ctx, num_streams, streams) \
359 smb_vfs_call_streaminfo((handle)->next, (fsp), (smb_fname), (mem_ctx), (num_streams), (streams))
361 #define SMB_VFS_GET_REAL_FILENAME(conn, path, name, mem_ctx, found_name) \
362 smb_vfs_call_get_real_filename((conn)->vfs_handles, (path), (name), (mem_ctx), (found_name))
363 #define SMB_VFS_NEXT_GET_REAL_FILENAME(handle, path, name, mem_ctx, found_name) \
364 smb_vfs_call_get_real_filename((handle)->next, (path), (name), (mem_ctx), (found_name))
366 #define SMB_VFS_CONNECTPATH(conn, smb_fname) \
367 smb_vfs_call_connectpath((conn)->vfs_handles, (smb_fname))
368 #define SMB_VFS_NEXT_CONNECTPATH(conn, smb_fname) \
369 smb_vfs_call_connectpath((conn)->next, (smb_fname))
371 #define SMB_VFS_BRL_LOCK_WINDOWS(conn, br_lck, plock) \
372 smb_vfs_call_brl_lock_windows((conn)->vfs_handles, (br_lck), (plock))
373 #define SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle, br_lck, plock) \
374 smb_vfs_call_brl_lock_windows((handle)->next, (br_lck), (plock))
376 #define SMB_VFS_BRL_UNLOCK_WINDOWS(conn, br_lck, plock) \
377 smb_vfs_call_brl_unlock_windows((conn)->vfs_handles, (br_lck), (plock))
378 #define SMB_VFS_NEXT_BRL_UNLOCK_WINDOWS(handle, br_lck, plock) \
379 smb_vfs_call_brl_unlock_windows((handle)->next, (br_lck), (plock))
381 #define SMB_VFS_STRICT_LOCK_CHECK(conn, fsp, plock) \
382 smb_vfs_call_strict_lock_check((conn)->vfs_handles, (fsp), (plock))
383 #define SMB_VFS_NEXT_STRICT_LOCK_CHECK(handle, fsp, plock) \
384 smb_vfs_call_strict_lock_check((handle)->next, (fsp), (plock))
386 #define SMB_VFS_TRANSLATE_NAME(conn, name, direction, mem_ctx, mapped_name) \
387 smb_vfs_call_translate_name((conn)->vfs_handles, (name), (direction), (mem_ctx), (mapped_name))
388 #define SMB_VFS_NEXT_TRANSLATE_NAME(handle, name, direction, mem_ctx, mapped_name) \
389 smb_vfs_call_translate_name((handle)->next, (name), (direction), (mem_ctx), (mapped_name))
391 #define SMB_VFS_FSCTL(fsp, ctx, function, req_flags, in_data, in_len, out_data, max_out_len, out_len) \
392 smb_vfs_call_fsctl((fsp)->conn->vfs_handles, (fsp), (ctx), (function), (req_flags), (in_data), (in_len), (out_data), (max_out_len), (out_len))
394 #define SMB_VFS_NEXT_FSCTL(handle, fsp, ctx, function, req_flags, in_data, in_len, out_data, max_out_len, out_len) \
395 smb_vfs_call_fsctl((handle)->next, (fsp), (ctx), (function), (req_flags), (in_data), (in_len), (out_data), (max_out_len), (out_len))
397 #define SMB_VFS_FGET_DOS_ATTRIBUTES(conn, fsp, attributes) \
398 smb_vfs_call_fget_dos_attributes((conn)->vfs_handles, (fsp), (attributes))
399 #define SMB_VFS_NEXT_FGET_DOS_ATTRIBUTES(handle, fsp, attributes) \
400 smb_vfs_call_fget_dos_attributes((handle)->next, (fsp), (attributes))
402 #define SMB_VFS_GET_DOS_ATTRIBUTES_SEND(mem_ctx, evg, dir_fsp, smb_fname) \
403 smb_vfs_call_get_dos_attributes_send((mem_ctx), (evg), \
404 (dir_fsp)->conn->vfs_handles, \
405 (dir_fsp), (smb_fname))
406 #define SMB_VFS_GET_DOS_ATTRIBUTES_RECV(req, aio_state, dosmode) \
407 smb_vfs_call_get_dos_attributes_recv((req), (aio_state), (dosmode))
409 #define SMB_VFS_NEXT_GET_DOS_ATTRIBUTES_SEND(mem_ctx, evg, handle, dir_fsp, \
411 smb_vfs_call_get_dos_attributes_send((mem_ctx), (evg), \
413 (dir_fsp), (smb_fname))
414 #define SMB_VFS_NEXT_GET_DOS_ATTRIBUTES_RECV(req, aio_state, dosmode) \
415 smb_vfs_call_get_dos_attributes_recv((req), (aio_state), (dosmode))
417 #define SMB_VFS_SET_DOS_ATTRIBUTES(conn, smb_fname, attributes) \
418 smb_vfs_call_set_dos_attributes((conn)->vfs_handles, (smb_fname), (attributes))
419 #define SMB_VFS_NEXT_SET_DOS_ATTRIBUTES(handle, smb_fname, attributes) \
420 smb_vfs_call_set_dos_attributes((handle)->next, (smb_fname), (attributes))
421 #define SMB_VFS_FSET_DOS_ATTRIBUTES(conn, fsp, attributes) \
422 smb_vfs_call_fset_dos_attributes((conn)->vfs_handles, (fsp), (attributes))
423 #define SMB_VFS_NEXT_FSET_DOS_ATTRIBUTES(handle, fsp, attributes) \
424 smb_vfs_call_fset_dos_attributes((handle)->next, (fsp), (attributes))
426 #define SMB_VFS_OFFLOAD_READ_SEND(mem_ctx, ev, fsp, fsctl, ttl, offset, to_copy) \
427 smb_vfs_call_offload_read_send((mem_ctx), (ev), (fsp)->conn->vfs_handles, fsp, (fsctl), (ttl), (offset), (to_copy))
428 #define SMB_VFS_NEXT_OFFLOAD_READ_SEND(mem_ctx, ev, handle, fsp, fsctl, ttl, offset, to_copy) \
429 smb_vfs_call_offload_read_send((mem_ctx), (ev), (handle)->next, (fsp), (fsctl), (ttl), (offset), (to_copy))
431 #define SMB_VFS_OFFLOAD_READ_RECV(req, conn, mem_ctx, token_blob) \
432 smb_vfs_call_offload_read_recv((req), (conn)->vfs_handles, (mem_ctx), (token_blob))
433 #define SMB_VFS_NEXT_OFFLOAD_READ_RECV(req, handle, mem_ctx, token_blob) \
434 smb_vfs_call_offload_read_recv((req), (handle)->next, (mem_ctx), (token_blob))
436 #define SMB_VFS_OFFLOAD_WRITE_SEND(conn, mem_ctx, ev, fsctl, token, transfer_offset, dest_fsp, dest_off, num) \
437 smb_vfs_call_offload_write_send((conn)->vfs_handles, (mem_ctx), (ev), (fsctl), (token), (transfer_offset), (dest_fsp), (dest_off), (num))
438 #define SMB_VFS_NEXT_OFFLOAD_WRITE_SEND(handle, mem_ctx, ev, fsctl, token, transfer_offset, dest_fsp, dest_off, num) \
439 smb_vfs_call_offload_write_send((handle)->next, (mem_ctx), (ev), (fsctl), (token), (transfer_offset), (dest_fsp), (dest_off), (num))
441 #define SMB_VFS_OFFLOAD_WRITE_RECV(conn, req, copied) \
442 smb_vfs_call_offload_write_recv((conn)->vfs_handles, (req), (copied))
443 #define SMB_VFS_NEXT_OFFLOAD_WRITE_RECV(handle, req, copied) \
444 smb_vfs_call_offload_write_recv((handle)->next, (req), (copied))
446 #define SMB_VFS_FGET_COMPRESSION(conn, mem_ctx, fsp, _compression_fmt) \
447 smb_vfs_call_fget_compression((conn)->vfs_handles, (mem_ctx), (fsp), (_compression_fmt))
448 #define SMB_VFS_NEXT_FGET_COMPRESSION(handle, mem_ctx, fsp, _compression_fmt) \
449 smb_vfs_call_fget_compression((handle)->next, (mem_ctx), (fsp), (_compression_fmt))
451 #define SMB_VFS_SET_COMPRESSION(conn, mem_ctx, fsp, compression_fmt) \
452 smb_vfs_call_set_compression((conn)->vfs_handles, (mem_ctx), (fsp), (compression_fmt))
453 #define SMB_VFS_NEXT_SET_COMPRESSION(handle, mem_ctx, fsp, compression_fmt) \
454 smb_vfs_call_set_compression((handle)->next, (mem_ctx), (fsp), (compression_fmt))
456 #define SMB_VFS_SNAP_CHECK_PATH(conn, mem_ctx, service_path, base_volume) \
457 smb_vfs_call_snap_check_path((conn)->vfs_handles, (mem_ctx), (service_path), (base_volume))
458 #define SMB_VFS_NEXT_SNAP_CHECK_PATH(handle, mem_ctx, service_path, base_volume) \
459 smb_vfs_call_snap_check_path((handle)->next, (mem_ctx), (service_path), (base_volume))
461 #define SMB_VFS_SNAP_CREATE(conn, mem_ctx, base_volume, tstamp, rw, base_path, snap_path) \
462 smb_vfs_call_snap_create((conn)->vfs_handles, (mem_ctx), (base_volume), (tstamp), (rw), (base_path), (snap_path))
463 #define SMB_VFS_NEXT_SNAP_CREATE(handle, mem_ctx, base_volume, tstamp, rw, base_path, snap_path) \
464 smb_vfs_call_snap_create((handle)->next, (mem_ctx), (base_volume), (tstamp), (rw), (base_path), (snap_path))
466 #define SMB_VFS_SNAP_DELETE(conn, mem_ctx, base_path, snap_path) \
467 smb_vfs_call_snap_delete((conn)->vfs_handles, (mem_ctx), (base_path), (snap_path))
468 #define SMB_VFS_NEXT_SNAP_DELETE(handle, mem_ctx, base_path, snap_path) \
469 smb_vfs_call_snap_delete((handle)->next, (mem_ctx), (base_path), (snap_path))
471 #define SMB_VFS_FGET_NT_ACL(fsp, security_info, mem_ctx, ppdesc) \
472 smb_vfs_call_fget_nt_acl((fsp)->conn->vfs_handles, (fsp), (security_info), (mem_ctx), (ppdesc))
473 #define SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, mem_ctx, ppdesc) \
474 smb_vfs_call_fget_nt_acl((handle)->next, (fsp), (security_info), (mem_ctx), (ppdesc))
476 #define SMB_VFS_GET_NT_ACL_AT(conn, dirfsp, smb_fname, security_info, mem_ctx, ppdesc) \
477 smb_vfs_call_get_nt_acl_at((conn)->vfs_handles, (dirfsp), (smb_fname), (security_info), (mem_ctx), (ppdesc))
478 #define SMB_VFS_NEXT_GET_NT_ACL_AT(handle, dirfsp, smb_fname, security_info, mem_ctx, ppdesc) \
479 smb_vfs_call_get_nt_acl_at((handle)->next, (dirfsp), (smb_fname), (security_info), (mem_ctx), (ppdesc))
481 #define SMB_VFS_AUDIT_FILE(conn, name, sacl, access_requested, access_denied) \
482 smb_vfs_call_audit_file((conn)->vfs_handles, (name), (sacl), (access_requested), (access_denied))
483 #define SMB_VFS_NEXT_AUDIT_FILE(handle, name, sacl, access_requested, access_denied) \
484 smb_vfs_call_audit_file((handle)->next, (name), (sacl), (access_requested), (access_denied))
486 #define SMB_VFS_FSET_NT_ACL(fsp, security_info_sent, psd) \
487 smb_vfs_call_fset_nt_acl((fsp)->conn->vfs_handles, (fsp), (security_info_sent), (psd))
488 #define SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd) \
489 smb_vfs_call_fset_nt_acl((handle)->next, (fsp), (security_info_sent), (psd))
491 #define SMB_VFS_SYS_ACL_GET_FILE(conn, smb_fname, type, mem_ctx) \
492 smb_vfs_call_sys_acl_get_file((conn)->vfs_handles, (smb_fname), (type), (mem_ctx))
493 #define SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, smb_fname, type, mem_ctx) \
494 smb_vfs_call_sys_acl_get_file((handle)->next, (smb_fname), (type), (mem_ctx))
496 #define SMB_VFS_SYS_ACL_GET_FD(fsp, mem_ctx) \
497 smb_vfs_call_sys_acl_get_fd((fsp)->conn->vfs_handles, (fsp), (mem_ctx))
498 #define SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp, mem_ctx) \
499 smb_vfs_call_sys_acl_get_fd((handle)->next, (fsp), (mem_ctx))
501 #define SMB_VFS_SYS_ACL_BLOB_GET_FILE(conn, smb_fname, mem_ctx, blob_description, blob) \
502 smb_vfs_call_sys_acl_blob_get_file((conn)->vfs_handles, (smb_fname), (mem_ctx), (blob_description), (blob))
503 #define SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle, smb_fname, mem_ctx, blob_description, blob) \
504 smb_vfs_call_sys_acl_blob_get_file((handle)->next, (smb_fname), (mem_ctx), (blob_description), (blob))
506 #define SMB_VFS_SYS_ACL_BLOB_GET_FD(fsp, mem_ctx, blob_description, blob) \
507 smb_vfs_call_sys_acl_blob_get_fd((fsp)->conn->vfs_handles, (fsp), (mem_ctx), (blob_description), (blob))
508 #define SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FD(handle, fsp, mem_ctx, blob_description, blob) \
509 smb_vfs_call_sys_acl_blob_get_fd((handle)->next, (fsp), mem_ctx, (blob_description), (blob))
511 #define SMB_VFS_SYS_ACL_SET_FD(fsp, type, theacl) \
512 smb_vfs_call_sys_acl_set_fd((fsp)->conn->vfs_handles, (fsp), (type), (theacl))
513 #define SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, type, theacl) \
514 smb_vfs_call_sys_acl_set_fd((handle)->next, (fsp), (type), (theacl))
516 #define SMB_VFS_SYS_ACL_DELETE_DEF_FILE(conn, smb_fname) \
517 smb_vfs_call_sys_acl_delete_def_file((conn)->vfs_handles, (smb_fname))
518 #define SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, smb_fname) \
519 smb_vfs_call_sys_acl_delete_def_file((handle)->next, (smb_fname))
521 #define SMB_VFS_GETXATTR(conn,smb_fname,name,value,size) \
522 smb_vfs_call_getxattr((conn)->vfs_handles,(smb_fname),(name),(value),(size))
523 #define SMB_VFS_NEXT_GETXATTR(handle,smb_fname,name,value,size) \
524 smb_vfs_call_getxattr((handle)->next,(smb_fname),(name),(value),(size))
526 #define SMB_VFS_GETXATTRAT_SEND(mem_ctx,ev,dir_fsp,smb_fname, \
527 xattr_name, alloc_hint) \
528 smb_vfs_call_getxattrat_send((mem_ctx),(ev), \
529 (dir_fsp)->conn->vfs_handles, \
530 (dir_fsp),(smb_fname),(xattr_name), \
532 #define SMB_VFS_GETXATTRAT_RECV(req, aio_state, mem_ctx, xattr_value) \
533 smb_vfs_call_getxattrat_recv((req),(aio_state),(mem_ctx),(xattr_value))
535 #define SMB_VFS_NEXT_GETXATTRAT_SEND(mem_ctx,ev,handle,dir_fsp,smb_fname, \
536 xattr_name,alloc_hint) \
537 smb_vfs_call_getxattrat_send((mem_ctx),(ev), \
539 (dir_fsp), (smb_fname),(xattr_name), \
541 #define SMB_VFS_NEXT_GETXATTRAT_RECV(req, aio_state, mem_ctx, xattr_value) \
542 smb_vfs_call_getxattrat_recv((req),(aio_state),(mem_ctx),(xattr_value))
544 #define SMB_VFS_FGETXATTR(fsp,name,value,size) \
545 smb_vfs_call_fgetxattr((fsp)->conn->vfs_handles, (fsp), (name),(value),(size))
546 #define SMB_VFS_NEXT_FGETXATTR(handle,fsp,name,value,size) \
547 smb_vfs_call_fgetxattr((handle)->next,(fsp),(name),(value),(size))
549 #define SMB_VFS_LISTXATTR(conn,smb_fname,list,size) \
550 smb_vfs_call_listxattr((conn)->vfs_handles,(smb_fname),(list),(size))
551 #define SMB_VFS_NEXT_LISTXATTR(handle,smb_fname,list,size) \
552 smb_vfs_call_listxattr((handle)->next,(smb_fname),(list),(size))
554 #define SMB_VFS_FLISTXATTR(fsp,list,size) \
555 smb_vfs_call_flistxattr((fsp)->conn->vfs_handles, (fsp), (list),(size))
556 #define SMB_VFS_NEXT_FLISTXATTR(handle,fsp,list,size) \
557 smb_vfs_call_flistxattr((handle)->next,(fsp),(list),(size))
559 #define SMB_VFS_REMOVEXATTR(conn,smb_fname,name) \
560 smb_vfs_call_removexattr((conn)->vfs_handles,(smb_fname),(name))
561 #define SMB_VFS_NEXT_REMOVEXATTR(handle,smb_fname,name) \
562 smb_vfs_call_removexattr((handle)->next,(smb_fname),(name))
564 #define SMB_VFS_FREMOVEXATTR(fsp,name) \
565 smb_vfs_call_fremovexattr((fsp)->conn->vfs_handles, (fsp), (name))
566 #define SMB_VFS_NEXT_FREMOVEXATTR(handle,fsp,name) \
567 smb_vfs_call_fremovexattr((handle)->next,(fsp),(name))
569 #define SMB_VFS_SETXATTR(conn,smb_fname,name,value,size,flags) \
570 smb_vfs_call_setxattr((conn)->vfs_handles,(smb_fname),(name),(value),(size),(flags))
571 #define SMB_VFS_NEXT_SETXATTR(handle,smb_fname,name,value,size,flags) \
572 smb_vfs_call_setxattr((handle)->next,(smb_fname),(name),(value),(size),(flags))
574 #define SMB_VFS_FSETXATTR(fsp,name,value,size,flags) \
575 smb_vfs_call_fsetxattr((fsp)->conn->vfs_handles, (fsp), (name),(value),(size),(flags))
576 #define SMB_VFS_NEXT_FSETXATTR(handle,fsp,name,value,size,flags) \
577 smb_vfs_call_fsetxattr((handle)->next,(fsp),(name),(value),(size),(flags))
579 #define SMB_VFS_AIO_FORCE(fsp) \
580 smb_vfs_call_aio_force((fsp)->conn->vfs_handles, (fsp))
581 #define SMB_VFS_NEXT_AIO_FORCE(handle,fsp) \
582 smb_vfs_call_aio_force((handle)->next,(fsp))
584 /* durable handle operations */
586 #define SMB_VFS_DURABLE_COOKIE(fsp, mem_ctx, cookie) \
587 smb_vfs_call_durable_cookie((fsp)->conn->vfs_handles, \
588 (fsp), (mem_ctx), (cookie))
589 #define SMB_VFS_NEXT_DURABLE_COOKIE(handle, fsp, mem_ctx, cookie) \
590 smb_vfs_call_durable_cookie((handle)->next, \
591 (fsp), (mem_ctx), (cookie))
593 #define SMB_VFS_DURABLE_DISCONNECT(fsp, old_cookie, mem_ctx, new_cookie) \
594 smb_vfs_call_durable_disconnect((fsp)->conn->vfs_handles, \
595 (fsp), (old_cookie), (mem_ctx), (new_cookie))
596 #define SMB_VFS_NEXT_DURABLE_DISCONNECT(handle, fsp, old_cookie, mem_ctx, new_cookie) \
597 smb_vfs_call_durable_disconnect((handle)->next, \
598 (fsp), (old_cookie), (mem_ctx), (new_cookie))
600 #define SMB_VFS_DURABLE_RECONNECT(conn, smb1req, op, old_cookie, mem_ctx, fsp, new_cookie) \
601 smb_vfs_call_durable_reconnect((conn)->vfs_handles, \
602 (smb1req), (op), (old_cookie), \
603 (mem_ctx), (fsp), (new_cookie))
604 #define SMB_VFS_NEXT_DURABLE_RECONNECT(handle, smb1req, op, old_cookie, mem_ctx, fsp, new_cookie) \
605 smb_vfs_call_durable_reconnect((handle)->next, \
606 (smb1req), (op), (old_cookie), \
607 (mem_ctx), (fsp), (new_cookie))
609 #define SMB_VFS_READDIR_ATTR(conn, fname, mem_ctx, attr_data) \
610 smb_vfs_call_readdir_attr((conn)->vfs_handles, (fname), (mem_ctx), (attr_data))
611 #define SMB_VFS_NEXT_READDIR_ATTR(conn, fname, mem_ctx, attr_data) \
612 smb_vfs_call_readdir_attr((handle)->next, (fname), (mem_ctx), (attr_data))
614 #endif /* _VFS_MACROS_H */