Move copy_unix_token() from locking/locking.c to lib/util.c.
[kai/samba.git] / source3 / include / vfs_macros.h
index 8ca7f373bf71e51ea68aa9d6fb150cb69b111187..3c2256bfeeadcc39008f951c62bfce74bfd3131a 100644 (file)
 #define SMB_VFS_NEXT_FS_CAPABILITIES(handle, p_ts_res) \
        smb_vfs_call_fs_capabilities((handle)->next, (p_ts_res))
 
+/*
+ * Note: that "struct dfs_GetDFSReferral *r"
+ * needs to be a valid TALLOC_CTX
+ */
+#define SMB_VFS_GET_DFS_REFERRALS(conn, r) \
+       smb_vfs_call_get_dfs_referrals((conn)->vfs_handles, (r))
+#define SMB_VFS_NEXT_GET_DFS_REFERRALS(handle, r) \
+       smb_vfs_call_get_dfs_referrals((handle)->next, (r))
+
 /* Directory operations */
 #define SMB_VFS_OPENDIR(conn, fname, mask, attr) \
        smb_vfs_call_opendir((conn)->vfs_handles, (fname), (mask), (attr))
 #define SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr) \
        smb_vfs_call_opendir((handle)->next, (fname), (mask), (attr))
 
+#define SMB_VFS_FDOPENDIR(fsp, mask, attr) \
+       smb_vfs_call_fdopendir((fsp)->conn->vfs_handles, (fsp), (mask), (attr))
+#define SMB_VFS_NEXT_FDOPENDIR(handle, fsp, mask, attr) \
+       smb_vfs_call_fdopendir((handle)->next, (fsp), (mask), (attr))
+
 #define SMB_VFS_READDIR(conn, dirp, sbuf) \
        smb_vfs_call_readdir((conn)->vfs_handles, (dirp), (sbuf))
 #define SMB_VFS_NEXT_READDIR(handle, dirp, sbuf) \
 #define SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode) \
        smb_vfs_call_open((handle)->next, (fname), (fsp), (flags), (mode))
 
-#define SMB_VFS_CREATE_FILE(conn, req, root_dir_fid, smb_fname, access_mask, share_access, create_disposition, create_options, file_attributes, oplock_request, allocation_size, sd, ea_list, result, pinfo) \
-       smb_vfs_call_create_file((conn)->vfs_handles, (req), (root_dir_fid), (smb_fname), (access_mask), (share_access), (create_disposition), (create_options), (file_attributes), (oplock_request), (allocation_size), (sd), (ea_list), (result), (pinfo))
-#define SMB_VFS_NEXT_CREATE_FILE(handle, req, root_dir_fid, smb_fname, access_mask, share_access, create_disposition, create_options, file_attributes, oplock_request, allocation_size, sd, ea_list, result, pinfo) \
-       smb_vfs_call_create_file((handle)->next, (req), (root_dir_fid), (smb_fname), (access_mask), (share_access), (create_disposition), (create_options), (file_attributes), (oplock_request), (allocation_size), (sd), (ea_list), (result), (pinfo))
+#define SMB_VFS_CREATE_FILE(conn, req, root_dir_fid, smb_fname, access_mask, share_access, create_disposition, \
+        create_options, file_attributes, oplock_request, allocation_size, private_flags, sd, ea_list, result, pinfo) \
+       smb_vfs_call_create_file((conn)->vfs_handles, (req), (root_dir_fid), (smb_fname), (access_mask), (share_access), (create_disposition), \
+        (create_options), (file_attributes), (oplock_request), (allocation_size), (private_flags), (sd), (ea_list), (result), (pinfo))
+#define SMB_VFS_NEXT_CREATE_FILE(handle, req, root_dir_fid, smb_fname, access_mask, share_access, create_disposition, \
+        create_options, file_attributes, oplock_request, allocation_size, private_flags, sd, ea_list, result, pinfo) \
+       smb_vfs_call_create_file((handle)->next, (req), (root_dir_fid), (smb_fname), (access_mask), (share_access), (create_disposition), \
+        (create_options), (file_attributes), (oplock_request), (allocation_size), (private_flags), (sd), (ea_list), (result), (pinfo))
 
 #define SMB_VFS_CLOSE(fsp) \
-       smb_vfs_call_close_fn((fsp)->conn->vfs_handles, (fsp))
+       smb_vfs_call_close((fsp)->conn->vfs_handles, (fsp))
 #define SMB_VFS_NEXT_CLOSE(handle, fsp) \
-       smb_vfs_call_close_fn((handle)->next, (fsp))
+       smb_vfs_call_close((handle)->next, (fsp))
 
 #define SMB_VFS_READ(fsp, data, n) \
-       smb_vfs_call_vfs_read((fsp)->conn->vfs_handles, (fsp), (data), (n))
+       smb_vfs_call_read((fsp)->conn->vfs_handles, (fsp), (data), (n))
 #define SMB_VFS_NEXT_READ(handle, fsp, data, n) \
-       smb_vfs_call_vfs_read((handle)->next, (fsp), (data), (n))
+       smb_vfs_call_read((handle)->next, (fsp), (data), (n))
 
 #define SMB_VFS_PREAD(fsp, data, n, off) \
        smb_vfs_call_pread((fsp)->conn->vfs_handles, (fsp), (data), (n), (off))
 #define SMB_VFS_NEXT_CHDIR(handle, path) \
        smb_vfs_call_chdir((handle)->next, (path))
 
-#define SMB_VFS_GETWD(conn, buf) \
-       smb_vfs_call_getwd((conn)->vfs_handles, (buf))
-#define SMB_VFS_NEXT_GETWD(handle, buf) \
-       smb_vfs_call_getwd((handle)->next, (buf))
+#define SMB_VFS_GETWD(conn) \
+       smb_vfs_call_getwd((conn)->vfs_handles)
+#define SMB_VFS_NEXT_GETWD(handle) \
+       smb_vfs_call_getwd((handle)->next)
 
 #define SMB_VFS_NTIMES(conn, path, ts) \
        smb_vfs_call_ntimes((conn)->vfs_handles, (path), (ts))
 #define SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset) \
        smb_vfs_call_ftruncate((handle)->next, (fsp), (offset))
 
+#define SMB_VFS_FALLOCATE(fsp, mode, offset, len) \
+       smb_vfs_call_fallocate((fsp)->conn->vfs_handles, (fsp), (mode), (offset), (len))
+#define SMB_VFS_NEXT_FALLOCATE(handle, fsp, mode, offset, len) \
+       smb_vfs_call_fallocate((handle)->next, (fsp), (mode), (offset), (len))
+
 #define SMB_VFS_LOCK(fsp, op, offset, count, type) \
        smb_vfs_call_lock((fsp)->conn->vfs_handles, (fsp), (op), (offset), (count), (type))
 #define SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type) \
        smb_vfs_call_lock((handle)->next, (fsp), (op), (offset), (count), (type))
 
-#define SMB_VFS_KERNEL_FLOCK(fsp, share_mode) \
-       smb_vfs_call_kernel_flock((fsp)->conn->vfs_handles, (fsp), (share_mode))
-#define SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode) \
-       smb_vfs_call_kernel_flock((handle)->next, (fsp), (share_mode))
+#define SMB_VFS_KERNEL_FLOCK(fsp, share_mode, access_mask) \
+       smb_vfs_call_kernel_flock((fsp)->conn->vfs_handles, (fsp), (share_mode), (access_mask))
+#define SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode, access_mask)        \
+       smb_vfs_call_kernel_flock((handle)->next, (fsp), (share_mode), (access_mask))
 
 #define SMB_VFS_LINUX_SETLEASE(fsp, leasetype) \
        smb_vfs_call_linux_setlease((fsp)->conn->vfs_handles, (fsp), (leasetype))
        smb_vfs_call_symlink((handle)->next, (oldpath), (newpath))
 
 #define SMB_VFS_READLINK(conn, path, buf, bufsiz) \
-       smb_vfs_call_vfs_readlink((conn)->vfs_handles, (path), (buf), (bufsiz))
+       smb_vfs_call_readlink((conn)->vfs_handles, (path), (buf), (bufsiz))
 #define SMB_VFS_NEXT_READLINK(handle, path, buf, bufsiz) \
-       smb_vfs_call_vfs_readlink((handle)->next, (path), (buf), (bufsiz))
+       smb_vfs_call_readlink((handle)->next, (path), (buf), (bufsiz))
 
 #define SMB_VFS_LINK(conn, oldpath, newpath) \
        smb_vfs_call_link((conn)->vfs_handles, (oldpath), (newpath))
 #define SMB_VFS_NEXT_MKNOD(handle, path, mode, dev) \
        smb_vfs_call_mknod((handle)->next, (path), (mode), (dev))
 
-#define SMB_VFS_REALPATH(conn, path, resolved_path) \
-       smb_vfs_call_realpath((conn)->vfs_handles, (path), (resolved_path))
-#define SMB_VFS_NEXT_REALPATH(handle, path, resolved_path) \
-       smb_vfs_call_realpath((handle)->next, (path), (resolved_path))
+#define SMB_VFS_REALPATH(conn, path) \
+       smb_vfs_call_realpath((conn)->vfs_handles, (path))
+#define SMB_VFS_NEXT_REALPATH(handle, path) \
+       smb_vfs_call_realpath((handle)->next, (path))
 
-#define SMB_VFS_NOTIFY_WATCH(conn, ctx, e, callback, private_data, handle_p) \
-       smb_vfs_call_notify_watch((conn)->vfs_handles, (ctx), (e), (callback), (private_data), (handle_p))
-#define SMB_VFS_NEXT_NOTIFY_WATCH(conn, ctx, e, callback, private_data, handle_p) \
-       smb_vfs_call_notify_watch((conn)->next, (ctx), (e), (callback), (private_data), (handle_p))
+#define SMB_VFS_NOTIFY_WATCH(conn, ctx, path, filter, subdir_filter, callback, private_data, handle_p) \
+       smb_vfs_call_notify_watch((conn)->vfs_handles, (ctx), (path), (filter), (subdir_filter), (callback), (private_data), (handle_p))
+#define SMB_VFS_NEXT_NOTIFY_WATCH(conn, ctx, path, filter, subdir_filter, callback, private_data, handle_p) \
+       smb_vfs_call_notify_watch((conn)->next, (ctx), (path), (filter), (subdir_filter), (callback), (private_data), (handle_p))
 
 #define SMB_VFS_CHFLAGS(conn, path, flags) \
        smb_vfs_call_chflags((conn)->vfs_handles, (path), (flags))
 #define SMB_VFS_NEXT_STRICT_UNLOCK(handle, fsp, plock) \
        smb_vfs_call_strict_unlock((handle)->next, (fsp), (plock))
 
-#define SMB_VFS_TRANSLATE_NAME(conn, mapped_name, direction)                   \
-       smb_vfs_call_translate_name((conn)->vfs_handles, (mapped_name), (direction))
-#define SMB_VFS_NEXT_TRANSLATE_NAME(handle, mapped_name, direction)            \
-       smb_vfs_call_translate_name((handle)->next, (mapped_name), (direction))
+#define SMB_VFS_TRANSLATE_NAME(conn, name, direction, mem_ctx, mapped_name) \
+       smb_vfs_call_translate_name((conn)->vfs_handles, (name), (direction), (mem_ctx), (mapped_name))
+#define SMB_VFS_NEXT_TRANSLATE_NAME(handle, name, direction, mem_ctx, mapped_name) \
+       smb_vfs_call_translate_name((handle)->next, (name), (direction), (mem_ctx), (mapped_name))
 
-#define SMB_VFS_NEXT_STRICT_UNLOCK(handle, fsp, plock) \
-       smb_vfs_call_strict_unlock((handle)->next, (fsp), (plock))
+#define SMB_VFS_FSCTL(fsp, ctx, function, req_flags, in_data, in_len, out_data, max_out_len, out_len) \
+       smb_vfs_call_fsctl((fsp)->conn->vfs_handles, (fsp), (ctx), (function), (req_flags), (in_data), (in_len), (out_data), (max_out_len), (out_len))
+
+#define SMB_VFS_NEXT_FSCTL(handle, fsp, ctx, function, req_flags, in_data, in_len, out_data, max_out_len, out_len) \
+       smb_vfs_call_fsctl((handle)->next, (fsp), (ctx), (function), (req_flags), (in_data), (in_len), (out_data), (max_out_len), (out_len))
 
 #define SMB_VFS_FGET_NT_ACL(fsp, security_info, ppdesc) \
        smb_vfs_call_fget_nt_acl((fsp)->conn->vfs_handles, (fsp), (security_info), (ppdesc))
 #define SMB_VFS_NEXT_GET_NT_ACL(handle, name, security_info, ppdesc) \
        smb_vfs_call_get_nt_acl((handle)->next, (name), (security_info), (ppdesc))
 
+#define SMB_VFS_AUDIT_FILE(conn, name, sacl, access_requested, access_denied) \
+       smb_vfs_call_audit_file((conn)->vfs_handles, (name), (sacl), (access_requested), (access_denied))
+#define SMB_VFS_NEXT_AUDIT_FILE(handle, name, sacl, access_requested, access_denied) \
+       smb_vfs_call_audit_file((handle)->next, (name), (sacl), (access_requested), (access_denied))
+
 #define SMB_VFS_FSET_NT_ACL(fsp, security_info_sent, psd) \
        smb_vfs_call_fset_nt_acl((fsp)->conn->vfs_handles, (fsp), (security_info_sent), (psd))
 #define SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd) \
 #define SMB_VFS_NEXT_GETXATTR(handle,path,name,value,size) \
        smb_vfs_call_getxattr((handle)->next,(path),(name),(value),(size))
 
-#define SMB_VFS_LGETXATTR(conn,path,name,value,size) \
-       smb_vfs_call_lgetxattr((conn)->vfs_handles,(path),(name),(value),(size))
-#define SMB_VFS_NEXT_LGETXATTR(handle,path,name,value,size) \
-       smb_vfs_call_lgetxattr((handle)->next,(path),(name),(value),(size))
-
 #define SMB_VFS_FGETXATTR(fsp,name,value,size) \
        smb_vfs_call_fgetxattr((fsp)->conn->vfs_handles, (fsp), (name),(value),(size))
 #define SMB_VFS_NEXT_FGETXATTR(handle,fsp,name,value,size) \
 #define SMB_VFS_NEXT_LISTXATTR(handle,path,list,size) \
        smb_vfs_call_listxattr((handle)->next,(path),(list),(size))
 
-#define SMB_VFS_LLISTXATTR(conn,path,list,size) \
-       smb_vfs_call_llistxattr((conn)->vfs_handles,(path),(list),(size))
-#define SMB_VFS_NEXT_LLISTXATTR(handle,path,list,size) \
-       smb_vfs_call_llistxattr((handle)->next,(path),(list),(size))
-
 #define SMB_VFS_FLISTXATTR(fsp,list,size) \
        smb_vfs_call_flistxattr((fsp)->conn->vfs_handles, (fsp), (list),(size))
 #define SMB_VFS_NEXT_FLISTXATTR(handle,fsp,list,size) \
 #define SMB_VFS_NEXT_REMOVEXATTR(handle,path,name) \
        smb_vfs_call_removexattr((handle)->next,(path),(name))
 
-#define SMB_VFS_LREMOVEXATTR(conn,path,name) \
-       smb_vfs_call_lremovexattr((conn)->vfs_handles,(path),(name))
-#define SMB_VFS_NEXT_LREMOVEXATTR(handle,path,name) \
-       smb_vfs_call_lremovexattr((handle)->next,(path),(name))
-
 #define SMB_VFS_FREMOVEXATTR(fsp,name) \
        smb_vfs_call_fremovexattr((fsp)->conn->vfs_handles, (fsp), (name))
 #define SMB_VFS_NEXT_FREMOVEXATTR(handle,fsp,name) \
 #define SMB_VFS_NEXT_SETXATTR(handle,path,name,value,size,flags) \
        smb_vfs_call_setxattr((handle)->next,(path),(name),(value),(size),(flags))
 
-#define SMB_VFS_LSETXATTR(conn,path,name,value,size,flags) \
-       smb_vfs_call_lsetxattr((conn)->vfs_handles,(path),(name),(value),(size),(flags))
-#define SMB_VFS_NEXT_LSETXATTR(handle,path,name,value,size,flags) \
-       smb_vfs_call_lsetxattr((handle)->next,(path),(name),(value),(size),(flags))
-
 #define SMB_VFS_FSETXATTR(fsp,name,value,size,flags) \
        smb_vfs_call_fsetxattr((fsp)->conn->vfs_handles, (fsp), (name),(value),(size),(flags))
 #define SMB_VFS_NEXT_FSETXATTR(handle,fsp,name,value,size,flags) \
        smb_vfs_call_aio_write((handle)->next,(fsp),(aiocb))
 
 #define SMB_VFS_AIO_RETURN(fsp,aiocb) \
-       smb_vfs_call_aio_return_fn((fsp)->conn->vfs_handles, (fsp), (aiocb))
+       smb_vfs_call_aio_return((fsp)->conn->vfs_handles, (fsp), (aiocb))
 #define SMB_VFS_NEXT_AIO_RETURN(handle,fsp,aiocb) \
-       smb_vfs_call_aio_return_fn((handle)->next,(fsp),(aiocb))
+       smb_vfs_call_aio_return((handle)->next,(fsp),(aiocb))
 
 #define SMB_VFS_AIO_CANCEL(fsp,aiocb) \
        smb_vfs_call_aio_cancel((fsp)->conn->vfs_handles, (fsp), (aiocb))
        smb_vfs_call_aio_cancel((handle)->next,(fsp),(aiocb))
 
 #define SMB_VFS_AIO_ERROR(fsp,aiocb) \
-       smb_vfs_call_aio_error_fn((fsp)->conn->vfs_handles, (fsp),(aiocb))
+       smb_vfs_call_aio_error((fsp)->conn->vfs_handles, (fsp),(aiocb))
 #define SMB_VFS_NEXT_AIO_ERROR(handle,fsp,aiocb) \
-       smb_vfs_call_aio_error_fn((handle)->next,(fsp),(aiocb))
+       smb_vfs_call_aio_error((handle)->next,(fsp),(aiocb))
 
 #define SMB_VFS_AIO_FSYNC(fsp,op,aiocb) \
        smb_vfs_call_aio_fsync((fsp)->conn->vfs_handles, (fsp), (op),(aiocb))
 #define SMB_VFS_NEXT_AIO_FORCE(handle,fsp) \
        smb_vfs_call_aio_force((handle)->next,(fsp))
 
-#define SMB_VFS_IS_OFFLINE(conn,path,sbuf) \
-       smb_vfs_call_is_offline((conn)->vfs_handles,(path),(sbuf))
-#define SMB_VFS_NEXT_IS_OFFLINE(handle,path,sbuf) \
-       smb_vfs_call_is_offline((handle)->next,(path),(sbuf))
+#define SMB_VFS_IS_OFFLINE(conn,fname,sbuf) \
+       smb_vfs_call_is_offline((conn)->vfs_handles,(fname),(sbuf))
+#define SMB_VFS_NEXT_IS_OFFLINE(handle,fname,sbuf) \
+       smb_vfs_call_is_offline((handle)->next,(fname),(sbuf))
 
-#define SMB_VFS_SET_OFFLINE(conn,path) \
-       smb_vfs_call_set_offline((conn)->vfs_handles,(path))
-#define SMB_VFS_NEXT_SET_OFFLINE(handle,path) \
-       smb_vfs_call_set_offline((handle)->next, (path))
+#define SMB_VFS_SET_OFFLINE(conn,fname) \
+       smb_vfs_call_set_offline((conn)->vfs_handles,(fname))
+#define SMB_VFS_NEXT_SET_OFFLINE(handle,fname) \
+       smb_vfs_call_set_offline((handle)->next, (fname))
 
 #endif /* _VFS_MACROS_H */