2 Unix SMB/CIFS implementation.
4 Copyright (C) Stefan (metze) Metzmacher 2003
5 Copyright (C) Volker Lendecke 2009
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
25 * These macros SMB_VFS_<FOO> (and SMB_VFS_NEXT_<FOO>) are our
26 * interface for the VFS.
28 * Don't access conn->vfs_handles[->next]->fns->* directly!
32 #define SMB_VFS_CONNECT(conn, service, user) \
33 smb_vfs_call_connect((conn)->vfs_handles, (service), (user))
34 #define SMB_VFS_NEXT_CONNECT(handle, service, user) \
35 smb_vfs_call_connect((handle)->next, (service), (user))
37 #define SMB_VFS_DISCONNECT(conn) \
38 smb_vfs_call_disconnect((conn)->vfs_handles)
39 #define SMB_VFS_NEXT_DISCONNECT(handle) \
40 smb_vfs_call_disconnect((handle)->next)
42 #define SMB_VFS_DISK_FREE(conn, smb_fname, bsize, dfree ,dsize) \
43 smb_vfs_call_disk_free((conn)->vfs_handles, (smb_fname), (bsize), (dfree), (dsize))
44 #define SMB_VFS_NEXT_DISK_FREE(handle, smb_fname, bsize, dfree ,dsize)\
45 smb_vfs_call_disk_free((handle)->next, (smb_fname), (bsize), (dfree), (dsize))
47 #define SMB_VFS_GET_QUOTA(conn, smb_fname, qtype, id, qt) \
48 smb_vfs_call_get_quota((conn)->vfs_handles, (smb_fname), (qtype), (id), (qt))
49 #define SMB_VFS_NEXT_GET_QUOTA(handle, smb_fname, qtype, id, qt) \
50 smb_vfs_call_get_quota((handle)->next, (smb_fname), (qtype), (id), (qt))
52 #define SMB_VFS_SET_QUOTA(conn, qtype, id, qt) \
53 smb_vfs_call_set_quota((conn)->vfs_handles, (qtype), (id), (qt))
54 #define SMB_VFS_NEXT_SET_QUOTA(handle, qtype, id, qt) \
55 smb_vfs_call_set_quota((handle)->next, (qtype), (id), (qt))
57 #define SMB_VFS_GET_SHADOW_COPY_DATA(fsp,shadow_copy_data,labels) \
58 smb_vfs_call_get_shadow_copy_data((fsp)->conn->vfs_handles, (fsp), (shadow_copy_data), (labels))
59 #define SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle, fsp, shadow_copy_data ,labels) \
60 smb_vfs_call_get_shadow_copy_data((handle)->next, (fsp), (shadow_copy_data), (labels))
62 #define SMB_VFS_STATVFS(conn, smb_fname, statbuf) \
63 smb_vfs_call_statvfs((conn)->vfs_handles, (smb_fname), (statbuf))
64 #define SMB_VFS_NEXT_STATVFS(handle, smb_fname, statbuf) \
65 smb_vfs_call_statvfs((handle)->next, (smb_fname), (statbuf))
67 #define SMB_VFS_FS_CAPABILITIES(conn, p_ts_res) \
68 smb_vfs_call_fs_capabilities((conn)->vfs_handles, (p_ts_res))
69 #define SMB_VFS_NEXT_FS_CAPABILITIES(handle, p_ts_res) \
70 smb_vfs_call_fs_capabilities((handle)->next, (p_ts_res))
73 * Note: that "struct dfs_GetDFSReferral *r"
74 * needs to be a valid TALLOC_CTX
76 #define SMB_VFS_GET_DFS_REFERRALS(conn, r) \
77 smb_vfs_call_get_dfs_referrals((conn)->vfs_handles, (r))
78 #define SMB_VFS_NEXT_GET_DFS_REFERRALS(handle, r) \
79 smb_vfs_call_get_dfs_referrals((handle)->next, (r))
81 /* Directory operations */
82 #define SMB_VFS_OPENDIR(conn, smb_fname, mask, attr) \
83 smb_vfs_call_opendir((conn)->vfs_handles, (smb_fname), (mask), (attr))
84 #define SMB_VFS_NEXT_OPENDIR(handle, smb_fname, mask, attr) \
85 smb_vfs_call_opendir((handle)->next, (smb_fname), (mask), (attr))
87 #define SMB_VFS_FDOPENDIR(fsp, mask, attr) \
88 smb_vfs_call_fdopendir((fsp)->conn->vfs_handles, (fsp), (mask), (attr))
89 #define SMB_VFS_NEXT_FDOPENDIR(handle, fsp, mask, attr) \
90 smb_vfs_call_fdopendir((handle)->next, (fsp), (mask), (attr))
92 #define SMB_VFS_READDIR(conn, dirp, sbuf) \
93 smb_vfs_call_readdir((conn)->vfs_handles, (dirp), (sbuf))
94 #define SMB_VFS_NEXT_READDIR(handle, dirp, sbuf) \
95 smb_vfs_call_readdir((handle)->next, (dirp), (sbuf))
97 #define SMB_VFS_SEEKDIR(conn, dirp, offset) \
98 smb_vfs_call_seekdir((conn)->vfs_handles, (dirp), (offset))
99 #define SMB_VFS_NEXT_SEEKDIR(handle, dirp, offset) \
100 smb_vfs_call_seekdir((handle)->next, (dirp), (offset))
102 #define SMB_VFS_TELLDIR(conn, dirp) \
103 smb_vfs_call_telldir((conn)->vfs_handles, (dirp))
104 #define SMB_VFS_NEXT_TELLDIR(handle, dirp) \
105 smb_vfs_call_telldir((handle)->next, (dirp))
107 #define SMB_VFS_REWINDDIR(conn, dirp) \
108 smb_vfs_call_rewind_dir((conn)->vfs_handles, (dirp))
109 #define SMB_VFS_NEXT_REWINDDIR(handle, dirp) \
110 smb_vfs_call_rewind_dir((handle)->next, (dirp))
112 #define SMB_VFS_MKDIRAT(conn, dirfsp, smb_fname, mode) \
113 smb_vfs_call_mkdirat((conn)->vfs_handles,(dirfsp), (smb_fname), (mode))
114 #define SMB_VFS_NEXT_MKDIRAT(handle, dirfsp, smb_fname, mode) \
115 smb_vfs_call_mkdirat((handle)->next,(dirfsp), (smb_fname), (mode))
117 #define SMB_VFS_CLOSEDIR(conn, dir) \
118 smb_vfs_call_closedir((conn)->vfs_handles, dir)
119 #define SMB_VFS_NEXT_CLOSEDIR(handle, dir) \
120 smb_vfs_call_closedir((handle)->next, (dir))
122 /* File operations */
123 #define SMB_VFS_OPEN(conn, fname, fsp, flags, mode) \
124 smb_vfs_call_open((conn)->vfs_handles, (fname), (fsp), (flags), (mode))
125 #define SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode) \
126 smb_vfs_call_open((handle)->next, (fname), (fsp), (flags), (mode))
128 #define SMB_VFS_CREATE_FILE(conn, req, root_dir_fid, smb_fname, access_mask, share_access, create_disposition, \
129 create_options, file_attributes, oplock_request, lease, allocation_size, private_flags, sd, ea_list, result, pinfo, in_context_blobs, out_context_blobs) \
130 smb_vfs_call_create_file((conn)->vfs_handles, (req), (root_dir_fid), (smb_fname), (access_mask), (share_access), (create_disposition), \
131 (create_options), (file_attributes), (oplock_request), (lease), (allocation_size), (private_flags), (sd), (ea_list), (result), (pinfo), \
132 (in_context_blobs), (out_context_blobs))
133 #define SMB_VFS_NEXT_CREATE_FILE(handle, req, root_dir_fid, smb_fname, access_mask, share_access, create_disposition, \
134 create_options, file_attributes, oplock_request, lease, allocation_size, private_flags, sd, ea_list, result, pinfo, in_context_blobs, out_context_blobs) \
135 smb_vfs_call_create_file((handle)->next, (req), (root_dir_fid), (smb_fname), (access_mask), (share_access), (create_disposition), \
136 (create_options), (file_attributes), (oplock_request), (lease), (allocation_size), (private_flags), (sd), (ea_list), (result), (pinfo), \
137 (in_context_blobs), (out_context_blobs))
139 #define SMB_VFS_CLOSE(fsp) \
140 smb_vfs_call_close((fsp)->conn->vfs_handles, (fsp))
141 #define SMB_VFS_NEXT_CLOSE(handle, fsp) \
142 smb_vfs_call_close((handle)->next, (fsp))
144 #define SMB_VFS_PREAD(fsp, data, n, off) \
145 smb_vfs_call_pread((fsp)->conn->vfs_handles, (fsp), (data), (n), (off))
146 #define SMB_VFS_NEXT_PREAD(handle, fsp, data, n, off) \
147 smb_vfs_call_pread((handle)->next, (fsp), (data), (n), (off))
149 #define SMB_VFS_PREAD_SEND(mem_ctx, ev, fsp, data, n, off) \
150 smb_vfs_call_pread_send((fsp)->conn->vfs_handles, (mem_ctx), (ev), \
151 (fsp), (data), (n), (off))
152 #define SMB_VFS_NEXT_PREAD_SEND(mem_ctx, ev, handle, fsp, data, n, off) \
153 smb_vfs_call_pread_send((handle)->next, (mem_ctx), (ev), (fsp), \
156 #define SMB_VFS_PWRITE(fsp, data, n, off) \
157 smb_vfs_call_pwrite((fsp)->conn->vfs_handles, (fsp), (data), (n), (off))
158 #define SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, off) \
159 smb_vfs_call_pwrite((handle)->next, (fsp), (data), (n), (off))
161 #define SMB_VFS_PWRITE_SEND(mem_ctx, ev, fsp, data, n, off) \
162 smb_vfs_call_pwrite_send((fsp)->conn->vfs_handles, (mem_ctx), (ev), \
163 (fsp), (data), (n), (off))
164 #define SMB_VFS_NEXT_PWRITE_SEND(mem_ctx, ev, handle, fsp, data, n, off) \
165 smb_vfs_call_pwrite_send((handle)->next, (mem_ctx), (ev), (fsp), \
168 #define SMB_VFS_LSEEK(fsp, offset, whence) \
169 smb_vfs_call_lseek((fsp)->conn->vfs_handles, (fsp), (offset), (whence))
170 #define SMB_VFS_NEXT_LSEEK(handle, fsp, offset, whence) \
171 smb_vfs_call_lseek((handle)->next, (fsp), (offset), (whence))
173 #define SMB_VFS_SENDFILE(tofd, fromfsp, header, offset, count) \
174 smb_vfs_call_sendfile((fromfsp)->conn->vfs_handles, (tofd), (fromfsp), (header), (offset), (count))
175 #define SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp, header, offset, count) \
176 smb_vfs_call_sendfile((handle)->next, (tofd), (fromfsp), (header), (offset), (count))
178 #define SMB_VFS_RECVFILE(fromfd, tofsp, offset, count) \
179 smb_vfs_call_recvfile((tofsp)->conn->vfs_handles, (fromfd), (tofsp), (offset), (count))
180 #define SMB_VFS_NEXT_RECVFILE(handle, fromfd, tofsp, offset, count) \
181 smb_vfs_call_recvfile((handle)->next, (fromfd), (tofsp), (offset), (count))
183 #define SMB_VFS_RENAMEAT(conn, oldfsp, old, newfsp, new) \
184 smb_vfs_call_renameat((conn)->vfs_handles, (oldfsp), (old), (newfsp), (new))
185 #define SMB_VFS_NEXT_RENAMEAT(handle, oldfsp, old, newfsp, new) \
186 smb_vfs_call_renameat((handle)->next, (oldfsp), (old), (newfsp), (new))
188 #define SMB_VFS_FSYNC(fsp) \
189 smb_vfs_call_fsync((fsp)->conn->vfs_handles, (fsp))
190 #define SMB_VFS_NEXT_FSYNC(handle, fsp) \
191 smb_vfs_call_fsync((handle)->next, (fsp))
193 #define SMB_VFS_FSYNC_SEND(mem_ctx, ev, fsp) \
194 smb_vfs_call_fsync_send((fsp)->conn->vfs_handles, (mem_ctx), (ev), \
196 #define SMB_VFS_NEXT_FSYNC_SEND(mem_ctx, ev, handle, fsp) \
197 smb_vfs_call_fsync_send((handle)->next, (mem_ctx), (ev), (fsp))
199 #define SMB_VFS_STAT(conn, smb_fname) \
200 smb_vfs_call_stat((conn)->vfs_handles, (smb_fname))
201 #define SMB_VFS_NEXT_STAT(handle, smb_fname) \
202 smb_vfs_call_stat((handle)->next, (smb_fname))
204 #define SMB_VFS_FSTAT(fsp, sbuf) \
205 smb_vfs_call_fstat((fsp)->conn->vfs_handles, (fsp), (sbuf))
206 #define SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf) \
207 smb_vfs_call_fstat((handle)->next, (fsp), (sbuf))
209 #define SMB_VFS_LSTAT(conn, smb_fname) \
210 smb_vfs_call_lstat((conn)->vfs_handles, (smb_fname))
211 #define SMB_VFS_NEXT_LSTAT(handle, smb_fname) \
212 smb_vfs_call_lstat((handle)->next, (smb_fname))
214 #define SMB_VFS_GET_ALLOC_SIZE(conn, fsp, sbuf) \
215 smb_vfs_call_get_alloc_size((conn)->vfs_handles, (fsp), (sbuf))
216 #define SMB_VFS_NEXT_GET_ALLOC_SIZE(conn, fsp, sbuf) \
217 smb_vfs_call_get_alloc_size((conn)->next, (fsp), (sbuf))
219 #define SMB_VFS_UNLINKAT(conn, dirfsp, path, flags) \
220 smb_vfs_call_unlinkat((conn)->vfs_handles, (dirfsp), (path), (flags))
221 #define SMB_VFS_NEXT_UNLINKAT(handle, dirfsp, path, flags) \
222 smb_vfs_call_unlinkat((handle)->next, (dirfsp), (path), (flags))
224 #define SMB_VFS_CHMOD(conn, smb_fname, mode) \
225 smb_vfs_call_chmod((conn)->vfs_handles, (smb_fname), (mode))
226 #define SMB_VFS_NEXT_CHMOD(handle, smb_fname, mode) \
227 smb_vfs_call_chmod((handle)->next, (smb_fname), (mode))
229 #define SMB_VFS_FCHMOD(fsp, mode) \
230 smb_vfs_call_fchmod((fsp)->conn->vfs_handles, (fsp), (mode))
231 #define SMB_VFS_NEXT_FCHMOD(handle, fsp, mode) \
232 smb_vfs_call_fchmod((handle)->next, (fsp), (mode))
234 #define SMB_VFS_FCHOWN(fsp, uid, gid) \
235 smb_vfs_call_fchown((fsp)->conn->vfs_handles, (fsp), (uid), (gid))
236 #define SMB_VFS_NEXT_FCHOWN(handle, fsp, uid, gid) \
237 smb_vfs_call_fchown((handle)->next, (fsp), (uid), (gid))
239 #define SMB_VFS_LCHOWN(conn, smb_fname, uid, gid) \
240 smb_vfs_call_lchown((conn)->vfs_handles, (smb_fname), (uid), (gid))
241 #define SMB_VFS_NEXT_LCHOWN(handle, smb_fname, uid, gid) \
242 smb_vfs_call_lchown((handle)->next, (smb_fname), (uid), (gid))
244 #define SMB_VFS_CHDIR(conn, smb_fname) \
245 smb_vfs_call_chdir((conn)->vfs_handles, (smb_fname))
246 #define SMB_VFS_NEXT_CHDIR(handle, smb_fname) \
247 smb_vfs_call_chdir((handle)->next, (smb_fname))
249 #define SMB_VFS_GETWD(conn, ctx) \
250 smb_vfs_call_getwd((conn)->vfs_handles, (ctx))
251 #define SMB_VFS_NEXT_GETWD(handle, ctx) \
252 smb_vfs_call_getwd((handle)->next, (ctx))
254 #define SMB_VFS_NTIMES(conn, path, ts) \
255 smb_vfs_call_ntimes((conn)->vfs_handles, (path), (ts))
256 #define SMB_VFS_NEXT_NTIMES(handle, path, ts) \
257 smb_vfs_call_ntimes((handle)->next, (path), (ts))
259 #define SMB_VFS_FTRUNCATE(fsp, offset) \
260 smb_vfs_call_ftruncate((fsp)->conn->vfs_handles, (fsp), (offset))
261 #define SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset) \
262 smb_vfs_call_ftruncate((handle)->next, (fsp), (offset))
264 #define SMB_VFS_FALLOCATE(fsp, mode, offset, len) \
265 smb_vfs_call_fallocate((fsp)->conn->vfs_handles, (fsp), (mode), (offset), (len))
266 #define SMB_VFS_NEXT_FALLOCATE(handle, fsp, mode, offset, len) \
267 smb_vfs_call_fallocate((handle)->next, (fsp), (mode), (offset), (len))
269 #define SMB_VFS_LOCK(fsp, op, offset, count, type) \
270 smb_vfs_call_lock((fsp)->conn->vfs_handles, (fsp), (op), (offset), (count), (type))
271 #define SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type) \
272 smb_vfs_call_lock((handle)->next, (fsp), (op), (offset), (count), (type))
274 #define SMB_VFS_KERNEL_FLOCK(fsp, share_mode, access_mask) \
275 smb_vfs_call_kernel_flock((fsp)->conn->vfs_handles, (fsp), (share_mode), (access_mask))
276 #define SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode, access_mask) \
277 smb_vfs_call_kernel_flock((handle)->next, (fsp), (share_mode), (access_mask))
279 #define SMB_VFS_FCNTL(fsp, cmd, ...) \
280 smb_vfs_call_fcntl((fsp)->conn->vfs_handles, (fsp), (cmd), (__VA_ARGS__))
281 #define SMB_VFS_NEXT_FCNTL(handle, fsp, cmd, ...) \
282 smb_vfs_call_fcntl((handle)->next, (fsp), (cmd), (__VA_ARGS__))
284 #define SMB_VFS_LINUX_SETLEASE(fsp, leasetype) \
285 smb_vfs_call_linux_setlease((fsp)->conn->vfs_handles, (fsp), (leasetype))
286 #define SMB_VFS_NEXT_LINUX_SETLEASE(handle, fsp, leasetype) \
287 smb_vfs_call_linux_setlease((handle)->next, (fsp), (leasetype))
289 #define SMB_VFS_GETLOCK(fsp, poffset, pcount, ptype, ppid) \
290 smb_vfs_call_getlock((fsp)->conn->vfs_handles, (fsp), (poffset), (pcount), (ptype), (ppid))
291 #define SMB_VFS_NEXT_GETLOCK(handle, fsp, poffset, pcount, ptype, ppid) \
292 smb_vfs_call_getlock((handle)->next, (fsp), (poffset), (pcount), (ptype), (ppid))
294 #define SMB_VFS_SYMLINKAT(conn, oldpath, dirfsp, newpath) \
295 smb_vfs_call_symlinkat((conn)->vfs_handles, (oldpath), (dirfsp), (newpath))
296 #define SMB_VFS_NEXT_SYMLINKAT(handle, oldpath, dirfsp, newpath) \
297 smb_vfs_call_symlinkat((handle)->next, (oldpath), (dirfsp), (newpath))
299 #define SMB_VFS_READLINKAT(conn, dirfsp, smb_fname, buf, bufsiz) \
300 smb_vfs_call_readlinkat((conn)->vfs_handles, (dirfsp), (smb_fname), (buf), (bufsiz))
301 #define SMB_VFS_NEXT_READLINKAT(handle, dirfsp, smb_fname, buf, bufsiz) \
302 smb_vfs_call_readlinkat((handle)->next, (dirfsp), (smb_fname), (buf), (bufsiz))
304 #define SMB_VFS_LINKAT(conn, srcfsp, oldpath, dstfsp, newpath, flags) \
305 smb_vfs_call_linkat((conn)->vfs_handles, (srcfsp), (oldpath), (dstfsp), (newpath), (flags))
306 #define SMB_VFS_NEXT_LINKAT(handle, srcfsp, oldpath, dstfsp, newpath, flags) \
307 smb_vfs_call_linkat((handle)->next, (srcfsp), (oldpath), (dstfsp), (newpath), (flags))
309 #define SMB_VFS_MKNODAT(conn, dirfsp, smb_fname, mode, dev) \
310 smb_vfs_call_mknodat((conn)->vfs_handles, (dirfsp), (smb_fname), (mode), (dev))
311 #define SMB_VFS_NEXT_MKNODAT(handle, dirfsp, smb_fname, mode, dev) \
312 smb_vfs_call_mknodat((handle)->next, (dirfsp), (smb_fname), (mode), (dev))
314 #define SMB_VFS_REALPATH(conn, ctx, smb_fname) \
315 smb_vfs_call_realpath((conn)->vfs_handles, (ctx), (smb_fname))
316 #define SMB_VFS_NEXT_REALPATH(handle, ctx, smb_fname) \
317 smb_vfs_call_realpath((handle)->next, (ctx), (smb_fname))
319 #define SMB_VFS_CHFLAGS(conn, smb_fname, flags) \
320 smb_vfs_call_chflags((conn)->vfs_handles, (smb_fname), (flags))
321 #define SMB_VFS_NEXT_CHFLAGS(handle, smb_fname, flags) \
322 smb_vfs_call_chflags((handle)->next, (smb_fname), (flags))
324 #define SMB_VFS_FILE_ID_CREATE(conn, sbuf) \
325 smb_vfs_call_file_id_create((conn)->vfs_handles, (sbuf))
326 #define SMB_VFS_NEXT_FILE_ID_CREATE(handle, sbuf) \
327 smb_vfs_call_file_id_create((handle)->next, (sbuf))
329 #define SMB_VFS_FS_FILE_ID(conn, sbuf) \
330 smb_vfs_call_fs_file_id((conn)->vfs_handles, (sbuf))
331 #define SMB_VFS_NEXT_FS_FILE_ID(handle, sbuf) \
332 smb_vfs_call_fs_file_id((handle)->next, (sbuf))
334 #define SMB_VFS_STREAMINFO(conn, fsp, smb_fname, mem_ctx, num_streams, streams) \
335 smb_vfs_call_streaminfo((conn)->vfs_handles, (fsp), (smb_fname), (mem_ctx), (num_streams), (streams))
336 #define SMB_VFS_NEXT_STREAMINFO(handle, fsp, smb_fname, mem_ctx, num_streams, streams) \
337 smb_vfs_call_streaminfo((handle)->next, (fsp), (smb_fname), (mem_ctx), (num_streams), (streams))
339 #define SMB_VFS_GET_REAL_FILENAME(conn, path, name, mem_ctx, found_name) \
340 smb_vfs_call_get_real_filename((conn)->vfs_handles, (path), (name), (mem_ctx), (found_name))
341 #define SMB_VFS_NEXT_GET_REAL_FILENAME(handle, path, name, mem_ctx, found_name) \
342 smb_vfs_call_get_real_filename((handle)->next, (path), (name), (mem_ctx), (found_name))
344 #define SMB_VFS_CONNECTPATH(conn, smb_fname) \
345 smb_vfs_call_connectpath((conn)->vfs_handles, (smb_fname))
346 #define SMB_VFS_NEXT_CONNECTPATH(conn, smb_fname) \
347 smb_vfs_call_connectpath((conn)->next, (smb_fname))
349 #define SMB_VFS_BRL_LOCK_WINDOWS(conn, br_lck, plock) \
350 smb_vfs_call_brl_lock_windows((conn)->vfs_handles, (br_lck), (plock))
351 #define SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle, br_lck, plock) \
352 smb_vfs_call_brl_lock_windows((handle)->next, (br_lck), (plock))
354 #define SMB_VFS_BRL_UNLOCK_WINDOWS(conn, br_lck, plock) \
355 smb_vfs_call_brl_unlock_windows((conn)->vfs_handles, (br_lck), (plock))
356 #define SMB_VFS_NEXT_BRL_UNLOCK_WINDOWS(handle, br_lck, plock) \
357 smb_vfs_call_brl_unlock_windows((handle)->next, (br_lck), (plock))
359 #define SMB_VFS_STRICT_LOCK_CHECK(conn, fsp, plock) \
360 smb_vfs_call_strict_lock_check((conn)->vfs_handles, (fsp), (plock))
361 #define SMB_VFS_NEXT_STRICT_LOCK_CHECK(handle, fsp, plock) \
362 smb_vfs_call_strict_lock_check((handle)->next, (fsp), (plock))
364 #define SMB_VFS_TRANSLATE_NAME(conn, name, direction, mem_ctx, mapped_name) \
365 smb_vfs_call_translate_name((conn)->vfs_handles, (name), (direction), (mem_ctx), (mapped_name))
366 #define SMB_VFS_NEXT_TRANSLATE_NAME(handle, name, direction, mem_ctx, mapped_name) \
367 smb_vfs_call_translate_name((handle)->next, (name), (direction), (mem_ctx), (mapped_name))
369 #define SMB_VFS_FSCTL(fsp, ctx, function, req_flags, in_data, in_len, out_data, max_out_len, out_len) \
370 smb_vfs_call_fsctl((fsp)->conn->vfs_handles, (fsp), (ctx), (function), (req_flags), (in_data), (in_len), (out_data), (max_out_len), (out_len))
372 #define SMB_VFS_NEXT_FSCTL(handle, fsp, ctx, function, req_flags, in_data, in_len, out_data, max_out_len, out_len) \
373 smb_vfs_call_fsctl((handle)->next, (fsp), (ctx), (function), (req_flags), (in_data), (in_len), (out_data), (max_out_len), (out_len))
375 #define SMB_VFS_GET_DOS_ATTRIBUTES(conn, smb_fname, attributes) \
376 smb_vfs_call_get_dos_attributes((conn)->vfs_handles, (smb_fname), (attributes))
377 #define SMB_VFS_NEXT_GET_DOS_ATTRIBUTES(handle, smb_fname, attributes) \
378 smb_vfs_call_get_dos_attributes((handle)->next, (smb_fname), (attributes))
379 #define SMB_VFS_FGET_DOS_ATTRIBUTES(conn, fsp, attributes) \
380 smb_vfs_call_fget_dos_attributes((conn)->vfs_handles, (fsp), (attributes))
381 #define SMB_VFS_NEXT_FGET_DOS_ATTRIBUTES(handle, fsp, attributes) \
382 smb_vfs_call_fget_dos_attributes((handle)->next, (fsp), (attributes))
384 #define SMB_VFS_GET_DOS_ATTRIBUTES_SEND(mem_ctx, evg, dir_fsp, smb_fname) \
385 smb_vfs_call_get_dos_attributes_send((mem_ctx), (evg), \
386 (dir_fsp)->conn->vfs_handles, \
387 (dir_fsp), (smb_fname))
388 #define SMB_VFS_GET_DOS_ATTRIBUTES_RECV(req, aio_state, dosmode) \
389 smb_vfs_call_get_dos_attributes_recv((req), (aio_state), (dosmode))
391 #define SMB_VFS_NEXT_GET_DOS_ATTRIBUTES_SEND(mem_ctx, evg, handle, dir_fsp, \
393 smb_vfs_call_get_dos_attributes_send((mem_ctx), (evg), \
395 (dir_fsp), (smb_fname))
396 #define SMB_VFS_NEXT_GET_DOS_ATTRIBUTES_RECV(req, aio_state, dosmode) \
397 smb_vfs_call_get_dos_attributes_recv((req), (aio_state), (dosmode))
399 #define SMB_VFS_SET_DOS_ATTRIBUTES(conn, smb_fname, attributes) \
400 smb_vfs_call_set_dos_attributes((conn)->vfs_handles, (smb_fname), (attributes))
401 #define SMB_VFS_NEXT_SET_DOS_ATTRIBUTES(handle, smb_fname, attributes) \
402 smb_vfs_call_set_dos_attributes((handle)->next, (smb_fname), (attributes))
403 #define SMB_VFS_FSET_DOS_ATTRIBUTES(conn, fsp, attributes) \
404 smb_vfs_call_fset_dos_attributes((conn)->vfs_handles, (fsp), (attributes))
405 #define SMB_VFS_NEXT_FSET_DOS_ATTRIBUTES(handle, fsp, attributes) \
406 smb_vfs_call_fset_dos_attributes((handle)->next, (fsp), (attributes))
408 #define SMB_VFS_OFFLOAD_READ_SEND(mem_ctx, ev, fsp, fsctl, ttl, offset, to_copy) \
409 smb_vfs_call_offload_read_send((mem_ctx), (ev), (fsp)->conn->vfs_handles, fsp, (fsctl), (ttl), (offset), (to_copy))
410 #define SMB_VFS_NEXT_OFFLOAD_READ_SEND(mem_ctx, ev, handle, fsp, fsctl, ttl, offset, to_copy) \
411 smb_vfs_call_offload_read_send((mem_ctx), (ev), (handle)->next, (fsp), (fsctl), (ttl), (offset), (to_copy))
413 #define SMB_VFS_OFFLOAD_READ_RECV(req, conn, mem_ctx, token_blob) \
414 smb_vfs_call_offload_read_recv((req), (conn)->vfs_handles, (mem_ctx), (token_blob))
415 #define SMB_VFS_NEXT_OFFLOAD_READ_RECV(req, handle, mem_ctx, token_blob) \
416 smb_vfs_call_offload_read_recv((req), (handle)->next, (mem_ctx), (token_blob))
418 #define SMB_VFS_OFFLOAD_WRITE_SEND(conn, mem_ctx, ev, fsctl, token, transfer_offset, dest_fsp, dest_off, num) \
419 smb_vfs_call_offload_write_send((conn)->vfs_handles, (mem_ctx), (ev), (fsctl), (token), (transfer_offset), (dest_fsp), (dest_off), (num))
420 #define SMB_VFS_NEXT_OFFLOAD_WRITE_SEND(handle, mem_ctx, ev, fsctl, token, transfer_offset, dest_fsp, dest_off, num) \
421 smb_vfs_call_offload_write_send((handle)->next, (mem_ctx), (ev), (fsctl), (token), (transfer_offset), (dest_fsp), (dest_off), (num))
423 #define SMB_VFS_OFFLOAD_WRITE_RECV(conn, req, copied) \
424 smb_vfs_call_offload_write_recv((conn)->vfs_handles, (req), (copied))
425 #define SMB_VFS_NEXT_OFFLOAD_WRITE_RECV(handle, req, copied) \
426 smb_vfs_call_offload_write_recv((handle)->next, (req), (copied))
428 #define SMB_VFS_GET_COMPRESSION(conn, mem_ctx, fsp, smb_fname, _compression_fmt) \
429 smb_vfs_call_get_compression((conn)->vfs_handles, (mem_ctx), (fsp), (smb_fname), (_compression_fmt))
430 #define SMB_VFS_NEXT_GET_COMPRESSION(handle, mem_ctx, fsp, smb_fname, _compression_fmt) \
431 smb_vfs_call_get_compression((handle)->next, (mem_ctx), (fsp), (smb_fname), (_compression_fmt))
433 #define SMB_VFS_SET_COMPRESSION(conn, mem_ctx, fsp, compression_fmt) \
434 smb_vfs_call_set_compression((conn)->vfs_handles, (mem_ctx), (fsp), (compression_fmt))
435 #define SMB_VFS_NEXT_SET_COMPRESSION(handle, mem_ctx, fsp, compression_fmt) \
436 smb_vfs_call_set_compression((handle)->next, (mem_ctx), (fsp), (compression_fmt))
438 #define SMB_VFS_SNAP_CHECK_PATH(conn, mem_ctx, service_path, base_volume) \
439 smb_vfs_call_snap_check_path((conn)->vfs_handles, (mem_ctx), (service_path), (base_volume))
440 #define SMB_VFS_NEXT_SNAP_CHECK_PATH(handle, mem_ctx, service_path, base_volume) \
441 smb_vfs_call_snap_check_path((handle)->next, (mem_ctx), (service_path), (base_volume))
443 #define SMB_VFS_SNAP_CREATE(conn, mem_ctx, base_volume, tstamp, rw, base_path, snap_path) \
444 smb_vfs_call_snap_create((conn)->vfs_handles, (mem_ctx), (base_volume), (tstamp), (rw), (base_path), (snap_path))
445 #define SMB_VFS_NEXT_SNAP_CREATE(handle, mem_ctx, base_volume, tstamp, rw, base_path, snap_path) \
446 smb_vfs_call_snap_create((handle)->next, (mem_ctx), (base_volume), (tstamp), (rw), (base_path), (snap_path))
448 #define SMB_VFS_SNAP_DELETE(conn, mem_ctx, base_path, snap_path) \
449 smb_vfs_call_snap_delete((conn)->vfs_handles, (mem_ctx), (base_path), (snap_path))
450 #define SMB_VFS_NEXT_SNAP_DELETE(handle, mem_ctx, base_path, snap_path) \
451 smb_vfs_call_snap_delete((handle)->next, (mem_ctx), (base_path), (snap_path))
453 #define SMB_VFS_FGET_NT_ACL(fsp, security_info, mem_ctx, ppdesc) \
454 smb_vfs_call_fget_nt_acl((fsp)->conn->vfs_handles, (fsp), (security_info), (mem_ctx), (ppdesc))
455 #define SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, mem_ctx, ppdesc) \
456 smb_vfs_call_fget_nt_acl((handle)->next, (fsp), (security_info), (mem_ctx), (ppdesc))
458 #define SMB_VFS_GET_NT_ACL(conn, smb_fname, security_info, mem_ctx, ppdesc) \
459 smb_vfs_call_get_nt_acl((conn)->vfs_handles, (smb_fname), (security_info), (mem_ctx), (ppdesc))
460 #define SMB_VFS_NEXT_GET_NT_ACL(handle, smb_fname, security_info, mem_ctx, ppdesc) \
461 smb_vfs_call_get_nt_acl((handle)->next, (smb_fname), (security_info), (mem_ctx), (ppdesc))
463 #define SMB_VFS_AUDIT_FILE(conn, name, sacl, access_requested, access_denied) \
464 smb_vfs_call_audit_file((conn)->vfs_handles, (name), (sacl), (access_requested), (access_denied))
465 #define SMB_VFS_NEXT_AUDIT_FILE(handle, name, sacl, access_requested, access_denied) \
466 smb_vfs_call_audit_file((handle)->next, (name), (sacl), (access_requested), (access_denied))
468 #define SMB_VFS_FSET_NT_ACL(fsp, security_info_sent, psd) \
469 smb_vfs_call_fset_nt_acl((fsp)->conn->vfs_handles, (fsp), (security_info_sent), (psd))
470 #define SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd) \
471 smb_vfs_call_fset_nt_acl((handle)->next, (fsp), (security_info_sent), (psd))
473 #define SMB_VFS_SYS_ACL_GET_FILE(conn, smb_fname, type, mem_ctx) \
474 smb_vfs_call_sys_acl_get_file((conn)->vfs_handles, (smb_fname), (type), (mem_ctx))
475 #define SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, smb_fname, type, mem_ctx) \
476 smb_vfs_call_sys_acl_get_file((handle)->next, (smb_fname), (type), (mem_ctx))
478 #define SMB_VFS_SYS_ACL_GET_FD(fsp, mem_ctx) \
479 smb_vfs_call_sys_acl_get_fd((fsp)->conn->vfs_handles, (fsp), (mem_ctx))
480 #define SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp, mem_ctx) \
481 smb_vfs_call_sys_acl_get_fd((handle)->next, (fsp), (mem_ctx))
483 #define SMB_VFS_SYS_ACL_BLOB_GET_FILE(conn, smb_fname, mem_ctx, blob_description, blob) \
484 smb_vfs_call_sys_acl_blob_get_file((conn)->vfs_handles, (smb_fname), (mem_ctx), (blob_description), (blob))
485 #define SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle, smb_fname, mem_ctx, blob_description, blob) \
486 smb_vfs_call_sys_acl_blob_get_file((handle)->next, (smb_fname), (mem_ctx), (blob_description), (blob))
488 #define SMB_VFS_SYS_ACL_BLOB_GET_FD(fsp, mem_ctx, blob_description, blob) \
489 smb_vfs_call_sys_acl_blob_get_fd((fsp)->conn->vfs_handles, (fsp), (mem_ctx), (blob_description), (blob))
490 #define SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FD(handle, fsp, mem_ctx, blob_description, blob) \
491 smb_vfs_call_sys_acl_blob_get_fd((handle)->next, (fsp), mem_ctx, (blob_description), (blob))
493 #define SMB_VFS_SYS_ACL_SET_FILE(conn, smb_fname, acltype, theacl) \
494 smb_vfs_call_sys_acl_set_file((conn)->vfs_handles, (smb_fname), (acltype), (theacl))
495 #define SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, smb_fname, acltype, theacl) \
496 smb_vfs_call_sys_acl_set_file((handle)->next, (smb_fname), (acltype), (theacl))
498 #define SMB_VFS_SYS_ACL_SET_FD(fsp, theacl) \
499 smb_vfs_call_sys_acl_set_fd((fsp)->conn->vfs_handles, (fsp), (theacl))
500 #define SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl) \
501 smb_vfs_call_sys_acl_set_fd((handle)->next, (fsp), (theacl))
503 #define SMB_VFS_SYS_ACL_DELETE_DEF_FILE(conn, smb_fname) \
504 smb_vfs_call_sys_acl_delete_def_file((conn)->vfs_handles, (smb_fname))
505 #define SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, smb_fname) \
506 smb_vfs_call_sys_acl_delete_def_file((handle)->next, (smb_fname))
508 #define SMB_VFS_GETXATTR(conn,smb_fname,name,value,size) \
509 smb_vfs_call_getxattr((conn)->vfs_handles,(smb_fname),(name),(value),(size))
510 #define SMB_VFS_NEXT_GETXATTR(handle,smb_fname,name,value,size) \
511 smb_vfs_call_getxattr((handle)->next,(smb_fname),(name),(value),(size))
513 #define SMB_VFS_GETXATTRAT_SEND(mem_ctx,ev,dir_fsp,smb_fname, \
514 xattr_name, alloc_hint) \
515 smb_vfs_call_getxattrat_send((mem_ctx),(ev), \
516 (dir_fsp)->conn->vfs_handles, \
517 (dir_fsp),(smb_fname),(xattr_name), \
519 #define SMB_VFS_GETXATTRAT_RECV(req, aio_state, mem_ctx, xattr_value) \
520 smb_vfs_call_getxattrat_recv((req),(aio_state),(mem_ctx),(xattr_value))
522 #define SMB_VFS_NEXT_GETXATTRAT_SEND(mem_ctx,ev,handle,dir_fsp,smb_fname, \
523 xattr_name,alloc_hint) \
524 smb_vfs_call_getxattrat_send((mem_ctx),(ev), \
526 (dir_fsp), (smb_fname),(xattr_name), \
528 #define SMB_VFS_NEXT_GETXATTRAT_RECV(req, aio_state, mem_ctx, xattr_value) \
529 smb_vfs_call_getxattrat_recv((req),(aio_state),(mem_ctx),(xattr_value))
531 #define SMB_VFS_FGETXATTR(fsp,name,value,size) \
532 smb_vfs_call_fgetxattr((fsp)->conn->vfs_handles, (fsp), (name),(value),(size))
533 #define SMB_VFS_NEXT_FGETXATTR(handle,fsp,name,value,size) \
534 smb_vfs_call_fgetxattr((handle)->next,(fsp),(name),(value),(size))
536 #define SMB_VFS_LISTXATTR(conn,smb_fname,list,size) \
537 smb_vfs_call_listxattr((conn)->vfs_handles,(smb_fname),(list),(size))
538 #define SMB_VFS_NEXT_LISTXATTR(handle,smb_fname,list,size) \
539 smb_vfs_call_listxattr((handle)->next,(smb_fname),(list),(size))
541 #define SMB_VFS_FLISTXATTR(fsp,list,size) \
542 smb_vfs_call_flistxattr((fsp)->conn->vfs_handles, (fsp), (list),(size))
543 #define SMB_VFS_NEXT_FLISTXATTR(handle,fsp,list,size) \
544 smb_vfs_call_flistxattr((handle)->next,(fsp),(list),(size))
546 #define SMB_VFS_REMOVEXATTR(conn,smb_fname,name) \
547 smb_vfs_call_removexattr((conn)->vfs_handles,(smb_fname),(name))
548 #define SMB_VFS_NEXT_REMOVEXATTR(handle,smb_fname,name) \
549 smb_vfs_call_removexattr((handle)->next,(smb_fname),(name))
551 #define SMB_VFS_FREMOVEXATTR(fsp,name) \
552 smb_vfs_call_fremovexattr((fsp)->conn->vfs_handles, (fsp), (name))
553 #define SMB_VFS_NEXT_FREMOVEXATTR(handle,fsp,name) \
554 smb_vfs_call_fremovexattr((handle)->next,(fsp),(name))
556 #define SMB_VFS_SETXATTR(conn,smb_fname,name,value,size,flags) \
557 smb_vfs_call_setxattr((conn)->vfs_handles,(smb_fname),(name),(value),(size),(flags))
558 #define SMB_VFS_NEXT_SETXATTR(handle,smb_fname,name,value,size,flags) \
559 smb_vfs_call_setxattr((handle)->next,(smb_fname),(name),(value),(size),(flags))
561 #define SMB_VFS_FSETXATTR(fsp,name,value,size,flags) \
562 smb_vfs_call_fsetxattr((fsp)->conn->vfs_handles, (fsp), (name),(value),(size),(flags))
563 #define SMB_VFS_NEXT_FSETXATTR(handle,fsp,name,value,size,flags) \
564 smb_vfs_call_fsetxattr((handle)->next,(fsp),(name),(value),(size),(flags))
566 #define SMB_VFS_AIO_FORCE(fsp) \
567 smb_vfs_call_aio_force((fsp)->conn->vfs_handles, (fsp))
568 #define SMB_VFS_NEXT_AIO_FORCE(handle,fsp) \
569 smb_vfs_call_aio_force((handle)->next,(fsp))
571 /* durable handle operations */
573 #define SMB_VFS_DURABLE_COOKIE(fsp, mem_ctx, cookie) \
574 smb_vfs_call_durable_cookie((fsp)->conn->vfs_handles, \
575 (fsp), (mem_ctx), (cookie))
576 #define SMB_VFS_NEXT_DURABLE_COOKIE(handle, fsp, mem_ctx, cookie) \
577 smb_vfs_call_durable_cookie((handle)->next, \
578 (fsp), (mem_ctx), (cookie))
580 #define SMB_VFS_DURABLE_DISCONNECT(fsp, old_cookie, mem_ctx, new_cookie) \
581 smb_vfs_call_durable_disconnect((fsp)->conn->vfs_handles, \
582 (fsp), (old_cookie), (mem_ctx), (new_cookie))
583 #define SMB_VFS_NEXT_DURABLE_DISCONNECT(handle, fsp, old_cookie, mem_ctx, new_cookie) \
584 smb_vfs_call_durable_disconnect((handle)->next, \
585 (fsp), (old_cookie), (mem_ctx), (new_cookie))
587 #define SMB_VFS_DURABLE_RECONNECT(conn, smb1req, op, old_cookie, mem_ctx, fsp, new_cookie) \
588 smb_vfs_call_durable_reconnect((conn)->vfs_handles, \
589 (smb1req), (op), (old_cookie), \
590 (mem_ctx), (fsp), (new_cookie))
591 #define SMB_VFS_NEXT_DURABLE_RECONNECT(handle, smb1req, op, old_cookie, mem_ctx, fsp, new_cookie) \
592 smb_vfs_call_durable_reconnect((handle)->next, \
593 (smb1req), (op), (old_cookie), \
594 (mem_ctx), (fsp), (new_cookie))
596 #define SMB_VFS_READDIR_ATTR(conn, fname, mem_ctx, attr_data) \
597 smb_vfs_call_readdir_attr((conn)->vfs_handles, (fname), (mem_ctx), (attr_data))
598 #define SMB_VFS_NEXT_READDIR_ATTR(conn, fname, mem_ctx, attr_data) \
599 smb_vfs_call_readdir_attr((handle)->next, (fname), (mem_ctx), (attr_data))
601 #endif /* _VFS_MACROS_H */