From: Jeremy Allison Date: Fri, 9 Aug 2019 20:45:32 +0000 (-0700) Subject: s3: VFS: vfs_ceph. Implement renameat(). X-Git-Tag: tdb-1.4.2~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab74d8d5bd4636405731c9d2aa2d32880844b349;p=thirdparty%2Fsamba.git s3: VFS: vfs_ceph. Implement renameat(). Currently identical to rename(). Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c index bdf1f5128cf..14d450161bc 100644 --- a/source3/modules/vfs_ceph.c +++ b/source3/modules/vfs_ceph.c @@ -621,6 +621,23 @@ static int cephwrap_rename(struct vfs_handle_struct *handle, WRAP_RETURN(result); } +static int cephwrap_renameat(struct vfs_handle_struct *handle, + files_struct *srcfsp, + const struct smb_filename *smb_fname_src, + files_struct *dstfsp, + const struct smb_filename *smb_fname_dst) +{ + int result = -1; + DBG_DEBUG("[CEPH] cephwrap_renameat\n"); + if (smb_fname_src->stream_name || smb_fname_dst->stream_name) { + errno = ENOENT; + return result; + } + + result = ceph_rename(handle->data, smb_fname_src->base_name, smb_fname_dst->base_name); + WRAP_RETURN(result); +} + /* * Fake up an async ceph fsync by calling the synchronous API. */ @@ -1427,6 +1444,7 @@ static struct vfs_fn_pointers ceph_fns = { .sendfile_fn = cephwrap_sendfile, .recvfile_fn = cephwrap_recvfile, .rename_fn = cephwrap_rename, + .renameat_fn = cephwrap_renameat, .fsync_send_fn = cephwrap_fsync_send, .fsync_recv_fn = cephwrap_fsync_recv, .stat_fn = cephwrap_stat,