s3: VFS: Complete the removal of SMB_VFS_CHOWN()
[samba.git] / source3 / include / vfs_macros.h
index 2d810d0aa8045e6364658c7d4fec1cd64cc2550a..6a7cbf2275d7827a4b3043b9527d7f20873ed0cd 100644 (file)
 #define SMB_VFS_NEXT_REWINDDIR(handle, dirp) \
        smb_vfs_call_rewind_dir((handle)->next, (dirp))
 
-#define SMB_VFS_MKDIR(conn, smb_fname, mode) \
-       smb_vfs_call_mkdir((conn)->vfs_handles,(smb_fname), (mode))
-#define SMB_VFS_NEXT_MKDIR(handle, smb_fname, mode) \
-       smb_vfs_call_mkdir((handle)->next,(smb_fname), (mode))
-
-#define SMB_VFS_RMDIR(conn, smb_fname) \
-       smb_vfs_call_rmdir((conn)->vfs_handles, (smb_fname))
-#define SMB_VFS_NEXT_RMDIR(handle, smb_fname) \
-       smb_vfs_call_rmdir((handle)->next, (smb_fname))
+#define SMB_VFS_MKDIRAT(conn, dirfsp, smb_fname, mode) \
+       smb_vfs_call_mkdirat((conn)->vfs_handles,(dirfsp), (smb_fname), (mode))
+#define SMB_VFS_NEXT_MKDIRAT(handle, dirfsp, smb_fname, mode) \
+       smb_vfs_call_mkdirat((handle)->next,(dirfsp), (smb_fname), (mode))
 
 #define SMB_VFS_CLOSEDIR(conn, dir) \
        smb_vfs_call_closedir((conn)->vfs_handles, dir)
 #define SMB_VFS_NEXT_CLOSEDIR(handle, dir) \
        smb_vfs_call_closedir((handle)->next, (dir))
 
-#define SMB_VFS_INIT_SEARCH_OP(conn, dirp) \
-       smb_vfs_call_init_search_op((conn)->vfs_handles, (dirp))
-#define SMB_VFS_NEXT_INIT_SEARCH_OP(handle, dirp) \
-       smb_vfs_call_init_search_op((handle)->next, (dirp))
-
 /* File operations */
 #define SMB_VFS_OPEN(conn, fname, fsp, flags, mode) \
        smb_vfs_call_open((conn)->vfs_handles, (fname), (fsp), (flags), (mode))
 #define SMB_VFS_NEXT_CLOSE(handle, fsp) \
        smb_vfs_call_close((handle)->next, (fsp))
 
-#define SMB_VFS_READ(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_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_PREAD(handle, fsp, data, n, off) \
        smb_vfs_call_pread_send((handle)->next, (mem_ctx), (ev), (fsp), \
                                (data), (n), (off))
 
-#define SMB_VFS_WRITE(fsp, data, n) \
-       smb_vfs_call_write((fsp)->conn->vfs_handles, (fsp), (data), (n))
-#define SMB_VFS_NEXT_WRITE(handle, fsp, data, n) \
-       smb_vfs_call_write((handle)->next, (fsp), (data), (n))
-
 #define SMB_VFS_PWRITE(fsp, data, n, off) \
        smb_vfs_call_pwrite((fsp)->conn->vfs_handles, (fsp), (data), (n), (off))
 #define SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, off) \
 #define SMB_VFS_NEXT_RECVFILE(handle, fromfd, tofsp, offset, count) \
        smb_vfs_call_recvfile((handle)->next, (fromfd), (tofsp), (offset), (count))
 
-#define SMB_VFS_RENAME(conn, old, new) \
-       smb_vfs_call_rename((conn)->vfs_handles, (old), (new))
-#define SMB_VFS_NEXT_RENAME(handle, old, new) \
-       smb_vfs_call_rename((handle)->next, (old), (new))
+#define SMB_VFS_RENAMEAT(conn, oldfsp, old, newfsp, new) \
+       smb_vfs_call_renameat((conn)->vfs_handles, (oldfsp), (old), (newfsp), (new))
+#define SMB_VFS_NEXT_RENAMEAT(handle, oldfsp, old, newfsp, new) \
+       smb_vfs_call_renameat((handle)->next, (oldfsp), (old), (newfsp), (new))
 
 #define SMB_VFS_FSYNC(fsp) \
        smb_vfs_call_fsync((fsp)->conn->vfs_handles, (fsp))
 #define SMB_VFS_NEXT_GET_ALLOC_SIZE(conn, fsp, sbuf) \
        smb_vfs_call_get_alloc_size((conn)->next, (fsp), (sbuf))
 
-#define SMB_VFS_UNLINK(conn, path) \
-       smb_vfs_call_unlink((conn)->vfs_handles, (path))
-#define SMB_VFS_NEXT_UNLINK(handle, path) \
-       smb_vfs_call_unlink((handle)->next, (path))
+#define SMB_VFS_UNLINKAT(conn, dirfsp, path, flags) \
+       smb_vfs_call_unlinkat((conn)->vfs_handles, (dirfsp), (path), (flags))
+#define SMB_VFS_NEXT_UNLINKAT(handle, dirfsp, path, flags) \
+       smb_vfs_call_unlinkat((handle)->next, (dirfsp), (path), (flags))
 
 #define SMB_VFS_CHMOD(conn, smb_fname, mode) \
        smb_vfs_call_chmod((conn)->vfs_handles, (smb_fname), (mode))
 #define SMB_VFS_NEXT_FCHMOD(handle, fsp, mode) \
        smb_vfs_call_fchmod((handle)->next, (fsp), (mode))
 
-#define SMB_VFS_CHOWN(conn, smb_fname, uid, gid) \
-       smb_vfs_call_chown((conn)->vfs_handles, (smb_fname), (uid), (gid))
-#define SMB_VFS_NEXT_CHOWN(handle, smb_fname, uid, gid) \
-       smb_vfs_call_chown((handle)->next, (smb_fname), (uid), (gid))
-
 #define SMB_VFS_FCHOWN(fsp, uid, gid) \
        smb_vfs_call_fchown((fsp)->conn->vfs_handles, (fsp), (uid), (gid))
 #define SMB_VFS_NEXT_FCHOWN(handle, fsp, uid, gid) \
 #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_FCNTL(fsp, cmd, ...) \
+       smb_vfs_call_fcntl((fsp)->conn->vfs_handles, (fsp), (cmd), (__VA_ARGS__))
+#define SMB_VFS_NEXT_FCNTL(handle, fsp, cmd, ...) \
+       smb_vfs_call_fcntl((handle)->next, (fsp), (cmd), (__VA_ARGS__))
+
 #define SMB_VFS_LINUX_SETLEASE(fsp, leasetype) \
        smb_vfs_call_linux_setlease((fsp)->conn->vfs_handles, (fsp), (leasetype))
 #define SMB_VFS_NEXT_LINUX_SETLEASE(handle, fsp, leasetype) \
 #define SMB_VFS_NEXT_GETLOCK(handle, fsp, poffset, pcount, ptype, ppid) \
        smb_vfs_call_getlock((handle)->next, (fsp), (poffset), (pcount), (ptype), (ppid))
 
-#define SMB_VFS_SYMLINK(conn, oldpath, newpath) \
-       smb_vfs_call_symlink((conn)->vfs_handles, (oldpath), (newpath))
-#define SMB_VFS_NEXT_SYMLINK(handle, oldpath, newpath) \
-       smb_vfs_call_symlink((handle)->next, (oldpath), (newpath))
+#define SMB_VFS_SYMLINKAT(conn, oldpath, dirfsp, newpath) \
+       smb_vfs_call_symlinkat((conn)->vfs_handles, (oldpath), (dirfsp), (newpath))
+#define SMB_VFS_NEXT_SYMLINKAT(handle, oldpath, dirfsp, newpath) \
+       smb_vfs_call_symlinkat((handle)->next, (oldpath), (dirfsp), (newpath))
 
-#define SMB_VFS_READLINK(conn, smb_fname, buf, bufsiz) \
-       smb_vfs_call_readlink((conn)->vfs_handles, (smb_fname), (buf), (bufsiz))
-#define SMB_VFS_NEXT_READLINK(handle, smb_fname, buf, bufsiz) \
-       smb_vfs_call_readlink((handle)->next, (smb_fname), (buf), (bufsiz))
+#define SMB_VFS_READLINKAT(conn, dirfsp, smb_fname, buf, bufsiz) \
+       smb_vfs_call_readlinkat((conn)->vfs_handles, (dirfsp), (smb_fname), (buf), (bufsiz))
+#define SMB_VFS_NEXT_READLINKAT(handle, dirfsp, smb_fname, buf, bufsiz) \
+       smb_vfs_call_readlinkat((handle)->next, (dirfsp), (smb_fname), (buf), (bufsiz))
 
-#define SMB_VFS_LINK(conn, oldpath, newpath) \
-       smb_vfs_call_link((conn)->vfs_handles, (oldpath), (newpath))
-#define SMB_VFS_NEXT_LINK(handle, oldpath, newpath) \
-       smb_vfs_call_link((handle)->next, (oldpath), (newpath))
+#define SMB_VFS_LINKAT(conn, srcfsp, oldpath, dstfsp, newpath, flags) \
+       smb_vfs_call_linkat((conn)->vfs_handles, (srcfsp), (oldpath), (dstfsp), (newpath), (flags))
+#define SMB_VFS_NEXT_LINKAT(handle, srcfsp, oldpath, dstfsp, newpath, flags) \
+       smb_vfs_call_linkat((handle)->next, (srcfsp), (oldpath), (dstfsp), (newpath), (flags))
 
-#define SMB_VFS_MKNOD(conn, smb_fname, mode, dev) \
-       smb_vfs_call_mknod((conn)->vfs_handles, (smb_fname), (mode), (dev))
-#define SMB_VFS_NEXT_MKNOD(handle, smb_fname, mode, dev) \
-       smb_vfs_call_mknod((handle)->next, (smb_fname), (mode), (dev))
+#define SMB_VFS_MKNODAT(conn, dirfsp, smb_fname, mode, dev) \
+       smb_vfs_call_mknodat((conn)->vfs_handles, (dirfsp), (smb_fname), (mode), (dev))
+#define SMB_VFS_NEXT_MKNODAT(handle, dirfsp, smb_fname, mode, dev) \
+       smb_vfs_call_mknodat((handle)->next, (dirfsp), (smb_fname), (mode), (dev))
 
 #define SMB_VFS_REALPATH(conn, ctx, smb_fname) \
        smb_vfs_call_realpath((conn)->vfs_handles, (ctx), (smb_fname))
 #define SMB_VFS_NEXT_FILE_ID_CREATE(handle, sbuf) \
        smb_vfs_call_file_id_create((handle)->next, (sbuf))
 
+#define SMB_VFS_FS_FILE_ID(conn, sbuf) \
+       smb_vfs_call_fs_file_id((conn)->vfs_handles, (sbuf))
+#define SMB_VFS_NEXT_FS_FILE_ID(handle, sbuf) \
+       smb_vfs_call_fs_file_id((handle)->next, (sbuf))
+
 #define SMB_VFS_STREAMINFO(conn, fsp, smb_fname, mem_ctx, num_streams, streams) \
        smb_vfs_call_streaminfo((conn)->vfs_handles, (fsp), (smb_fname), (mem_ctx), (num_streams), (streams))
 #define SMB_VFS_NEXT_STREAMINFO(handle, fsp, smb_fname, mem_ctx, num_streams, streams) \
 #define SMB_VFS_NEXT_CONNECTPATH(conn, smb_fname) \
        smb_vfs_call_connectpath((conn)->next, (smb_fname))
 
-#define SMB_VFS_BRL_LOCK_WINDOWS(conn, br_lck, plock, blocking_lock) \
-       smb_vfs_call_brl_lock_windows((conn)->vfs_handles, (br_lck), (plock), (blocking_lock))
-#define SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle, br_lck, plock, blocking_lock) \
-       smb_vfs_call_brl_lock_windows((handle)->next, (br_lck), (plock), (blocking_lock))
+#define SMB_VFS_BRL_LOCK_WINDOWS(conn, br_lck, plock) \
+       smb_vfs_call_brl_lock_windows((conn)->vfs_handles, (br_lck), (plock))
+#define SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle, br_lck, plock) \
+       smb_vfs_call_brl_lock_windows((handle)->next, (br_lck), (plock))
 
-#define SMB_VFS_BRL_UNLOCK_WINDOWS(conn, msg_ctx, br_lck, plock) \
-       smb_vfs_call_brl_unlock_windows((conn)->vfs_handles, (msg_ctx), (br_lck), (plock))
-#define SMB_VFS_NEXT_BRL_UNLOCK_WINDOWS(handle, msg_ctx, br_lck, plock) \
-       smb_vfs_call_brl_unlock_windows((handle)->next, (msg_ctx), (br_lck), (plock))
+#define SMB_VFS_BRL_UNLOCK_WINDOWS(conn, br_lck, plock) \
+       smb_vfs_call_brl_unlock_windows((conn)->vfs_handles, (br_lck), (plock))
+#define SMB_VFS_NEXT_BRL_UNLOCK_WINDOWS(handle, br_lck, plock) \
+       smb_vfs_call_brl_unlock_windows((handle)->next, (br_lck), (plock))
 
-#define SMB_VFS_BRL_CANCEL_WINDOWS(conn, br_lck, plock) \
-       smb_vfs_call_brl_cancel_windows((conn)->vfs_handles, (br_lck), (plock))
-#define SMB_VFS_NEXT_BRL_CANCEL_WINDOWS(handle, br_lck, plock) \
-       smb_vfs_call_brl_cancel_windows((handle)->next, (br_lck), (plock))
-
-#define SMB_VFS_STRICT_LOCK(conn, fsp, plock) \
-       smb_vfs_call_strict_lock((conn)->vfs_handles, (fsp), (plock))
-#define SMB_VFS_NEXT_STRICT_LOCK(handle, fsp, plock) \
-       smb_vfs_call_strict_lock((handle)->next, (fsp), (plock))
-
-#define SMB_VFS_STRICT_UNLOCK(conn, fsp, plock) \
-       smb_vfs_call_strict_unlock((conn)->vfs_handles, (fsp), (plock))
-#define SMB_VFS_NEXT_STRICT_UNLOCK(handle, fsp, plock) \
-       smb_vfs_call_strict_unlock((handle)->next, (fsp), (plock))
+#define SMB_VFS_STRICT_LOCK_CHECK(conn, fsp, plock) \
+       smb_vfs_call_strict_lock_check((conn)->vfs_handles, (fsp), (plock))
+#define SMB_VFS_NEXT_STRICT_LOCK_CHECK(handle, fsp, plock) \
+       smb_vfs_call_strict_lock_check((handle)->next, (fsp), (plock))
 
 #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_FGET_DOS_ATTRIBUTES(handle, fsp, attributes) \
        smb_vfs_call_fget_dos_attributes((handle)->next, (fsp), (attributes))
 
+#define SMB_VFS_GET_DOS_ATTRIBUTES_SEND(mem_ctx, evg, dir_fsp, smb_fname) \
+       smb_vfs_call_get_dos_attributes_send((mem_ctx), (evg), \
+                                            (dir_fsp)->conn->vfs_handles, \
+                                            (dir_fsp), (smb_fname))
+#define SMB_VFS_GET_DOS_ATTRIBUTES_RECV(req, aio_state, dosmode) \
+       smb_vfs_call_get_dos_attributes_recv((req), (aio_state), (dosmode))
+
+#define SMB_VFS_NEXT_GET_DOS_ATTRIBUTES_SEND(mem_ctx, evg, handle, dir_fsp, \
+                                            smb_fname) \
+       smb_vfs_call_get_dos_attributes_send((mem_ctx), (evg), \
+                                            (handle)->next, \
+                                            (dir_fsp), (smb_fname))
+#define SMB_VFS_NEXT_GET_DOS_ATTRIBUTES_RECV(req, aio_state, dosmode) \
+       smb_vfs_call_get_dos_attributes_recv((req), (aio_state), (dosmode))
+
 #define SMB_VFS_SET_DOS_ATTRIBUTES(conn, smb_fname, attributes) \
        smb_vfs_call_set_dos_attributes((conn)->vfs_handles, (smb_fname), (attributes))
 #define SMB_VFS_NEXT_SET_DOS_ATTRIBUTES(handle, smb_fname, attributes) \
 #define SMB_VFS_NEXT_OFFLOAD_READ_RECV(req, handle, mem_ctx, token_blob) \
        smb_vfs_call_offload_read_recv((req), (handle)->next, (mem_ctx), (token_blob))
 
-#define SMB_VFS_OFFLOAD_WRITE_SEND(conn, mem_ctx, ev, src_fsp, src_off, dest_fsp, dest_off, num, flags) \
-       smb_vfs_call_offload_write_send((conn)->vfs_handles, (mem_ctx), (ev), (src_fsp), (src_off), (dest_fsp), (dest_off), (num), (flags))
-#define SMB_VFS_NEXT_OFFLOAD_WRITE_SEND(handle, mem_ctx, ev, src_fsp, src_off, dest_fsp, dest_off, num, flags) \
-       smb_vfs_call_offload_write_send((handle)->next, (mem_ctx), (ev), (src_fsp), (src_off), (dest_fsp), (dest_off), (num), (flags))
+#define SMB_VFS_OFFLOAD_WRITE_SEND(conn, mem_ctx, ev, fsctl, token, transfer_offset, dest_fsp, dest_off, num) \
+       smb_vfs_call_offload_write_send((conn)->vfs_handles, (mem_ctx), (ev), (fsctl), (token), (transfer_offset), (dest_fsp), (dest_off), (num))
+#define SMB_VFS_NEXT_OFFLOAD_WRITE_SEND(handle, mem_ctx, ev, fsctl, token, transfer_offset, dest_fsp, dest_off, num) \
+       smb_vfs_call_offload_write_send((handle)->next, (mem_ctx), (ev), (fsctl), (token), (transfer_offset), (dest_fsp), (dest_off), (num))
 
 #define SMB_VFS_OFFLOAD_WRITE_RECV(conn, req, copied) \
        smb_vfs_call_offload_write_recv((conn)->vfs_handles, (req), (copied))
 #define SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd) \
        smb_vfs_call_fset_nt_acl((handle)->next, (fsp), (security_info_sent), (psd))
 
-#define SMB_VFS_CHMOD_ACL(conn, smb_fname, mode) \
-       smb_vfs_call_chmod_acl((conn)->vfs_handles, (smb_fname), (mode))
-#define SMB_VFS_NEXT_CHMOD_ACL(handle, smb_fname, mode) \
-       smb_vfs_call_chmod_acl((handle)->next, (smb_fname), (mode))
-
-#define SMB_VFS_FCHMOD_ACL(fsp, mode) \
-       smb_vfs_call_fchmod_acl((fsp)->conn->vfs_handles, (fsp), (mode))
-#define SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode) \
-       smb_vfs_call_fchmod_acl((handle)->next, (fsp), (mode))
-
 #define SMB_VFS_SYS_ACL_GET_FILE(conn, smb_fname, type, mem_ctx)               \
        smb_vfs_call_sys_acl_get_file((conn)->vfs_handles, (smb_fname), (type), (mem_ctx))
 #define SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, smb_fname, type, mem_ctx)                \
 #define SMB_VFS_NEXT_GETXATTR(handle,smb_fname,name,value,size) \
        smb_vfs_call_getxattr((handle)->next,(smb_fname),(name),(value),(size))
 
+#define SMB_VFS_GETXATTRAT_SEND(mem_ctx,ev,dir_fsp,smb_fname, \
+                               xattr_name, alloc_hint) \
+       smb_vfs_call_getxattrat_send((mem_ctx),(ev), \
+                                    (dir_fsp)->conn->vfs_handles, \
+                                    (dir_fsp),(smb_fname),(xattr_name), \
+                                    (alloc_hint))
+#define SMB_VFS_GETXATTRAT_RECV(req, aio_state, mem_ctx, xattr_value) \
+       smb_vfs_call_getxattrat_recv((req),(aio_state),(mem_ctx),(xattr_value))
+
+#define SMB_VFS_NEXT_GETXATTRAT_SEND(mem_ctx,ev,handle,dir_fsp,smb_fname, \
+                                    xattr_name,alloc_hint) \
+       smb_vfs_call_getxattrat_send((mem_ctx),(ev), \
+                                    (handle)->next, \
+                                    (dir_fsp), (smb_fname),(xattr_name), \
+                                    (alloc_hint))
+#define SMB_VFS_NEXT_GETXATTRAT_RECV(req, aio_state, mem_ctx, xattr_value) \
+       smb_vfs_call_getxattrat_recv((req),(aio_state),(mem_ctx),(xattr_value))
+
 #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) \