s3:utils: let smbstatus report anonymous signing/encryption explicitly
[samba.git] / source3 / include / vfs_macros.h
1 /*
2    Unix SMB/CIFS implementation.
3    VFS wrapper macros
4    Copyright (C) Stefan (metze) Metzmacher      2003
5    Copyright (C) Volker Lendecke                2009
6
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.
11
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.
16
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/>.
19 */
20
21 #ifndef _VFS_MACROS_H
22 #define _VFS_MACROS_H
23
24 /*
25  * These macros SMB_VFS_<FOO> (and SMB_VFS_NEXT_<FOO>) are our
26  * interface for the VFS.
27  *
28  * Don't access conn->vfs_handles[->next]->fns->* directly!
29  */
30
31 /* Disk operations */
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))
36
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)
41
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))
46
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))
51
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))
56
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))
61
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))
66
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))
71
72 /*
73  * Note: that "struct dfs_GetDFSReferral *r"
74  * needs to be a valid TALLOC_CTX
75  */
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))
80
81 #define SMB_VFS_CREATE_DFS_PATHAT(conn, dirfsp, smb_fname, reflist, count) \
82         smb_vfs_call_create_dfs_pathat((conn)->vfs_handles, \
83                 (dirfsp), \
84                 (smb_fname), \
85                 (reflist), \
86                 (count))
87 #define SMB_VFS_NEXT_CREATE_DFS_PATHAT(handle, dirfsp, smb_fname, reflist, count) \
88         smb_vfs_call_create_dfs_pathat((handle)->next, \
89                 (dirfsp), \
90                 (smb_fname), \
91                 (reflist), \
92                 (count))
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, \
95                 (mem_ctx), \
96                 (dirfsp), \
97                 (smb_fname), \
98                 (ppreflist), \
99                 (pcount))
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, \
102                 (mem_ctx), \
103                 (dirfsp), \
104                 (smb_fname), \
105                 (ppreflist), \
106                 (pcount))
107
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))
113
114 #define SMB_VFS_READDIR(conn, dirfsp, dirp) \
115         smb_vfs_call_readdir((conn)->vfs_handles, (dirfsp), (dirp))
116 #define SMB_VFS_NEXT_READDIR(handle, dirfsp, dirp) \
117         smb_vfs_call_readdir((handle)->next, (dirfsp), (dirp))
118
119 #define SMB_VFS_REWINDDIR(conn, dirp) \
120         smb_vfs_call_rewind_dir((conn)->vfs_handles, (dirp))
121 #define SMB_VFS_NEXT_REWINDDIR(handle, dirp) \
122         smb_vfs_call_rewind_dir((handle)->next, (dirp))
123
124 #define SMB_VFS_MKDIRAT(conn, dirfsp, smb_fname, mode) \
125         smb_vfs_call_mkdirat((conn)->vfs_handles,(dirfsp), (smb_fname), (mode))
126 #define SMB_VFS_NEXT_MKDIRAT(handle, dirfsp, smb_fname, mode) \
127         smb_vfs_call_mkdirat((handle)->next,(dirfsp), (smb_fname), (mode))
128
129 #define SMB_VFS_CLOSEDIR(conn, dir) \
130         smb_vfs_call_closedir((conn)->vfs_handles, dir)
131 #define SMB_VFS_NEXT_CLOSEDIR(handle, dir) \
132         smb_vfs_call_closedir((handle)->next, (dir))
133
134 /* File operations */
135 #define SMB_VFS_OPENAT(conn, dirfsp, smb_fname, fsp, how) \
136         smb_vfs_call_openat( \
137                 (conn)->vfs_handles, (dirfsp), (smb_fname), (fsp), (how))
138 #define SMB_VFS_NEXT_OPENAT(handle, dirfsp, smb_fname, fsp, how) \
139         smb_vfs_call_openat( \
140                 (handle)->next, (dirfsp), (smb_fname), (fsp), (how))
141
142 #define SMB_VFS_CREATE_FILE(conn, req, dirfsp, smb_fname, access_mask, share_access, create_disposition, \
143         create_options, file_attributes, oplock_request, lease, allocation_size, private_flags, sd, ea_list, result, pinfo, in_context_blobs, out_context_blobs) \
144         smb_vfs_call_create_file((conn)->vfs_handles, (req), (dirfsp), (smb_fname), (access_mask), (share_access), (create_disposition), \
145         (create_options), (file_attributes), (oplock_request), (lease), (allocation_size), (private_flags), (sd), (ea_list), (result), (pinfo), \
146         (in_context_blobs), (out_context_blobs))
147 #define SMB_VFS_NEXT_CREATE_FILE(handle, req, dirfsp, smb_fname, access_mask, share_access, create_disposition, \
148         create_options, file_attributes, oplock_request, lease, allocation_size, private_flags, sd, ea_list, result, pinfo, in_context_blobs, out_context_blobs) \
149         smb_vfs_call_create_file((handle)->next, (req), (dirfsp), (smb_fname), (access_mask), (share_access), (create_disposition), \
150         (create_options), (file_attributes), (oplock_request), (lease), (allocation_size), (private_flags), (sd), (ea_list), (result), (pinfo), \
151         (in_context_blobs), (out_context_blobs))
152
153 #define SMB_VFS_CLOSE(fsp) \
154         smb_vfs_call_close((fsp)->conn->vfs_handles, (fsp))
155 #define SMB_VFS_NEXT_CLOSE(handle, fsp) \
156         smb_vfs_call_close((handle)->next, (fsp))
157
158 #define SMB_VFS_PREAD(fsp, data, n, off) \
159         smb_vfs_call_pread((fsp)->conn->vfs_handles, (fsp), (data), (n), (off))
160 #define SMB_VFS_NEXT_PREAD(handle, fsp, data, n, off) \
161         smb_vfs_call_pread((handle)->next, (fsp), (data), (n), (off))
162
163 #define SMB_VFS_PREAD_SEND(mem_ctx, ev, fsp, data, n, off) \
164         smb_vfs_call_pread_send((fsp)->conn->vfs_handles, (mem_ctx), (ev), \
165                                 (fsp), (data), (n), (off))
166 #define SMB_VFS_NEXT_PREAD_SEND(mem_ctx, ev, handle, fsp, data, n, off) \
167         smb_vfs_call_pread_send((handle)->next, (mem_ctx), (ev), (fsp), \
168                                 (data), (n), (off))
169
170 #define SMB_VFS_PWRITE(fsp, data, n, off) \
171         smb_vfs_call_pwrite((fsp)->conn->vfs_handles, (fsp), (data), (n), (off))
172 #define SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, off) \
173         smb_vfs_call_pwrite((handle)->next, (fsp), (data), (n), (off))
174
175 #define SMB_VFS_PWRITE_SEND(mem_ctx, ev, fsp, data, n, off) \
176         smb_vfs_call_pwrite_send((fsp)->conn->vfs_handles, (mem_ctx), (ev), \
177                                 (fsp), (data), (n), (off))
178 #define SMB_VFS_NEXT_PWRITE_SEND(mem_ctx, ev, handle, fsp, data, n, off) \
179         smb_vfs_call_pwrite_send((handle)->next, (mem_ctx), (ev), (fsp), \
180                                 (data), (n), (off))
181
182 #define SMB_VFS_LSEEK(fsp, offset, whence) \
183         smb_vfs_call_lseek((fsp)->conn->vfs_handles, (fsp), (offset), (whence))
184 #define SMB_VFS_NEXT_LSEEK(handle, fsp, offset, whence) \
185         smb_vfs_call_lseek((handle)->next, (fsp), (offset), (whence))
186
187 #define SMB_VFS_SENDFILE(tofd, fromfsp, header, offset, count) \
188         smb_vfs_call_sendfile((fromfsp)->conn->vfs_handles, (tofd), (fromfsp), (header), (offset), (count))
189 #define SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp, header, offset, count) \
190         smb_vfs_call_sendfile((handle)->next, (tofd), (fromfsp), (header), (offset), (count))
191
192 #define SMB_VFS_RECVFILE(fromfd, tofsp, offset, count) \
193         smb_vfs_call_recvfile((tofsp)->conn->vfs_handles, (fromfd), (tofsp), (offset), (count))
194 #define SMB_VFS_NEXT_RECVFILE(handle, fromfd, tofsp, offset, count) \
195         smb_vfs_call_recvfile((handle)->next, (fromfd), (tofsp), (offset), (count))
196
197 #define SMB_VFS_RENAMEAT(conn, oldfsp, old, newfsp, new) \
198         smb_vfs_call_renameat((conn)->vfs_handles, (oldfsp), (old), (newfsp), (new))
199 #define SMB_VFS_NEXT_RENAMEAT(handle, oldfsp, old, newfsp, new) \
200         smb_vfs_call_renameat((handle)->next, (oldfsp), (old), (newfsp), (new))
201
202 #define SMB_VFS_FSYNC_SEND(mem_ctx, ev, fsp) \
203         smb_vfs_call_fsync_send((fsp)->conn->vfs_handles, (mem_ctx), (ev), \
204                                 (fsp))
205 #define SMB_VFS_NEXT_FSYNC_SEND(mem_ctx, ev, handle, fsp)               \
206         smb_vfs_call_fsync_send((handle)->next, (mem_ctx), (ev), (fsp))
207
208 #define SMB_VFS_STAT(conn, smb_fname) \
209         smb_vfs_call_stat((conn)->vfs_handles, (smb_fname))
210 #define SMB_VFS_NEXT_STAT(handle, smb_fname) \
211         smb_vfs_call_stat((handle)->next, (smb_fname))
212
213 #define SMB_VFS_FSTAT(fsp, sbuf) \
214         smb_vfs_call_fstat((fsp)->conn->vfs_handles, (fsp), (sbuf))
215 #define SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf) \
216         smb_vfs_call_fstat((handle)->next, (fsp), (sbuf))
217
218 #define SMB_VFS_LSTAT(conn, smb_fname) \
219         smb_vfs_call_lstat((conn)->vfs_handles, (smb_fname))
220 #define SMB_VFS_NEXT_LSTAT(handle, smb_fname) \
221         smb_vfs_call_lstat((handle)->next, (smb_fname))
222
223 #define SMB_VFS_FSTATAT(conn, dirfsp, smb_fname, sbuf, flags) \
224         smb_vfs_call_fstatat((conn)->vfs_handles, (dirfsp), (smb_fname), \
225                              (sbuf), (flags))
226 #define SMB_VFS_NEXT_FSTATAT(conn, dirfsp, smb_fname, sbuf, flags) \
227         smb_vfs_call_fstatat((handle)->next, (dirfsp), (smb_fname), \
228                              (sbuf), (flags))
229
230 #define SMB_VFS_GET_ALLOC_SIZE(conn, fsp, sbuf) \
231         smb_vfs_call_get_alloc_size((conn)->vfs_handles, (fsp), (sbuf))
232 #define SMB_VFS_NEXT_GET_ALLOC_SIZE(conn, fsp, sbuf) \
233         smb_vfs_call_get_alloc_size((conn)->next, (fsp), (sbuf))
234
235 #define SMB_VFS_UNLINKAT(conn, dirfsp, path, flags) \
236         smb_vfs_call_unlinkat((conn)->vfs_handles, (dirfsp), (path), (flags))
237 #define SMB_VFS_NEXT_UNLINKAT(handle, dirfsp, path, flags) \
238         smb_vfs_call_unlinkat((handle)->next, (dirfsp), (path), (flags))
239
240 #define SMB_VFS_FCHMOD(fsp, mode) \
241         smb_vfs_call_fchmod((fsp)->conn->vfs_handles, (fsp), (mode))
242 #define SMB_VFS_NEXT_FCHMOD(handle, fsp, mode) \
243         smb_vfs_call_fchmod((handle)->next, (fsp), (mode))
244
245 #define SMB_VFS_FCHOWN(fsp, uid, gid) \
246         smb_vfs_call_fchown((fsp)->conn->vfs_handles, (fsp), (uid), (gid))
247 #define SMB_VFS_NEXT_FCHOWN(handle, fsp, uid, gid) \
248         smb_vfs_call_fchown((handle)->next, (fsp), (uid), (gid))
249
250 #define SMB_VFS_LCHOWN(conn, smb_fname, uid, gid) \
251         smb_vfs_call_lchown((conn)->vfs_handles, (smb_fname), (uid), (gid))
252 #define SMB_VFS_NEXT_LCHOWN(handle, smb_fname, uid, gid) \
253         smb_vfs_call_lchown((handle)->next, (smb_fname), (uid), (gid))
254
255 #define SMB_VFS_CHDIR(conn, smb_fname) \
256         smb_vfs_call_chdir((conn)->vfs_handles, (smb_fname))
257 #define SMB_VFS_NEXT_CHDIR(handle, smb_fname) \
258         smb_vfs_call_chdir((handle)->next, (smb_fname))
259
260 #define SMB_VFS_GETWD(conn, ctx) \
261         smb_vfs_call_getwd((conn)->vfs_handles, (ctx))
262 #define SMB_VFS_NEXT_GETWD(handle, ctx) \
263         smb_vfs_call_getwd((handle)->next, (ctx))
264
265 #define SMB_VFS_FNTIMES(fsp, ts) \
266         smb_vfs_call_fntimes((fsp)->conn->vfs_handles, (fsp), (ts))
267 #define SMB_VFS_NEXT_FNTIMES(handle, fsp, ts) \
268         smb_vfs_call_fntimes((handle)->next, (fsp), (ts))
269
270 #define SMB_VFS_FTRUNCATE(fsp, offset) \
271         smb_vfs_call_ftruncate((fsp)->conn->vfs_handles, (fsp), (offset))
272 #define SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset) \
273         smb_vfs_call_ftruncate((handle)->next, (fsp), (offset))
274
275 #define SMB_VFS_FALLOCATE(fsp, mode, offset, len) \
276         smb_vfs_call_fallocate((fsp)->conn->vfs_handles, (fsp), (mode), (offset), (len))
277 #define SMB_VFS_NEXT_FALLOCATE(handle, fsp, mode, offset, len) \
278         smb_vfs_call_fallocate((handle)->next, (fsp), (mode), (offset), (len))
279
280 #define SMB_VFS_LOCK(fsp, op, offset, count, type) \
281         smb_vfs_call_lock((fsp)->conn->vfs_handles, (fsp), (op), (offset), (count), (type))
282 #define SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type) \
283         smb_vfs_call_lock((handle)->next, (fsp), (op), (offset), (count), (type))
284
285 #define SMB_VFS_FILESYSTEM_SHAREMODE(fsp, share_access, access_mask) \
286         smb_vfs_call_filesystem_sharemode((fsp)->conn->vfs_handles, \
287                                           (fsp), \
288                                           (share_access), \
289                                           (access_mask))
290 #define SMB_VFS_NEXT_FILESYSTEM_SHAREMODE(handle, fsp, share_access, \
291                                           access_mask) \
292         smb_vfs_call_filesystem_sharemode((handle)->next, \
293                                           (fsp), \
294                                           (share_access), \
295                                           (access_mask))
296
297 #define SMB_VFS_FCNTL(fsp, cmd, ...) \
298         smb_vfs_call_fcntl((fsp)->conn->vfs_handles, (fsp), (cmd), (__VA_ARGS__))
299 #define SMB_VFS_NEXT_FCNTL(handle, fsp, cmd, ...) \
300         smb_vfs_call_fcntl((handle)->next, (fsp), (cmd), (__VA_ARGS__))
301
302 #define SMB_VFS_LINUX_SETLEASE(fsp, leasetype) \
303         smb_vfs_call_linux_setlease((fsp)->conn->vfs_handles, (fsp), (leasetype))
304 #define SMB_VFS_NEXT_LINUX_SETLEASE(handle, fsp, leasetype) \
305         smb_vfs_call_linux_setlease((handle)->next, (fsp), (leasetype))
306
307 #define SMB_VFS_GETLOCK(fsp, poffset, pcount, ptype, ppid) \
308         smb_vfs_call_getlock((fsp)->conn->vfs_handles, (fsp), (poffset), (pcount), (ptype), (ppid))
309 #define SMB_VFS_NEXT_GETLOCK(handle, fsp, poffset, pcount, ptype, ppid) \
310         smb_vfs_call_getlock((handle)->next, (fsp), (poffset), (pcount), (ptype), (ppid))
311
312 #define SMB_VFS_SYMLINKAT(conn, oldpath, dirfsp, newpath) \
313         smb_vfs_call_symlinkat((conn)->vfs_handles, (oldpath), (dirfsp), (newpath))
314 #define SMB_VFS_NEXT_SYMLINKAT(handle, oldpath, dirfsp, newpath) \
315         smb_vfs_call_symlinkat((handle)->next, (oldpath), (dirfsp), (newpath))
316
317 #define SMB_VFS_READLINKAT(conn, dirfsp, smb_fname, buf, bufsiz) \
318         smb_vfs_call_readlinkat((conn)->vfs_handles, (dirfsp), (smb_fname), (buf), (bufsiz))
319 #define SMB_VFS_NEXT_READLINKAT(handle, dirfsp, smb_fname, buf, bufsiz) \
320         smb_vfs_call_readlinkat((handle)->next, (dirfsp), (smb_fname), (buf), (bufsiz))
321
322 #define SMB_VFS_LINKAT(conn, srcfsp, oldpath, dstfsp, newpath, flags) \
323         smb_vfs_call_linkat((conn)->vfs_handles, (srcfsp), (oldpath), (dstfsp), (newpath), (flags))
324 #define SMB_VFS_NEXT_LINKAT(handle, srcfsp, oldpath, dstfsp, newpath, flags) \
325         smb_vfs_call_linkat((handle)->next, (srcfsp), (oldpath), (dstfsp), (newpath), (flags))
326
327 #define SMB_VFS_MKNODAT(conn, dirfsp, smb_fname, mode, dev) \
328         smb_vfs_call_mknodat((conn)->vfs_handles, (dirfsp), (smb_fname), (mode), (dev))
329 #define SMB_VFS_NEXT_MKNODAT(handle, dirfsp, smb_fname, mode, dev) \
330         smb_vfs_call_mknodat((handle)->next, (dirfsp), (smb_fname), (mode), (dev))
331
332 #define SMB_VFS_REALPATH(conn, ctx, smb_fname) \
333         smb_vfs_call_realpath((conn)->vfs_handles, (ctx), (smb_fname))
334 #define SMB_VFS_NEXT_REALPATH(handle, ctx, smb_fname) \
335         smb_vfs_call_realpath((handle)->next, (ctx), (smb_fname))
336
337 #define SMB_VFS_FCHFLAGS(fsp, flags) \
338         smb_vfs_call_fchflags((fsp)->conn->vfs_handles, (fsp), (flags))
339 #define SMB_VFS_NEXT_FCHFLAGS(handle, fsp, flags) \
340         smb_vfs_call_fchflags((handle)->next, (fsp), (flags))
341
342 #define SMB_VFS_FILE_ID_CREATE(conn, sbuf) \
343         smb_vfs_call_file_id_create((conn)->vfs_handles, (sbuf))
344 #define SMB_VFS_NEXT_FILE_ID_CREATE(handle, sbuf) \
345         smb_vfs_call_file_id_create((handle)->next, (sbuf))
346
347 #define SMB_VFS_FS_FILE_ID(conn, sbuf) \
348         smb_vfs_call_fs_file_id((conn)->vfs_handles, (sbuf))
349 #define SMB_VFS_NEXT_FS_FILE_ID(handle, sbuf) \
350         smb_vfs_call_fs_file_id((handle)->next, (sbuf))
351
352 #define SMB_VFS_STREAMINFO(conn, fsp, smb_fname, mem_ctx, num_streams, streams) \
353         smb_vfs_call_streaminfo((conn)->vfs_handles, (fsp), (smb_fname), (mem_ctx), (num_streams), (streams))
354 #define SMB_VFS_NEXT_STREAMINFO(handle, fsp, smb_fname, mem_ctx, num_streams, streams) \
355         smb_vfs_call_streaminfo((handle)->next, (fsp), (smb_fname), (mem_ctx), (num_streams), (streams))
356
357 #define SMB_VFS_FSTREAMINFO(fsp, mem_ctx, num_streams, streams) \
358         smb_vfs_call_fstreaminfo((fsp)->conn->vfs_handles, (fsp), (mem_ctx), (num_streams), (streams))
359 #define SMB_VFS_NEXT_FSTREAMINFO(handle, fsp, mem_ctx, num_streams, streams) \
360         smb_vfs_call_fstreaminfo(handle->next, (fsp), (mem_ctx), (num_streams), (streams))
361
362 #define SMB_VFS_GET_REAL_FILENAME_AT(conn, dirfsp, name, mem_ctx, found_name) \
363         smb_vfs_call_get_real_filename_at( \
364                 (conn)->vfs_handles, \
365                 (dirfsp), \
366                 (name), \
367                 (mem_ctx), \
368                 (found_name))
369 #define SMB_VFS_NEXT_GET_REAL_FILENAME_AT( \
370         handle, dirfsp, name, mem_ctx, found_name) \
371         smb_vfs_call_get_real_filename_at( \
372                 (handle)->next, \
373                 (dirfsp), \
374                 (name), \
375                 (mem_ctx), \
376                 (found_name))
377
378 #define SMB_VFS_CONNECTPATH(conn, dirfsp, smb_fname)                    \
379         smb_vfs_call_connectpath((conn)->vfs_handles, (dirfsp), (smb_fname))
380 #define SMB_VFS_NEXT_CONNECTPATH(conn, dirfsp, smb_fname)       \
381         smb_vfs_call_connectpath((conn)->next, (dirfsp), (smb_fname))
382
383 #define SMB_VFS_BRL_LOCK_WINDOWS(conn, br_lck, plock) \
384         smb_vfs_call_brl_lock_windows((conn)->vfs_handles, (br_lck), (plock))
385 #define SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle, br_lck, plock) \
386         smb_vfs_call_brl_lock_windows((handle)->next, (br_lck), (plock))
387
388 #define SMB_VFS_BRL_UNLOCK_WINDOWS(conn, br_lck, plock) \
389         smb_vfs_call_brl_unlock_windows((conn)->vfs_handles, (br_lck), (plock))
390 #define SMB_VFS_NEXT_BRL_UNLOCK_WINDOWS(handle, br_lck, plock) \
391         smb_vfs_call_brl_unlock_windows((handle)->next, (br_lck), (plock))
392
393 #define SMB_VFS_STRICT_LOCK_CHECK(conn, fsp, plock) \
394         smb_vfs_call_strict_lock_check((conn)->vfs_handles, (fsp), (plock))
395 #define SMB_VFS_NEXT_STRICT_LOCK_CHECK(handle, fsp, plock) \
396         smb_vfs_call_strict_lock_check((handle)->next, (fsp), (plock))
397
398 #define SMB_VFS_TRANSLATE_NAME(conn, name, direction, mem_ctx, mapped_name) \
399         smb_vfs_call_translate_name((conn)->vfs_handles, (name), (direction), (mem_ctx), (mapped_name))
400 #define SMB_VFS_NEXT_TRANSLATE_NAME(handle, name, direction, mem_ctx, mapped_name) \
401         smb_vfs_call_translate_name((handle)->next, (name), (direction), (mem_ctx), (mapped_name))
402
403 #define SMB_VFS_PARENT_PATHNAME(conn, mem_ctx, smb_fname_in, parent_dir_out, atname_out) \
404         smb_vfs_call_parent_pathname((conn)->vfs_handles, (mem_ctx), (smb_fname_in), (parent_dir_out), (atname_out))
405 #define SMB_VFS_NEXT_PARENT_PATHNAME(handle, mem_ctx, smb_fname_in, parent_dir_out, atname_out) \
406         smb_vfs_call_parent_pathname((handle)->next, (mem_ctx), (smb_fname_in), (parent_dir_out), (atname_out))
407
408 #define SMB_VFS_FSCTL(fsp, ctx, function, req_flags, in_data, in_len, out_data, max_out_len, out_len) \
409         smb_vfs_call_fsctl((fsp)->conn->vfs_handles, (fsp), (ctx), (function), (req_flags), (in_data), (in_len), (out_data), (max_out_len), (out_len))
410
411 #define SMB_VFS_NEXT_FSCTL(handle, fsp, ctx, function, req_flags, in_data, in_len, out_data, max_out_len, out_len) \
412         smb_vfs_call_fsctl((handle)->next, (fsp), (ctx), (function), (req_flags), (in_data), (in_len), (out_data), (max_out_len), (out_len))
413
414 #define SMB_VFS_FGET_DOS_ATTRIBUTES(conn, fsp, attributes) \
415         smb_vfs_call_fget_dos_attributes((conn)->vfs_handles, (fsp), (attributes))
416 #define SMB_VFS_NEXT_FGET_DOS_ATTRIBUTES(handle, fsp, attributes) \
417         smb_vfs_call_fget_dos_attributes((handle)->next, (fsp), (attributes))
418
419 #define SMB_VFS_GET_DOS_ATTRIBUTES_SEND(mem_ctx, evg, dir_fsp, smb_fname) \
420         smb_vfs_call_get_dos_attributes_send((mem_ctx), (evg), \
421                                              (dir_fsp)->conn->vfs_handles, \
422                                              (dir_fsp), (smb_fname))
423 #define SMB_VFS_GET_DOS_ATTRIBUTES_RECV(req, aio_state, dosmode) \
424         smb_vfs_call_get_dos_attributes_recv((req), (aio_state), (dosmode))
425
426 #define SMB_VFS_NEXT_GET_DOS_ATTRIBUTES_SEND(mem_ctx, evg, handle, dir_fsp, \
427                                              smb_fname) \
428         smb_vfs_call_get_dos_attributes_send((mem_ctx), (evg), \
429                                              (handle)->next, \
430                                              (dir_fsp), (smb_fname))
431 #define SMB_VFS_NEXT_GET_DOS_ATTRIBUTES_RECV(req, aio_state, dosmode) \
432         smb_vfs_call_get_dos_attributes_recv((req), (aio_state), (dosmode))
433
434 #define SMB_VFS_FSET_DOS_ATTRIBUTES(conn, fsp, attributes) \
435         smb_vfs_call_fset_dos_attributes((conn)->vfs_handles, (fsp), (attributes))
436 #define SMB_VFS_NEXT_FSET_DOS_ATTRIBUTES(handle, fsp, attributes) \
437         smb_vfs_call_fset_dos_attributes((handle)->next, (fsp), (attributes))
438
439 #define SMB_VFS_OFFLOAD_READ_SEND(mem_ctx, ev, fsp, fsctl, ttl, offset, to_copy) \
440         smb_vfs_call_offload_read_send((mem_ctx), (ev), (fsp)->conn->vfs_handles, fsp, (fsctl), (ttl), (offset), (to_copy))
441 #define SMB_VFS_NEXT_OFFLOAD_READ_SEND(mem_ctx, ev, handle, fsp, fsctl, ttl, offset, to_copy) \
442         smb_vfs_call_offload_read_send((mem_ctx), (ev), (handle)->next, (fsp), (fsctl), (ttl), (offset), (to_copy))
443
444 #define SMB_VFS_OFFLOAD_READ_RECV(req, conn, mem_ctx, flags, xferlen, token_blob) \
445         smb_vfs_call_offload_read_recv((req), (conn)->vfs_handles, (mem_ctx), (flags), (xferlen), (token_blob))
446 #define SMB_VFS_NEXT_OFFLOAD_READ_RECV(req, handle, mem_ctx, flags, xferlen, token_blob) \
447         smb_vfs_call_offload_read_recv((req), (handle)->next, (mem_ctx), flags, xferlen, (token_blob))
448
449 #define SMB_VFS_OFFLOAD_WRITE_SEND(conn, mem_ctx, ev, fsctl, token, transfer_offset, dest_fsp, dest_off, num) \
450         smb_vfs_call_offload_write_send((conn)->vfs_handles, (mem_ctx), (ev), (fsctl), (token), (transfer_offset), (dest_fsp), (dest_off), (num))
451 #define SMB_VFS_NEXT_OFFLOAD_WRITE_SEND(handle, mem_ctx, ev, fsctl, token, transfer_offset, dest_fsp, dest_off, num) \
452         smb_vfs_call_offload_write_send((handle)->next, (mem_ctx), (ev), (fsctl), (token), (transfer_offset), (dest_fsp), (dest_off), (num))
453
454 #define SMB_VFS_OFFLOAD_WRITE_RECV(conn, req, copied) \
455         smb_vfs_call_offload_write_recv((conn)->vfs_handles, (req), (copied))
456 #define SMB_VFS_NEXT_OFFLOAD_WRITE_RECV(handle, req, copied) \
457         smb_vfs_call_offload_write_recv((handle)->next, (req), (copied))
458
459 #define SMB_VFS_FGET_COMPRESSION(conn, mem_ctx, fsp, _compression_fmt)          \
460         smb_vfs_call_fget_compression((conn)->vfs_handles, (mem_ctx), (fsp), (_compression_fmt))
461 #define SMB_VFS_NEXT_FGET_COMPRESSION(handle, mem_ctx, fsp, _compression_fmt)           \
462         smb_vfs_call_fget_compression((handle)->next, (mem_ctx), (fsp), (_compression_fmt))
463
464 #define SMB_VFS_SET_COMPRESSION(conn, mem_ctx, fsp, compression_fmt)            \
465         smb_vfs_call_set_compression((conn)->vfs_handles, (mem_ctx), (fsp), (compression_fmt))
466 #define SMB_VFS_NEXT_SET_COMPRESSION(handle, mem_ctx, fsp, compression_fmt)             \
467         smb_vfs_call_set_compression((handle)->next, (mem_ctx), (fsp), (compression_fmt))
468
469 #define SMB_VFS_SNAP_CHECK_PATH(conn, mem_ctx, service_path, base_volume) \
470         smb_vfs_call_snap_check_path((conn)->vfs_handles, (mem_ctx), (service_path), (base_volume))
471 #define SMB_VFS_NEXT_SNAP_CHECK_PATH(handle, mem_ctx, service_path, base_volume) \
472         smb_vfs_call_snap_check_path((handle)->next, (mem_ctx), (service_path), (base_volume))
473
474 #define SMB_VFS_SNAP_CREATE(conn, mem_ctx, base_volume, tstamp, rw, base_path, snap_path) \
475         smb_vfs_call_snap_create((conn)->vfs_handles, (mem_ctx), (base_volume), (tstamp), (rw), (base_path), (snap_path))
476 #define SMB_VFS_NEXT_SNAP_CREATE(handle, mem_ctx, base_volume, tstamp, rw, base_path, snap_path) \
477         smb_vfs_call_snap_create((handle)->next, (mem_ctx), (base_volume), (tstamp), (rw), (base_path), (snap_path))
478
479 #define SMB_VFS_SNAP_DELETE(conn, mem_ctx, base_path, snap_path) \
480         smb_vfs_call_snap_delete((conn)->vfs_handles, (mem_ctx), (base_path), (snap_path))
481 #define SMB_VFS_NEXT_SNAP_DELETE(handle, mem_ctx, base_path, snap_path) \
482         smb_vfs_call_snap_delete((handle)->next, (mem_ctx), (base_path), (snap_path))
483
484 #define SMB_VFS_FGET_NT_ACL(fsp, security_info, mem_ctx, ppdesc)                \
485         smb_vfs_call_fget_nt_acl((fsp)->conn->vfs_handles, (fsp), (security_info), (mem_ctx), (ppdesc))
486 #define SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, mem_ctx, ppdesc) \
487         smb_vfs_call_fget_nt_acl((handle)->next, (fsp), (security_info), (mem_ctx), (ppdesc))
488
489 #define SMB_VFS_AUDIT_FILE(conn, name, sacl, access_requested, access_denied) \
490         smb_vfs_call_audit_file((conn)->vfs_handles, (name), (sacl), (access_requested), (access_denied))
491 #define SMB_VFS_NEXT_AUDIT_FILE(handle, name, sacl, access_requested, access_denied) \
492         smb_vfs_call_audit_file((handle)->next, (name), (sacl), (access_requested), (access_denied))
493
494 #define SMB_VFS_FSET_NT_ACL(fsp, security_info_sent, psd) \
495         smb_vfs_call_fset_nt_acl((fsp)->conn->vfs_handles, (fsp), (security_info_sent), (psd))
496 #define SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd) \
497         smb_vfs_call_fset_nt_acl((handle)->next, (fsp), (security_info_sent), (psd))
498
499 #define SMB_VFS_SYS_ACL_GET_FD(fsp, type, mem_ctx) \
500         smb_vfs_call_sys_acl_get_fd((fsp)->conn->vfs_handles, (fsp), (type), (mem_ctx))
501 #define SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp, type, mem_ctx) \
502         smb_vfs_call_sys_acl_get_fd((handle)->next, (fsp), (type), (mem_ctx))
503
504 #define SMB_VFS_SYS_ACL_BLOB_GET_FD(fsp, mem_ctx, blob_description, blob)                       \
505         smb_vfs_call_sys_acl_blob_get_fd((fsp)->conn->vfs_handles, (fsp), (mem_ctx), (blob_description), (blob))
506 #define SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FD(handle, fsp, mem_ctx, blob_description, blob)  \
507         smb_vfs_call_sys_acl_blob_get_fd((handle)->next, (fsp), mem_ctx, (blob_description), (blob))
508
509 #define SMB_VFS_SYS_ACL_SET_FD(fsp, type, theacl) \
510         smb_vfs_call_sys_acl_set_fd((fsp)->conn->vfs_handles, (fsp), (type), (theacl))
511 #define SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, type, theacl) \
512         smb_vfs_call_sys_acl_set_fd((handle)->next, (fsp), (type), (theacl))
513
514 #define SMB_VFS_SYS_ACL_DELETE_DEF_FD(fsp) \
515         smb_vfs_call_sys_acl_delete_def_fd((fsp)->conn->vfs_handles, (fsp))
516 #define SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FD(handle, fsp) \
517         smb_vfs_call_sys_acl_delete_def_fd((handle)->next, (fsp))
518
519 #define SMB_VFS_GETXATTRAT_SEND(mem_ctx,ev,dir_fsp,smb_fname, \
520                                 xattr_name, alloc_hint) \
521         smb_vfs_call_getxattrat_send((mem_ctx),(ev), \
522                                      (dir_fsp)->conn->vfs_handles, \
523                                      (dir_fsp),(smb_fname),(xattr_name), \
524                                      (alloc_hint))
525 #define SMB_VFS_GETXATTRAT_RECV(req, aio_state, mem_ctx, xattr_value) \
526         smb_vfs_call_getxattrat_recv((req),(aio_state),(mem_ctx),(xattr_value))
527
528 #define SMB_VFS_NEXT_GETXATTRAT_SEND(mem_ctx,ev,handle,dir_fsp,smb_fname, \
529                                      xattr_name,alloc_hint) \
530         smb_vfs_call_getxattrat_send((mem_ctx),(ev), \
531                                      (handle)->next, \
532                                      (dir_fsp), (smb_fname),(xattr_name), \
533                                      (alloc_hint))
534 #define SMB_VFS_NEXT_GETXATTRAT_RECV(req, aio_state, mem_ctx, xattr_value) \
535         smb_vfs_call_getxattrat_recv((req),(aio_state),(mem_ctx),(xattr_value))
536
537 #define SMB_VFS_FGETXATTR(fsp,name,value,size) \
538         smb_vfs_call_fgetxattr((fsp)->conn->vfs_handles, (fsp), (name),(value),(size))
539 #define SMB_VFS_NEXT_FGETXATTR(handle,fsp,name,value,size) \
540         smb_vfs_call_fgetxattr((handle)->next,(fsp),(name),(value),(size))
541
542 #define SMB_VFS_FLISTXATTR(fsp,list,size) \
543         smb_vfs_call_flistxattr((fsp)->conn->vfs_handles, (fsp), (list),(size))
544 #define SMB_VFS_NEXT_FLISTXATTR(handle,fsp,list,size) \
545         smb_vfs_call_flistxattr((handle)->next,(fsp),(list),(size))
546
547 #define SMB_VFS_FREMOVEXATTR(fsp,name) \
548         smb_vfs_call_fremovexattr((fsp)->conn->vfs_handles, (fsp), (name))
549 #define SMB_VFS_NEXT_FREMOVEXATTR(handle,fsp,name) \
550         smb_vfs_call_fremovexattr((handle)->next,(fsp),(name))
551
552 #define SMB_VFS_FSETXATTR(fsp,name,value,size,flags) \
553         smb_vfs_call_fsetxattr((fsp)->conn->vfs_handles, (fsp), (name),(value),(size),(flags))
554 #define SMB_VFS_NEXT_FSETXATTR(handle,fsp,name,value,size,flags) \
555         smb_vfs_call_fsetxattr((handle)->next,(fsp),(name),(value),(size),(flags))
556
557 #define SMB_VFS_AIO_FORCE(fsp) \
558         smb_vfs_call_aio_force((fsp)->conn->vfs_handles, (fsp))
559 #define SMB_VFS_NEXT_AIO_FORCE(handle,fsp) \
560         smb_vfs_call_aio_force((handle)->next,(fsp))
561
562 /* durable handle operations */
563
564 #define SMB_VFS_DURABLE_COOKIE(fsp, mem_ctx, cookie) \
565         smb_vfs_call_durable_cookie((fsp)->conn->vfs_handles, \
566                                     (fsp), (mem_ctx), (cookie))
567 #define SMB_VFS_NEXT_DURABLE_COOKIE(handle, fsp, mem_ctx, cookie) \
568         smb_vfs_call_durable_cookie((handle)->next, \
569                                     (fsp), (mem_ctx), (cookie))
570
571 #define SMB_VFS_DURABLE_DISCONNECT(fsp, old_cookie, mem_ctx, new_cookie) \
572         smb_vfs_call_durable_disconnect((fsp)->conn->vfs_handles, \
573                                         (fsp), (old_cookie), (mem_ctx), (new_cookie))
574 #define SMB_VFS_NEXT_DURABLE_DISCONNECT(handle, fsp, old_cookie, mem_ctx, new_cookie) \
575         smb_vfs_call_durable_disconnect((handle)->next, \
576                                         (fsp), (old_cookie), (mem_ctx), (new_cookie))
577
578 #define SMB_VFS_DURABLE_RECONNECT(conn, smb1req, op, old_cookie, mem_ctx, fsp, new_cookie) \
579         smb_vfs_call_durable_reconnect((conn)->vfs_handles, \
580                                        (smb1req), (op), (old_cookie), \
581                                        (mem_ctx), (fsp), (new_cookie))
582 #define SMB_VFS_NEXT_DURABLE_RECONNECT(handle, smb1req, op, old_cookie, mem_ctx, fsp, new_cookie) \
583         smb_vfs_call_durable_reconnect((handle)->next, \
584                                         (smb1req), (op), (old_cookie), \
585                                         (mem_ctx), (fsp), (new_cookie))
586
587 #define SMB_VFS_FREADDIR_ATTR(fsp, mem_ctx, attr_data) \
588         smb_vfs_call_freaddir_attr((fsp)->conn->vfs_handles, (fsp), (mem_ctx), (attr_data))
589 #define SMB_VFS_NEXT_FREADDIR_ATTR(handle, fsp, mem_ctx, attr_data) \
590         smb_vfs_call_freaddir_attr((handle)->next, (fsp), (mem_ctx), (attr_data))
591
592 #endif /* _VFS_MACROS_H */