gp: Fix startup scripts add not always set runonce
[Samba.git] / source3 / include / vfs_macros.h
blobf1a59e1d13abd2834fdf6474248d26212a46ec0b
1 /*
2 Unix SMB/CIFS implementation.
3 VFS wrapper macros
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/>.
21 #ifndef _VFS_MACROS_H
22 #define _VFS_MACROS_H
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!
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))
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, \
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))
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, how) \
146 smb_vfs_call_openat( \
147 (conn)->vfs_handles, (dirfsp), (smb_fname), (fsp), (how))
148 #define SMB_VFS_NEXT_OPENAT(handle, dirfsp, smb_fname, fsp, how) \
149 smb_vfs_call_openat( \
150 (handle)->next, (dirfsp), (smb_fname), (fsp), (how))
152 #define SMB_VFS_CREATE_FILE(conn, req, dirfsp, 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, in_context_blobs, out_context_blobs) \
154 smb_vfs_call_create_file((conn)->vfs_handles, (req), (dirfsp), (smb_fname), (access_mask), (share_access), (create_disposition), \
155 (create_options), (file_attributes), (oplock_request), (lease), (allocation_size), (private_flags), (sd), (ea_list), (result), (pinfo), \
156 (in_context_blobs), (out_context_blobs))
157 #define SMB_VFS_NEXT_CREATE_FILE(handle, req, dirfsp, 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, in_context_blobs, out_context_blobs) \
159 smb_vfs_call_create_file((handle)->next, (req), (dirfsp), (smb_fname), (access_mask), (share_access), (create_disposition), \
160 (create_options), (file_attributes), (oplock_request), (lease), (allocation_size), (private_flags), (sd), (ea_list), (result), (pinfo), \
161 (in_context_blobs), (out_context_blobs))
163 #define SMB_VFS_CLOSE(fsp) \
164 smb_vfs_call_close((fsp)->conn->vfs_handles, (fsp))
165 #define SMB_VFS_NEXT_CLOSE(handle, fsp) \
166 smb_vfs_call_close((handle)->next, (fsp))
168 #define SMB_VFS_PREAD(fsp, data, n, off) \
169 smb_vfs_call_pread((fsp)->conn->vfs_handles, (fsp), (data), (n), (off))
170 #define SMB_VFS_NEXT_PREAD(handle, fsp, data, n, off) \
171 smb_vfs_call_pread((handle)->next, (fsp), (data), (n), (off))
173 #define SMB_VFS_PREAD_SEND(mem_ctx, ev, fsp, data, n, off) \
174 smb_vfs_call_pread_send((fsp)->conn->vfs_handles, (mem_ctx), (ev), \
175 (fsp), (data), (n), (off))
176 #define SMB_VFS_NEXT_PREAD_SEND(mem_ctx, ev, handle, fsp, data, n, off) \
177 smb_vfs_call_pread_send((handle)->next, (mem_ctx), (ev), (fsp), \
178 (data), (n), (off))
180 #define SMB_VFS_PWRITE(fsp, data, n, off) \
181 smb_vfs_call_pwrite((fsp)->conn->vfs_handles, (fsp), (data), (n), (off))
182 #define SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, off) \
183 smb_vfs_call_pwrite((handle)->next, (fsp), (data), (n), (off))
185 #define SMB_VFS_PWRITE_SEND(mem_ctx, ev, fsp, data, n, off) \
186 smb_vfs_call_pwrite_send((fsp)->conn->vfs_handles, (mem_ctx), (ev), \
187 (fsp), (data), (n), (off))
188 #define SMB_VFS_NEXT_PWRITE_SEND(mem_ctx, ev, handle, fsp, data, n, off) \
189 smb_vfs_call_pwrite_send((handle)->next, (mem_ctx), (ev), (fsp), \
190 (data), (n), (off))
192 #define SMB_VFS_LSEEK(fsp, offset, whence) \
193 smb_vfs_call_lseek((fsp)->conn->vfs_handles, (fsp), (offset), (whence))
194 #define SMB_VFS_NEXT_LSEEK(handle, fsp, offset, whence) \
195 smb_vfs_call_lseek((handle)->next, (fsp), (offset), (whence))
197 #define SMB_VFS_SENDFILE(tofd, fromfsp, header, offset, count) \
198 smb_vfs_call_sendfile((fromfsp)->conn->vfs_handles, (tofd), (fromfsp), (header), (offset), (count))
199 #define SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp, header, offset, count) \
200 smb_vfs_call_sendfile((handle)->next, (tofd), (fromfsp), (header), (offset), (count))
202 #define SMB_VFS_RECVFILE(fromfd, tofsp, offset, count) \
203 smb_vfs_call_recvfile((tofsp)->conn->vfs_handles, (fromfd), (tofsp), (offset), (count))
204 #define SMB_VFS_NEXT_RECVFILE(handle, fromfd, tofsp, offset, count) \
205 smb_vfs_call_recvfile((handle)->next, (fromfd), (tofsp), (offset), (count))
207 #define SMB_VFS_RENAMEAT(conn, oldfsp, old, newfsp, new) \
208 smb_vfs_call_renameat((conn)->vfs_handles, (oldfsp), (old), (newfsp), (new))
209 #define SMB_VFS_NEXT_RENAMEAT(handle, oldfsp, old, newfsp, new) \
210 smb_vfs_call_renameat((handle)->next, (oldfsp), (old), (newfsp), (new))
212 #define SMB_VFS_FSYNC_SEND(mem_ctx, ev, fsp) \
213 smb_vfs_call_fsync_send((fsp)->conn->vfs_handles, (mem_ctx), (ev), \
214 (fsp))
215 #define SMB_VFS_NEXT_FSYNC_SEND(mem_ctx, ev, handle, fsp) \
216 smb_vfs_call_fsync_send((handle)->next, (mem_ctx), (ev), (fsp))
218 #define SMB_VFS_STAT(conn, smb_fname) \
219 smb_vfs_call_stat((conn)->vfs_handles, (smb_fname))
220 #define SMB_VFS_NEXT_STAT(handle, smb_fname) \
221 smb_vfs_call_stat((handle)->next, (smb_fname))
223 #define SMB_VFS_FSTAT(fsp, sbuf) \
224 smb_vfs_call_fstat((fsp)->conn->vfs_handles, (fsp), (sbuf))
225 #define SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf) \
226 smb_vfs_call_fstat((handle)->next, (fsp), (sbuf))
228 #define SMB_VFS_LSTAT(conn, smb_fname) \
229 smb_vfs_call_lstat((conn)->vfs_handles, (smb_fname))
230 #define SMB_VFS_NEXT_LSTAT(handle, smb_fname) \
231 smb_vfs_call_lstat((handle)->next, (smb_fname))
233 #define SMB_VFS_FSTATAT(conn, dirfsp, smb_fname, sbuf, flags) \
234 smb_vfs_call_fstatat((conn)->vfs_handles, (dirfsp), (smb_fname), \
235 (sbuf), (flags))
236 #define SMB_VFS_NEXT_FSTATAT(conn, dirfsp, smb_fname, sbuf, flags) \
237 smb_vfs_call_fstatat((handle)->next, (dirfsp), (smb_fname), \
238 (sbuf), (flags))
240 #define SMB_VFS_GET_ALLOC_SIZE(conn, fsp, sbuf) \
241 smb_vfs_call_get_alloc_size((conn)->vfs_handles, (fsp), (sbuf))
242 #define SMB_VFS_NEXT_GET_ALLOC_SIZE(conn, fsp, sbuf) \
243 smb_vfs_call_get_alloc_size((conn)->next, (fsp), (sbuf))
245 #define SMB_VFS_UNLINKAT(conn, dirfsp, path, flags) \
246 smb_vfs_call_unlinkat((conn)->vfs_handles, (dirfsp), (path), (flags))
247 #define SMB_VFS_NEXT_UNLINKAT(handle, dirfsp, path, flags) \
248 smb_vfs_call_unlinkat((handle)->next, (dirfsp), (path), (flags))
250 #define SMB_VFS_FCHMOD(fsp, mode) \
251 smb_vfs_call_fchmod((fsp)->conn->vfs_handles, (fsp), (mode))
252 #define SMB_VFS_NEXT_FCHMOD(handle, fsp, mode) \
253 smb_vfs_call_fchmod((handle)->next, (fsp), (mode))
255 #define SMB_VFS_FCHOWN(fsp, uid, gid) \
256 smb_vfs_call_fchown((fsp)->conn->vfs_handles, (fsp), (uid), (gid))
257 #define SMB_VFS_NEXT_FCHOWN(handle, fsp, uid, gid) \
258 smb_vfs_call_fchown((handle)->next, (fsp), (uid), (gid))
260 #define SMB_VFS_LCHOWN(conn, smb_fname, uid, gid) \
261 smb_vfs_call_lchown((conn)->vfs_handles, (smb_fname), (uid), (gid))
262 #define SMB_VFS_NEXT_LCHOWN(handle, smb_fname, uid, gid) \
263 smb_vfs_call_lchown((handle)->next, (smb_fname), (uid), (gid))
265 #define SMB_VFS_CHDIR(conn, smb_fname) \
266 smb_vfs_call_chdir((conn)->vfs_handles, (smb_fname))
267 #define SMB_VFS_NEXT_CHDIR(handle, smb_fname) \
268 smb_vfs_call_chdir((handle)->next, (smb_fname))
270 #define SMB_VFS_GETWD(conn, ctx) \
271 smb_vfs_call_getwd((conn)->vfs_handles, (ctx))
272 #define SMB_VFS_NEXT_GETWD(handle, ctx) \
273 smb_vfs_call_getwd((handle)->next, (ctx))
275 #define SMB_VFS_FNTIMES(fsp, ts) \
276 smb_vfs_call_fntimes((fsp)->conn->vfs_handles, (fsp), (ts))
277 #define SMB_VFS_NEXT_FNTIMES(handle, fsp, ts) \
278 smb_vfs_call_fntimes((handle)->next, (fsp), (ts))
280 #define SMB_VFS_FTRUNCATE(fsp, offset) \
281 smb_vfs_call_ftruncate((fsp)->conn->vfs_handles, (fsp), (offset))
282 #define SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset) \
283 smb_vfs_call_ftruncate((handle)->next, (fsp), (offset))
285 #define SMB_VFS_FALLOCATE(fsp, mode, offset, len) \
286 smb_vfs_call_fallocate((fsp)->conn->vfs_handles, (fsp), (mode), (offset), (len))
287 #define SMB_VFS_NEXT_FALLOCATE(handle, fsp, mode, offset, len) \
288 smb_vfs_call_fallocate((handle)->next, (fsp), (mode), (offset), (len))
290 #define SMB_VFS_LOCK(fsp, op, offset, count, type) \
291 smb_vfs_call_lock((fsp)->conn->vfs_handles, (fsp), (op), (offset), (count), (type))
292 #define SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type) \
293 smb_vfs_call_lock((handle)->next, (fsp), (op), (offset), (count), (type))
295 #define SMB_VFS_FILESYSTEM_SHAREMODE(fsp, share_access, access_mask) \
296 smb_vfs_call_filesystem_sharemode((fsp)->conn->vfs_handles, \
297 (fsp), \
298 (share_access), \
299 (access_mask))
300 #define SMB_VFS_NEXT_FILESYSTEM_SHAREMODE(handle, fsp, share_access, \
301 access_mask) \
302 smb_vfs_call_filesystem_sharemode((handle)->next, \
303 (fsp), \
304 (share_access), \
305 (access_mask))
307 #define SMB_VFS_FCNTL(fsp, cmd, ...) \
308 smb_vfs_call_fcntl((fsp)->conn->vfs_handles, (fsp), (cmd), (__VA_ARGS__))
309 #define SMB_VFS_NEXT_FCNTL(handle, fsp, cmd, ...) \
310 smb_vfs_call_fcntl((handle)->next, (fsp), (cmd), (__VA_ARGS__))
312 #define SMB_VFS_LINUX_SETLEASE(fsp, leasetype) \
313 smb_vfs_call_linux_setlease((fsp)->conn->vfs_handles, (fsp), (leasetype))
314 #define SMB_VFS_NEXT_LINUX_SETLEASE(handle, fsp, leasetype) \
315 smb_vfs_call_linux_setlease((handle)->next, (fsp), (leasetype))
317 #define SMB_VFS_GETLOCK(fsp, poffset, pcount, ptype, ppid) \
318 smb_vfs_call_getlock((fsp)->conn->vfs_handles, (fsp), (poffset), (pcount), (ptype), (ppid))
319 #define SMB_VFS_NEXT_GETLOCK(handle, fsp, poffset, pcount, ptype, ppid) \
320 smb_vfs_call_getlock((handle)->next, (fsp), (poffset), (pcount), (ptype), (ppid))
322 #define SMB_VFS_SYMLINKAT(conn, oldpath, dirfsp, newpath) \
323 smb_vfs_call_symlinkat((conn)->vfs_handles, (oldpath), (dirfsp), (newpath))
324 #define SMB_VFS_NEXT_SYMLINKAT(handle, oldpath, dirfsp, newpath) \
325 smb_vfs_call_symlinkat((handle)->next, (oldpath), (dirfsp), (newpath))
327 #define SMB_VFS_READLINKAT(conn, dirfsp, smb_fname, buf, bufsiz) \
328 smb_vfs_call_readlinkat((conn)->vfs_handles, (dirfsp), (smb_fname), (buf), (bufsiz))
329 #define SMB_VFS_NEXT_READLINKAT(handle, dirfsp, smb_fname, buf, bufsiz) \
330 smb_vfs_call_readlinkat((handle)->next, (dirfsp), (smb_fname), (buf), (bufsiz))
332 #define SMB_VFS_LINKAT(conn, srcfsp, oldpath, dstfsp, newpath, flags) \
333 smb_vfs_call_linkat((conn)->vfs_handles, (srcfsp), (oldpath), (dstfsp), (newpath), (flags))
334 #define SMB_VFS_NEXT_LINKAT(handle, srcfsp, oldpath, dstfsp, newpath, flags) \
335 smb_vfs_call_linkat((handle)->next, (srcfsp), (oldpath), (dstfsp), (newpath), (flags))
337 #define SMB_VFS_MKNODAT(conn, dirfsp, smb_fname, mode, dev) \
338 smb_vfs_call_mknodat((conn)->vfs_handles, (dirfsp), (smb_fname), (mode), (dev))
339 #define SMB_VFS_NEXT_MKNODAT(handle, dirfsp, smb_fname, mode, dev) \
340 smb_vfs_call_mknodat((handle)->next, (dirfsp), (smb_fname), (mode), (dev))
342 #define SMB_VFS_REALPATH(conn, ctx, smb_fname) \
343 smb_vfs_call_realpath((conn)->vfs_handles, (ctx), (smb_fname))
344 #define SMB_VFS_NEXT_REALPATH(handle, ctx, smb_fname) \
345 smb_vfs_call_realpath((handle)->next, (ctx), (smb_fname))
347 #define SMB_VFS_FCHFLAGS(fsp, flags) \
348 smb_vfs_call_fchflags((fsp)->conn->vfs_handles, (fsp), (flags))
349 #define SMB_VFS_NEXT_FCHFLAGS(handle, fsp, flags) \
350 smb_vfs_call_fchflags((handle)->next, (fsp), (flags))
352 #define SMB_VFS_FILE_ID_CREATE(conn, sbuf) \
353 smb_vfs_call_file_id_create((conn)->vfs_handles, (sbuf))
354 #define SMB_VFS_NEXT_FILE_ID_CREATE(handle, sbuf) \
355 smb_vfs_call_file_id_create((handle)->next, (sbuf))
357 #define SMB_VFS_FS_FILE_ID(conn, sbuf) \
358 smb_vfs_call_fs_file_id((conn)->vfs_handles, (sbuf))
359 #define SMB_VFS_NEXT_FS_FILE_ID(handle, sbuf) \
360 smb_vfs_call_fs_file_id((handle)->next, (sbuf))
362 #define SMB_VFS_STREAMINFO(conn, fsp, smb_fname, mem_ctx, num_streams, streams) \
363 smb_vfs_call_streaminfo((conn)->vfs_handles, (fsp), (smb_fname), (mem_ctx), (num_streams), (streams))
364 #define SMB_VFS_NEXT_STREAMINFO(handle, fsp, smb_fname, mem_ctx, num_streams, streams) \
365 smb_vfs_call_streaminfo((handle)->next, (fsp), (smb_fname), (mem_ctx), (num_streams), (streams))
367 #define SMB_VFS_FSTREAMINFO(fsp, mem_ctx, num_streams, streams) \
368 smb_vfs_call_fstreaminfo((fsp)->conn->vfs_handles, (fsp), (mem_ctx), (num_streams), (streams))
369 #define SMB_VFS_NEXT_FSTREAMINFO(handle, fsp, mem_ctx, num_streams, streams) \
370 smb_vfs_call_fstreaminfo(handle->next, (fsp), (mem_ctx), (num_streams), (streams))
372 #define SMB_VFS_GET_REAL_FILENAME_AT(conn, dirfsp, name, mem_ctx, found_name) \
373 smb_vfs_call_get_real_filename_at( \
374 (conn)->vfs_handles, \
375 (dirfsp), \
376 (name), \
377 (mem_ctx), \
378 (found_name))
379 #define SMB_VFS_NEXT_GET_REAL_FILENAME_AT( \
380 handle, dirfsp, name, mem_ctx, found_name) \
381 smb_vfs_call_get_real_filename_at( \
382 (handle)->next, \
383 (dirfsp), \
384 (name), \
385 (mem_ctx), \
386 (found_name))
388 #define SMB_VFS_CONNECTPATH(conn, dirfsp, smb_fname) \
389 smb_vfs_call_connectpath((conn)->vfs_handles, (dirfsp), (smb_fname))
390 #define SMB_VFS_NEXT_CONNECTPATH(conn, dirfsp, smb_fname) \
391 smb_vfs_call_connectpath((conn)->next, (dirfsp), (smb_fname))
393 #define SMB_VFS_BRL_LOCK_WINDOWS(conn, br_lck, plock) \
394 smb_vfs_call_brl_lock_windows((conn)->vfs_handles, (br_lck), (plock))
395 #define SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle, br_lck, plock) \
396 smb_vfs_call_brl_lock_windows((handle)->next, (br_lck), (plock))
398 #define SMB_VFS_BRL_UNLOCK_WINDOWS(conn, br_lck, plock) \
399 smb_vfs_call_brl_unlock_windows((conn)->vfs_handles, (br_lck), (plock))
400 #define SMB_VFS_NEXT_BRL_UNLOCK_WINDOWS(handle, br_lck, plock) \
401 smb_vfs_call_brl_unlock_windows((handle)->next, (br_lck), (plock))
403 #define SMB_VFS_STRICT_LOCK_CHECK(conn, fsp, plock) \
404 smb_vfs_call_strict_lock_check((conn)->vfs_handles, (fsp), (plock))
405 #define SMB_VFS_NEXT_STRICT_LOCK_CHECK(handle, fsp, plock) \
406 smb_vfs_call_strict_lock_check((handle)->next, (fsp), (plock))
408 #define SMB_VFS_TRANSLATE_NAME(conn, name, direction, mem_ctx, mapped_name) \
409 smb_vfs_call_translate_name((conn)->vfs_handles, (name), (direction), (mem_ctx), (mapped_name))
410 #define SMB_VFS_NEXT_TRANSLATE_NAME(handle, name, direction, mem_ctx, mapped_name) \
411 smb_vfs_call_translate_name((handle)->next, (name), (direction), (mem_ctx), (mapped_name))
413 #define SMB_VFS_PARENT_PATHNAME(conn, mem_ctx, smb_fname_in, parent_dir_out, atname_out) \
414 smb_vfs_call_parent_pathname((conn)->vfs_handles, (mem_ctx), (smb_fname_in), (parent_dir_out), (atname_out))
415 #define SMB_VFS_NEXT_PARENT_PATHNAME(handle, mem_ctx, smb_fname_in, parent_dir_out, atname_out) \
416 smb_vfs_call_parent_pathname((handle)->next, (mem_ctx), (smb_fname_in), (parent_dir_out), (atname_out))
418 #define SMB_VFS_FSCTL(fsp, ctx, function, req_flags, in_data, in_len, out_data, max_out_len, out_len) \
419 smb_vfs_call_fsctl((fsp)->conn->vfs_handles, (fsp), (ctx), (function), (req_flags), (in_data), (in_len), (out_data), (max_out_len), (out_len))
421 #define SMB_VFS_NEXT_FSCTL(handle, fsp, ctx, function, req_flags, in_data, in_len, out_data, max_out_len, out_len) \
422 smb_vfs_call_fsctl((handle)->next, (fsp), (ctx), (function), (req_flags), (in_data), (in_len), (out_data), (max_out_len), (out_len))
424 #define SMB_VFS_FGET_DOS_ATTRIBUTES(conn, fsp, attributes) \
425 smb_vfs_call_fget_dos_attributes((conn)->vfs_handles, (fsp), (attributes))
426 #define SMB_VFS_NEXT_FGET_DOS_ATTRIBUTES(handle, fsp, attributes) \
427 smb_vfs_call_fget_dos_attributes((handle)->next, (fsp), (attributes))
429 #define SMB_VFS_GET_DOS_ATTRIBUTES_SEND(mem_ctx, evg, dir_fsp, smb_fname) \
430 smb_vfs_call_get_dos_attributes_send((mem_ctx), (evg), \
431 (dir_fsp)->conn->vfs_handles, \
432 (dir_fsp), (smb_fname))
433 #define SMB_VFS_GET_DOS_ATTRIBUTES_RECV(req, aio_state, dosmode) \
434 smb_vfs_call_get_dos_attributes_recv((req), (aio_state), (dosmode))
436 #define SMB_VFS_NEXT_GET_DOS_ATTRIBUTES_SEND(mem_ctx, evg, handle, dir_fsp, \
437 smb_fname) \
438 smb_vfs_call_get_dos_attributes_send((mem_ctx), (evg), \
439 (handle)->next, \
440 (dir_fsp), (smb_fname))
441 #define SMB_VFS_NEXT_GET_DOS_ATTRIBUTES_RECV(req, aio_state, dosmode) \
442 smb_vfs_call_get_dos_attributes_recv((req), (aio_state), (dosmode))
444 #define SMB_VFS_FSET_DOS_ATTRIBUTES(conn, fsp, attributes) \
445 smb_vfs_call_fset_dos_attributes((conn)->vfs_handles, (fsp), (attributes))
446 #define SMB_VFS_NEXT_FSET_DOS_ATTRIBUTES(handle, fsp, attributes) \
447 smb_vfs_call_fset_dos_attributes((handle)->next, (fsp), (attributes))
449 #define SMB_VFS_OFFLOAD_READ_SEND(mem_ctx, ev, fsp, fsctl, ttl, offset, to_copy) \
450 smb_vfs_call_offload_read_send((mem_ctx), (ev), (fsp)->conn->vfs_handles, fsp, (fsctl), (ttl), (offset), (to_copy))
451 #define SMB_VFS_NEXT_OFFLOAD_READ_SEND(mem_ctx, ev, handle, fsp, fsctl, ttl, offset, to_copy) \
452 smb_vfs_call_offload_read_send((mem_ctx), (ev), (handle)->next, (fsp), (fsctl), (ttl), (offset), (to_copy))
454 #define SMB_VFS_OFFLOAD_READ_RECV(req, conn, mem_ctx, flags, xferlen, token_blob) \
455 smb_vfs_call_offload_read_recv((req), (conn)->vfs_handles, (mem_ctx), (flags), (xferlen), (token_blob))
456 #define SMB_VFS_NEXT_OFFLOAD_READ_RECV(req, handle, mem_ctx, flags, xferlen, token_blob) \
457 smb_vfs_call_offload_read_recv((req), (handle)->next, (mem_ctx), flags, xferlen, (token_blob))
459 #define SMB_VFS_OFFLOAD_WRITE_SEND(conn, mem_ctx, ev, fsctl, token, transfer_offset, dest_fsp, dest_off, num) \
460 smb_vfs_call_offload_write_send((conn)->vfs_handles, (mem_ctx), (ev), (fsctl), (token), (transfer_offset), (dest_fsp), (dest_off), (num))
461 #define SMB_VFS_NEXT_OFFLOAD_WRITE_SEND(handle, mem_ctx, ev, fsctl, token, transfer_offset, dest_fsp, dest_off, num) \
462 smb_vfs_call_offload_write_send((handle)->next, (mem_ctx), (ev), (fsctl), (token), (transfer_offset), (dest_fsp), (dest_off), (num))
464 #define SMB_VFS_OFFLOAD_WRITE_RECV(conn, req, copied) \
465 smb_vfs_call_offload_write_recv((conn)->vfs_handles, (req), (copied))
466 #define SMB_VFS_NEXT_OFFLOAD_WRITE_RECV(handle, req, copied) \
467 smb_vfs_call_offload_write_recv((handle)->next, (req), (copied))
469 #define SMB_VFS_FGET_COMPRESSION(conn, mem_ctx, fsp, _compression_fmt) \
470 smb_vfs_call_fget_compression((conn)->vfs_handles, (mem_ctx), (fsp), (_compression_fmt))
471 #define SMB_VFS_NEXT_FGET_COMPRESSION(handle, mem_ctx, fsp, _compression_fmt) \
472 smb_vfs_call_fget_compression((handle)->next, (mem_ctx), (fsp), (_compression_fmt))
474 #define SMB_VFS_SET_COMPRESSION(conn, mem_ctx, fsp, compression_fmt) \
475 smb_vfs_call_set_compression((conn)->vfs_handles, (mem_ctx), (fsp), (compression_fmt))
476 #define SMB_VFS_NEXT_SET_COMPRESSION(handle, mem_ctx, fsp, compression_fmt) \
477 smb_vfs_call_set_compression((handle)->next, (mem_ctx), (fsp), (compression_fmt))
479 #define SMB_VFS_SNAP_CHECK_PATH(conn, mem_ctx, service_path, base_volume) \
480 smb_vfs_call_snap_check_path((conn)->vfs_handles, (mem_ctx), (service_path), (base_volume))
481 #define SMB_VFS_NEXT_SNAP_CHECK_PATH(handle, mem_ctx, service_path, base_volume) \
482 smb_vfs_call_snap_check_path((handle)->next, (mem_ctx), (service_path), (base_volume))
484 #define SMB_VFS_SNAP_CREATE(conn, mem_ctx, base_volume, tstamp, rw, base_path, snap_path) \
485 smb_vfs_call_snap_create((conn)->vfs_handles, (mem_ctx), (base_volume), (tstamp), (rw), (base_path), (snap_path))
486 #define SMB_VFS_NEXT_SNAP_CREATE(handle, mem_ctx, base_volume, tstamp, rw, base_path, snap_path) \
487 smb_vfs_call_snap_create((handle)->next, (mem_ctx), (base_volume), (tstamp), (rw), (base_path), (snap_path))
489 #define SMB_VFS_SNAP_DELETE(conn, mem_ctx, base_path, snap_path) \
490 smb_vfs_call_snap_delete((conn)->vfs_handles, (mem_ctx), (base_path), (snap_path))
491 #define SMB_VFS_NEXT_SNAP_DELETE(handle, mem_ctx, base_path, snap_path) \
492 smb_vfs_call_snap_delete((handle)->next, (mem_ctx), (base_path), (snap_path))
494 #define SMB_VFS_FGET_NT_ACL(fsp, security_info, mem_ctx, ppdesc) \
495 smb_vfs_call_fget_nt_acl((fsp)->conn->vfs_handles, (fsp), (security_info), (mem_ctx), (ppdesc))
496 #define SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, mem_ctx, ppdesc) \
497 smb_vfs_call_fget_nt_acl((handle)->next, (fsp), (security_info), (mem_ctx), (ppdesc))
499 #define SMB_VFS_AUDIT_FILE(conn, name, sacl, access_requested, access_denied) \
500 smb_vfs_call_audit_file((conn)->vfs_handles, (name), (sacl), (access_requested), (access_denied))
501 #define SMB_VFS_NEXT_AUDIT_FILE(handle, name, sacl, access_requested, access_denied) \
502 smb_vfs_call_audit_file((handle)->next, (name), (sacl), (access_requested), (access_denied))
504 #define SMB_VFS_FSET_NT_ACL(fsp, security_info_sent, psd) \
505 smb_vfs_call_fset_nt_acl((fsp)->conn->vfs_handles, (fsp), (security_info_sent), (psd))
506 #define SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd) \
507 smb_vfs_call_fset_nt_acl((handle)->next, (fsp), (security_info_sent), (psd))
509 #define SMB_VFS_SYS_ACL_GET_FD(fsp, type, mem_ctx) \
510 smb_vfs_call_sys_acl_get_fd((fsp)->conn->vfs_handles, (fsp), (type), (mem_ctx))
511 #define SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp, type, mem_ctx) \
512 smb_vfs_call_sys_acl_get_fd((handle)->next, (fsp), (type), (mem_ctx))
514 #define SMB_VFS_SYS_ACL_BLOB_GET_FD(fsp, mem_ctx, blob_description, blob) \
515 smb_vfs_call_sys_acl_blob_get_fd((fsp)->conn->vfs_handles, (fsp), (mem_ctx), (blob_description), (blob))
516 #define SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FD(handle, fsp, mem_ctx, blob_description, blob) \
517 smb_vfs_call_sys_acl_blob_get_fd((handle)->next, (fsp), mem_ctx, (blob_description), (blob))
519 #define SMB_VFS_SYS_ACL_SET_FD(fsp, type, theacl) \
520 smb_vfs_call_sys_acl_set_fd((fsp)->conn->vfs_handles, (fsp), (type), (theacl))
521 #define SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, type, theacl) \
522 smb_vfs_call_sys_acl_set_fd((handle)->next, (fsp), (type), (theacl))
524 #define SMB_VFS_SYS_ACL_DELETE_DEF_FD(fsp) \
525 smb_vfs_call_sys_acl_delete_def_fd((fsp)->conn->vfs_handles, (fsp))
526 #define SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FD(handle, fsp) \
527 smb_vfs_call_sys_acl_delete_def_fd((handle)->next, (fsp))
529 #define SMB_VFS_GETXATTRAT_SEND(mem_ctx,ev,dir_fsp,smb_fname, \
530 xattr_name, alloc_hint) \
531 smb_vfs_call_getxattrat_send((mem_ctx),(ev), \
532 (dir_fsp)->conn->vfs_handles, \
533 (dir_fsp),(smb_fname),(xattr_name), \
534 (alloc_hint))
535 #define SMB_VFS_GETXATTRAT_RECV(req, aio_state, mem_ctx, xattr_value) \
536 smb_vfs_call_getxattrat_recv((req),(aio_state),(mem_ctx),(xattr_value))
538 #define SMB_VFS_NEXT_GETXATTRAT_SEND(mem_ctx,ev,handle,dir_fsp,smb_fname, \
539 xattr_name,alloc_hint) \
540 smb_vfs_call_getxattrat_send((mem_ctx),(ev), \
541 (handle)->next, \
542 (dir_fsp), (smb_fname),(xattr_name), \
543 (alloc_hint))
544 #define SMB_VFS_NEXT_GETXATTRAT_RECV(req, aio_state, mem_ctx, xattr_value) \
545 smb_vfs_call_getxattrat_recv((req),(aio_state),(mem_ctx),(xattr_value))
547 #define SMB_VFS_FGETXATTR(fsp,name,value,size) \
548 smb_vfs_call_fgetxattr((fsp)->conn->vfs_handles, (fsp), (name),(value),(size))
549 #define SMB_VFS_NEXT_FGETXATTR(handle,fsp,name,value,size) \
550 smb_vfs_call_fgetxattr((handle)->next,(fsp),(name),(value),(size))
552 #define SMB_VFS_FLISTXATTR(fsp,list,size) \
553 smb_vfs_call_flistxattr((fsp)->conn->vfs_handles, (fsp), (list),(size))
554 #define SMB_VFS_NEXT_FLISTXATTR(handle,fsp,list,size) \
555 smb_vfs_call_flistxattr((handle)->next,(fsp),(list),(size))
557 #define SMB_VFS_FREMOVEXATTR(fsp,name) \
558 smb_vfs_call_fremovexattr((fsp)->conn->vfs_handles, (fsp), (name))
559 #define SMB_VFS_NEXT_FREMOVEXATTR(handle,fsp,name) \
560 smb_vfs_call_fremovexattr((handle)->next,(fsp),(name))
562 #define SMB_VFS_FSETXATTR(fsp,name,value,size,flags) \
563 smb_vfs_call_fsetxattr((fsp)->conn->vfs_handles, (fsp), (name),(value),(size),(flags))
564 #define SMB_VFS_NEXT_FSETXATTR(handle,fsp,name,value,size,flags) \
565 smb_vfs_call_fsetxattr((handle)->next,(fsp),(name),(value),(size),(flags))
567 #define SMB_VFS_AIO_FORCE(fsp) \
568 smb_vfs_call_aio_force((fsp)->conn->vfs_handles, (fsp))
569 #define SMB_VFS_NEXT_AIO_FORCE(handle,fsp) \
570 smb_vfs_call_aio_force((handle)->next,(fsp))
572 /* durable handle operations */
574 #define SMB_VFS_DURABLE_COOKIE(fsp, mem_ctx, cookie) \
575 smb_vfs_call_durable_cookie((fsp)->conn->vfs_handles, \
576 (fsp), (mem_ctx), (cookie))
577 #define SMB_VFS_NEXT_DURABLE_COOKIE(handle, fsp, mem_ctx, cookie) \
578 smb_vfs_call_durable_cookie((handle)->next, \
579 (fsp), (mem_ctx), (cookie))
581 #define SMB_VFS_DURABLE_DISCONNECT(fsp, old_cookie, mem_ctx, new_cookie) \
582 smb_vfs_call_durable_disconnect((fsp)->conn->vfs_handles, \
583 (fsp), (old_cookie), (mem_ctx), (new_cookie))
584 #define SMB_VFS_NEXT_DURABLE_DISCONNECT(handle, fsp, old_cookie, mem_ctx, new_cookie) \
585 smb_vfs_call_durable_disconnect((handle)->next, \
586 (fsp), (old_cookie), (mem_ctx), (new_cookie))
588 #define SMB_VFS_DURABLE_RECONNECT(conn, smb1req, op, old_cookie, mem_ctx, fsp, new_cookie) \
589 smb_vfs_call_durable_reconnect((conn)->vfs_handles, \
590 (smb1req), (op), (old_cookie), \
591 (mem_ctx), (fsp), (new_cookie))
592 #define SMB_VFS_NEXT_DURABLE_RECONNECT(handle, smb1req, op, old_cookie, mem_ctx, fsp, new_cookie) \
593 smb_vfs_call_durable_reconnect((handle)->next, \
594 (smb1req), (op), (old_cookie), \
595 (mem_ctx), (fsp), (new_cookie))
597 #define SMB_VFS_FREADDIR_ATTR(fsp, mem_ctx, attr_data) \
598 smb_vfs_call_freaddir_attr((fsp)->conn->vfs_handles, (fsp), (mem_ctx), (attr_data))
599 #define SMB_VFS_NEXT_FREADDIR_ATTR(handle, fsp, mem_ctx, attr_data) \
600 smb_vfs_call_freaddir_attr((handle)->next, (fsp), (mem_ctx), (attr_data))
602 #endif /* _VFS_MACROS_H */