VFS: Add SMB_VFS_FSTREAMINFO
[bbaumbach/samba-autobuild/.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, 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))
118
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))
123
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))
128
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))
133
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))
138
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))
143
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))
149
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))
160
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))
165
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))
170
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), \
176                                 (data), (n), (off))
177
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))
182
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), \
188                                 (data), (n), (off))
189
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))
194
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))
199
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))
204
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))
209
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))
214
215 #define SMB_VFS_FSYNC_SEND(mem_ctx, ev, fsp) \
216         smb_vfs_call_fsync_send((fsp)->conn->vfs_handles, (mem_ctx), (ev), \
217                                 (fsp))
218 #define SMB_VFS_NEXT_FSYNC_SEND(mem_ctx, ev, handle, fsp)               \
219         smb_vfs_call_fsync_send((handle)->next, (mem_ctx), (ev), (fsp))
220
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))
225
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))
230
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))
235
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))
240
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))
245
246 #define SMB_VFS_FCHMOD(fsp, mode) \
247         smb_vfs_call_fchmod((fsp)->conn->vfs_handles, (fsp), (mode))
248 #define SMB_VFS_NEXT_FCHMOD(handle, fsp, mode) \
249         smb_vfs_call_fchmod((handle)->next, (fsp), (mode))
250
251 #define SMB_VFS_FCHOWN(fsp, uid, gid) \
252         smb_vfs_call_fchown((fsp)->conn->vfs_handles, (fsp), (uid), (gid))
253 #define SMB_VFS_NEXT_FCHOWN(handle, fsp, uid, gid) \
254         smb_vfs_call_fchown((handle)->next, (fsp), (uid), (gid))
255
256 #define SMB_VFS_LCHOWN(conn, smb_fname, uid, gid) \
257         smb_vfs_call_lchown((conn)->vfs_handles, (smb_fname), (uid), (gid))
258 #define SMB_VFS_NEXT_LCHOWN(handle, smb_fname, uid, gid) \
259         smb_vfs_call_lchown((handle)->next, (smb_fname), (uid), (gid))
260
261 #define SMB_VFS_CHDIR(conn, smb_fname) \
262         smb_vfs_call_chdir((conn)->vfs_handles, (smb_fname))
263 #define SMB_VFS_NEXT_CHDIR(handle, smb_fname) \
264         smb_vfs_call_chdir((handle)->next, (smb_fname))
265
266 #define SMB_VFS_GETWD(conn, ctx) \
267         smb_vfs_call_getwd((conn)->vfs_handles, (ctx))
268 #define SMB_VFS_NEXT_GETWD(handle, ctx) \
269         smb_vfs_call_getwd((handle)->next, (ctx))
270
271 #define SMB_VFS_FNTIMES(fsp, ts) \
272         smb_vfs_call_fntimes((fsp)->conn->vfs_handles, (fsp), (ts))
273 #define SMB_VFS_NEXT_FNTIMES(handle, fsp, ts) \
274         smb_vfs_call_fntimes((handle)->next, (fsp), (ts))
275
276 #define SMB_VFS_FTRUNCATE(fsp, offset) \
277         smb_vfs_call_ftruncate((fsp)->conn->vfs_handles, (fsp), (offset))
278 #define SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset) \
279         smb_vfs_call_ftruncate((handle)->next, (fsp), (offset))
280
281 #define SMB_VFS_FALLOCATE(fsp, mode, offset, len) \
282         smb_vfs_call_fallocate((fsp)->conn->vfs_handles, (fsp), (mode), (offset), (len))
283 #define SMB_VFS_NEXT_FALLOCATE(handle, fsp, mode, offset, len) \
284         smb_vfs_call_fallocate((handle)->next, (fsp), (mode), (offset), (len))
285
286 #define SMB_VFS_LOCK(fsp, op, offset, count, type) \
287         smb_vfs_call_lock((fsp)->conn->vfs_handles, (fsp), (op), (offset), (count), (type))
288 #define SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type) \
289         smb_vfs_call_lock((handle)->next, (fsp), (op), (offset), (count), (type))
290
291 #define SMB_VFS_KERNEL_FLOCK(fsp, share_access, access_mask) \
292         smb_vfs_call_kernel_flock((fsp)->conn->vfs_handles, (fsp), (share_access), (access_mask))
293 #define SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_access, access_mask)       \
294         smb_vfs_call_kernel_flock((handle)->next, (fsp), (share_access), (access_mask))
295
296 #define SMB_VFS_FCNTL(fsp, cmd, ...) \
297         smb_vfs_call_fcntl((fsp)->conn->vfs_handles, (fsp), (cmd), (__VA_ARGS__))
298 #define SMB_VFS_NEXT_FCNTL(handle, fsp, cmd, ...) \
299         smb_vfs_call_fcntl((handle)->next, (fsp), (cmd), (__VA_ARGS__))
300
301 #define SMB_VFS_LINUX_SETLEASE(fsp, leasetype) \
302         smb_vfs_call_linux_setlease((fsp)->conn->vfs_handles, (fsp), (leasetype))
303 #define SMB_VFS_NEXT_LINUX_SETLEASE(handle, fsp, leasetype) \
304         smb_vfs_call_linux_setlease((handle)->next, (fsp), (leasetype))
305
306 #define SMB_VFS_GETLOCK(fsp, poffset, pcount, ptype, ppid) \
307         smb_vfs_call_getlock((fsp)->conn->vfs_handles, (fsp), (poffset), (pcount), (ptype), (ppid))
308 #define SMB_VFS_NEXT_GETLOCK(handle, fsp, poffset, pcount, ptype, ppid) \
309         smb_vfs_call_getlock((handle)->next, (fsp), (poffset), (pcount), (ptype), (ppid))
310
311 #define SMB_VFS_SYMLINKAT(conn, oldpath, dirfsp, newpath) \
312         smb_vfs_call_symlinkat((conn)->vfs_handles, (oldpath), (dirfsp), (newpath))
313 #define SMB_VFS_NEXT_SYMLINKAT(handle, oldpath, dirfsp, newpath) \
314         smb_vfs_call_symlinkat((handle)->next, (oldpath), (dirfsp), (newpath))
315
316 #define SMB_VFS_READLINKAT(conn, dirfsp, smb_fname, buf, bufsiz) \
317         smb_vfs_call_readlinkat((conn)->vfs_handles, (dirfsp), (smb_fname), (buf), (bufsiz))
318 #define SMB_VFS_NEXT_READLINKAT(handle, dirfsp, smb_fname, buf, bufsiz) \
319         smb_vfs_call_readlinkat((handle)->next, (dirfsp), (smb_fname), (buf), (bufsiz))
320
321 #define SMB_VFS_LINKAT(conn, srcfsp, oldpath, dstfsp, newpath, flags) \
322         smb_vfs_call_linkat((conn)->vfs_handles, (srcfsp), (oldpath), (dstfsp), (newpath), (flags))
323 #define SMB_VFS_NEXT_LINKAT(handle, srcfsp, oldpath, dstfsp, newpath, flags) \
324         smb_vfs_call_linkat((handle)->next, (srcfsp), (oldpath), (dstfsp), (newpath), (flags))
325
326 #define SMB_VFS_MKNODAT(conn, dirfsp, smb_fname, mode, dev) \
327         smb_vfs_call_mknodat((conn)->vfs_handles, (dirfsp), (smb_fname), (mode), (dev))
328 #define SMB_VFS_NEXT_MKNODAT(handle, dirfsp, smb_fname, mode, dev) \
329         smb_vfs_call_mknodat((handle)->next, (dirfsp), (smb_fname), (mode), (dev))
330
331 #define SMB_VFS_REALPATH(conn, ctx, smb_fname) \
332         smb_vfs_call_realpath((conn)->vfs_handles, (ctx), (smb_fname))
333 #define SMB_VFS_NEXT_REALPATH(handle, ctx, smb_fname) \
334         smb_vfs_call_realpath((handle)->next, (ctx), (smb_fname))
335
336 #define SMB_VFS_CHFLAGS(conn, smb_fname, flags) \
337         smb_vfs_call_chflags((conn)->vfs_handles, (smb_fname), (flags))
338 #define SMB_VFS_NEXT_CHFLAGS(handle, smb_fname, flags) \
339         smb_vfs_call_chflags((handle)->next, (smb_fname), (flags))
340
341 #define SMB_VFS_FILE_ID_CREATE(conn, sbuf) \
342         smb_vfs_call_file_id_create((conn)->vfs_handles, (sbuf))
343 #define SMB_VFS_NEXT_FILE_ID_CREATE(handle, sbuf) \
344         smb_vfs_call_file_id_create((handle)->next, (sbuf))
345
346 #define SMB_VFS_FS_FILE_ID(conn, sbuf) \
347         smb_vfs_call_fs_file_id((conn)->vfs_handles, (sbuf))
348 #define SMB_VFS_NEXT_FS_FILE_ID(handle, sbuf) \
349         smb_vfs_call_fs_file_id((handle)->next, (sbuf))
350
351 #define SMB_VFS_STREAMINFO(conn, fsp, smb_fname, mem_ctx, num_streams, streams) \
352         smb_vfs_call_streaminfo((conn)->vfs_handles, (fsp), (smb_fname), (mem_ctx), (num_streams), (streams))
353 #define SMB_VFS_NEXT_STREAMINFO(handle, fsp, smb_fname, mem_ctx, num_streams, streams) \
354         smb_vfs_call_streaminfo((handle)->next, (fsp), (smb_fname), (mem_ctx), (num_streams), (streams))
355
356 #define SMB_VFS_FSTREAMINFO(fsp, mem_ctx, num_streams, streams) \
357         smb_vfs_call_fstreaminfo((fsp)->conn->vfs_handles, (fsp), (mem_ctx), (num_streams), (streams))
358 #define SMB_VFS_NEXT_FSTREAMINFO(handle, fsp, mem_ctx, num_streams, streams) \
359         smb_vfs_call_fstreaminfo(handle->next, (fsp), (mem_ctx), (num_streams), (streams))
360
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))
365
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))
370
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))
375
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))
380
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))
385
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))
390
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))
393
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))
396
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))
401
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))
408
409 #define SMB_VFS_NEXT_GET_DOS_ATTRIBUTES_SEND(mem_ctx, evg, handle, dir_fsp, \
410                                              smb_fname) \
411         smb_vfs_call_get_dos_attributes_send((mem_ctx), (evg), \
412                                              (handle)->next, \
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))
416
417 #define SMB_VFS_FSET_DOS_ATTRIBUTES(conn, fsp, attributes) \
418         smb_vfs_call_fset_dos_attributes((conn)->vfs_handles, (fsp), (attributes))
419 #define SMB_VFS_NEXT_FSET_DOS_ATTRIBUTES(handle, fsp, attributes) \
420         smb_vfs_call_fset_dos_attributes((handle)->next, (fsp), (attributes))
421
422 #define SMB_VFS_OFFLOAD_READ_SEND(mem_ctx, ev, fsp, fsctl, ttl, offset, to_copy) \
423         smb_vfs_call_offload_read_send((mem_ctx), (ev), (fsp)->conn->vfs_handles, fsp, (fsctl), (ttl), (offset), (to_copy))
424 #define SMB_VFS_NEXT_OFFLOAD_READ_SEND(mem_ctx, ev, handle, fsp, fsctl, ttl, offset, to_copy) \
425         smb_vfs_call_offload_read_send((mem_ctx), (ev), (handle)->next, (fsp), (fsctl), (ttl), (offset), (to_copy))
426
427 #define SMB_VFS_OFFLOAD_READ_RECV(req, conn, mem_ctx, token_blob) \
428         smb_vfs_call_offload_read_recv((req), (conn)->vfs_handles, (mem_ctx), (token_blob))
429 #define SMB_VFS_NEXT_OFFLOAD_READ_RECV(req, handle, mem_ctx, token_blob) \
430         smb_vfs_call_offload_read_recv((req), (handle)->next, (mem_ctx), (token_blob))
431
432 #define SMB_VFS_OFFLOAD_WRITE_SEND(conn, mem_ctx, ev, fsctl, token, transfer_offset, dest_fsp, dest_off, num) \
433         smb_vfs_call_offload_write_send((conn)->vfs_handles, (mem_ctx), (ev), (fsctl), (token), (transfer_offset), (dest_fsp), (dest_off), (num))
434 #define SMB_VFS_NEXT_OFFLOAD_WRITE_SEND(handle, mem_ctx, ev, fsctl, token, transfer_offset, dest_fsp, dest_off, num) \
435         smb_vfs_call_offload_write_send((handle)->next, (mem_ctx), (ev), (fsctl), (token), (transfer_offset), (dest_fsp), (dest_off), (num))
436
437 #define SMB_VFS_OFFLOAD_WRITE_RECV(conn, req, copied) \
438         smb_vfs_call_offload_write_recv((conn)->vfs_handles, (req), (copied))
439 #define SMB_VFS_NEXT_OFFLOAD_WRITE_RECV(handle, req, copied) \
440         smb_vfs_call_offload_write_recv((handle)->next, (req), (copied))
441
442 #define SMB_VFS_FGET_COMPRESSION(conn, mem_ctx, fsp, _compression_fmt)          \
443         smb_vfs_call_fget_compression((conn)->vfs_handles, (mem_ctx), (fsp), (_compression_fmt))
444 #define SMB_VFS_NEXT_FGET_COMPRESSION(handle, mem_ctx, fsp, _compression_fmt)           \
445         smb_vfs_call_fget_compression((handle)->next, (mem_ctx), (fsp), (_compression_fmt))
446
447 #define SMB_VFS_SET_COMPRESSION(conn, mem_ctx, fsp, compression_fmt)            \
448         smb_vfs_call_set_compression((conn)->vfs_handles, (mem_ctx), (fsp), (compression_fmt))
449 #define SMB_VFS_NEXT_SET_COMPRESSION(handle, mem_ctx, fsp, compression_fmt)             \
450         smb_vfs_call_set_compression((handle)->next, (mem_ctx), (fsp), (compression_fmt))
451
452 #define SMB_VFS_SNAP_CHECK_PATH(conn, mem_ctx, service_path, base_volume) \
453         smb_vfs_call_snap_check_path((conn)->vfs_handles, (mem_ctx), (service_path), (base_volume))
454 #define SMB_VFS_NEXT_SNAP_CHECK_PATH(handle, mem_ctx, service_path, base_volume) \
455         smb_vfs_call_snap_check_path((handle)->next, (mem_ctx), (service_path), (base_volume))
456
457 #define SMB_VFS_SNAP_CREATE(conn, mem_ctx, base_volume, tstamp, rw, base_path, snap_path) \
458         smb_vfs_call_snap_create((conn)->vfs_handles, (mem_ctx), (base_volume), (tstamp), (rw), (base_path), (snap_path))
459 #define SMB_VFS_NEXT_SNAP_CREATE(handle, mem_ctx, base_volume, tstamp, rw, base_path, snap_path) \
460         smb_vfs_call_snap_create((handle)->next, (mem_ctx), (base_volume), (tstamp), (rw), (base_path), (snap_path))
461
462 #define SMB_VFS_SNAP_DELETE(conn, mem_ctx, base_path, snap_path) \
463         smb_vfs_call_snap_delete((conn)->vfs_handles, (mem_ctx), (base_path), (snap_path))
464 #define SMB_VFS_NEXT_SNAP_DELETE(handle, mem_ctx, base_path, snap_path) \
465         smb_vfs_call_snap_delete((handle)->next, (mem_ctx), (base_path), (snap_path))
466
467 #define SMB_VFS_FGET_NT_ACL(fsp, security_info, mem_ctx, ppdesc)                \
468         smb_vfs_call_fget_nt_acl((fsp)->conn->vfs_handles, (fsp), (security_info), (mem_ctx), (ppdesc))
469 #define SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, mem_ctx, ppdesc) \
470         smb_vfs_call_fget_nt_acl((handle)->next, (fsp), (security_info), (mem_ctx), (ppdesc))
471
472 #define SMB_VFS_GET_NT_ACL_AT(conn, dirfsp, smb_fname, security_info, mem_ctx, ppdesc)  \
473         smb_vfs_call_get_nt_acl_at((conn)->vfs_handles, (dirfsp), (smb_fname), (security_info), (mem_ctx), (ppdesc))
474 #define SMB_VFS_NEXT_GET_NT_ACL_AT(handle, dirfsp, smb_fname, security_info, mem_ctx, ppdesc) \
475         smb_vfs_call_get_nt_acl_at((handle)->next, (dirfsp), (smb_fname), (security_info), (mem_ctx), (ppdesc))
476
477 #define SMB_VFS_AUDIT_FILE(conn, name, sacl, access_requested, access_denied) \
478         smb_vfs_call_audit_file((conn)->vfs_handles, (name), (sacl), (access_requested), (access_denied))
479 #define SMB_VFS_NEXT_AUDIT_FILE(handle, name, sacl, access_requested, access_denied) \
480         smb_vfs_call_audit_file((handle)->next, (name), (sacl), (access_requested), (access_denied))
481
482 #define SMB_VFS_FSET_NT_ACL(fsp, security_info_sent, psd) \
483         smb_vfs_call_fset_nt_acl((fsp)->conn->vfs_handles, (fsp), (security_info_sent), (psd))
484 #define SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd) \
485         smb_vfs_call_fset_nt_acl((handle)->next, (fsp), (security_info_sent), (psd))
486
487 #define SMB_VFS_SYS_ACL_GET_FILE(conn, smb_fname, type, mem_ctx)                \
488         smb_vfs_call_sys_acl_get_file((conn)->vfs_handles, (smb_fname), (type), (mem_ctx))
489 #define SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, smb_fname, type, mem_ctx)         \
490         smb_vfs_call_sys_acl_get_file((handle)->next, (smb_fname), (type), (mem_ctx))
491
492 #define SMB_VFS_SYS_ACL_GET_FD(fsp, mem_ctx) \
493         smb_vfs_call_sys_acl_get_fd((fsp)->conn->vfs_handles, (fsp), (mem_ctx))
494 #define SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp, mem_ctx) \
495         smb_vfs_call_sys_acl_get_fd((handle)->next, (fsp), (mem_ctx))
496
497 #define SMB_VFS_SYS_ACL_BLOB_GET_FILE(conn, smb_fname, mem_ctx, blob_description, blob) \
498         smb_vfs_call_sys_acl_blob_get_file((conn)->vfs_handles, (smb_fname), (mem_ctx), (blob_description), (blob))
499 #define SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle, smb_fname, mem_ctx, blob_description, blob) \
500         smb_vfs_call_sys_acl_blob_get_file((handle)->next, (smb_fname), (mem_ctx), (blob_description), (blob))
501
502 #define SMB_VFS_SYS_ACL_BLOB_GET_FD(fsp, mem_ctx, blob_description, blob)                       \
503         smb_vfs_call_sys_acl_blob_get_fd((fsp)->conn->vfs_handles, (fsp), (mem_ctx), (blob_description), (blob))
504 #define SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FD(handle, fsp, mem_ctx, blob_description, blob)  \
505         smb_vfs_call_sys_acl_blob_get_fd((handle)->next, (fsp), mem_ctx, (blob_description), (blob))
506
507 #define SMB_VFS_SYS_ACL_SET_FD(fsp, type, theacl) \
508         smb_vfs_call_sys_acl_set_fd((fsp)->conn->vfs_handles, (fsp), (type), (theacl))
509 #define SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, type, theacl) \
510         smb_vfs_call_sys_acl_set_fd((handle)->next, (fsp), (type), (theacl))
511
512 #define SMB_VFS_SYS_ACL_DELETE_DEF_FILE(conn, smb_fname) \
513         smb_vfs_call_sys_acl_delete_def_file((conn)->vfs_handles, (smb_fname))
514 #define SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, smb_fname) \
515         smb_vfs_call_sys_acl_delete_def_file((handle)->next, (smb_fname))
516
517 #define SMB_VFS_GETXATTR(conn,smb_fname,name,value,size) \
518         smb_vfs_call_getxattr((conn)->vfs_handles,(smb_fname),(name),(value),(size))
519 #define SMB_VFS_NEXT_GETXATTR(handle,smb_fname,name,value,size) \
520         smb_vfs_call_getxattr((handle)->next,(smb_fname),(name),(value),(size))
521
522 #define SMB_VFS_GETXATTRAT_SEND(mem_ctx,ev,dir_fsp,smb_fname, \
523                                 xattr_name, alloc_hint) \
524         smb_vfs_call_getxattrat_send((mem_ctx),(ev), \
525                                      (dir_fsp)->conn->vfs_handles, \
526                                      (dir_fsp),(smb_fname),(xattr_name), \
527                                      (alloc_hint))
528 #define SMB_VFS_GETXATTRAT_RECV(req, aio_state, mem_ctx, xattr_value) \
529         smb_vfs_call_getxattrat_recv((req),(aio_state),(mem_ctx),(xattr_value))
530
531 #define SMB_VFS_NEXT_GETXATTRAT_SEND(mem_ctx,ev,handle,dir_fsp,smb_fname, \
532                                      xattr_name,alloc_hint) \
533         smb_vfs_call_getxattrat_send((mem_ctx),(ev), \
534                                      (handle)->next, \
535                                      (dir_fsp), (smb_fname),(xattr_name), \
536                                      (alloc_hint))
537 #define SMB_VFS_NEXT_GETXATTRAT_RECV(req, aio_state, mem_ctx, xattr_value) \
538         smb_vfs_call_getxattrat_recv((req),(aio_state),(mem_ctx),(xattr_value))
539
540 #define SMB_VFS_FGETXATTR(fsp,name,value,size) \
541         smb_vfs_call_fgetxattr((fsp)->conn->vfs_handles, (fsp), (name),(value),(size))
542 #define SMB_VFS_NEXT_FGETXATTR(handle,fsp,name,value,size) \
543         smb_vfs_call_fgetxattr((handle)->next,(fsp),(name),(value),(size))
544
545 #define SMB_VFS_FLISTXATTR(fsp,list,size) \
546         smb_vfs_call_flistxattr((fsp)->conn->vfs_handles, (fsp), (list),(size))
547 #define SMB_VFS_NEXT_FLISTXATTR(handle,fsp,list,size) \
548         smb_vfs_call_flistxattr((handle)->next,(fsp),(list),(size))
549
550 #define SMB_VFS_FREMOVEXATTR(fsp,name) \
551         smb_vfs_call_fremovexattr((fsp)->conn->vfs_handles, (fsp), (name))
552 #define SMB_VFS_NEXT_FREMOVEXATTR(handle,fsp,name) \
553         smb_vfs_call_fremovexattr((handle)->next,(fsp),(name))
554
555 #define SMB_VFS_FSETXATTR(fsp,name,value,size,flags) \
556         smb_vfs_call_fsetxattr((fsp)->conn->vfs_handles, (fsp), (name),(value),(size),(flags))
557 #define SMB_VFS_NEXT_FSETXATTR(handle,fsp,name,value,size,flags) \
558         smb_vfs_call_fsetxattr((handle)->next,(fsp),(name),(value),(size),(flags))
559
560 #define SMB_VFS_AIO_FORCE(fsp) \
561         smb_vfs_call_aio_force((fsp)->conn->vfs_handles, (fsp))
562 #define SMB_VFS_NEXT_AIO_FORCE(handle,fsp) \
563         smb_vfs_call_aio_force((handle)->next,(fsp))
564
565 /* durable handle operations */
566
567 #define SMB_VFS_DURABLE_COOKIE(fsp, mem_ctx, cookie) \
568         smb_vfs_call_durable_cookie((fsp)->conn->vfs_handles, \
569                                     (fsp), (mem_ctx), (cookie))
570 #define SMB_VFS_NEXT_DURABLE_COOKIE(handle, fsp, mem_ctx, cookie) \
571         smb_vfs_call_durable_cookie((handle)->next, \
572                                     (fsp), (mem_ctx), (cookie))
573
574 #define SMB_VFS_DURABLE_DISCONNECT(fsp, old_cookie, mem_ctx, new_cookie) \
575         smb_vfs_call_durable_disconnect((fsp)->conn->vfs_handles, \
576                                         (fsp), (old_cookie), (mem_ctx), (new_cookie))
577 #define SMB_VFS_NEXT_DURABLE_DISCONNECT(handle, fsp, old_cookie, mem_ctx, new_cookie) \
578         smb_vfs_call_durable_disconnect((handle)->next, \
579                                         (fsp), (old_cookie), (mem_ctx), (new_cookie))
580
581 #define SMB_VFS_DURABLE_RECONNECT(conn, smb1req, op, old_cookie, mem_ctx, fsp, new_cookie) \
582         smb_vfs_call_durable_reconnect((conn)->vfs_handles, \
583                                        (smb1req), (op), (old_cookie), \
584                                        (mem_ctx), (fsp), (new_cookie))
585 #define SMB_VFS_NEXT_DURABLE_RECONNECT(handle, smb1req, op, old_cookie, mem_ctx, fsp, new_cookie) \
586         smb_vfs_call_durable_reconnect((handle)->next, \
587                                         (smb1req), (op), (old_cookie), \
588                                         (mem_ctx), (fsp), (new_cookie))
589
590 #define SMB_VFS_READDIR_ATTR(conn, fname, mem_ctx, attr_data) \
591         smb_vfs_call_readdir_attr((conn)->vfs_handles, (fname), (mem_ctx), (attr_data))
592 #define SMB_VFS_NEXT_READDIR_ATTR(conn, fname, mem_ctx, attr_data) \
593         smb_vfs_call_readdir_attr((handle)->next, (fname), (mem_ctx), (attr_data))
594
595 #endif /* _VFS_MACROS_H */