]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: vfs_ceph. Implement renameat().
authorJeremy Allison <jra@samba.org>
Fri, 9 Aug 2019 20:45:32 +0000 (13:45 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 16 Aug 2019 19:52:32 +0000 (19:52 +0000)
Currently identical to rename().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_ceph.c

index bdf1f5128cf58f64300f2d9fb8ae31377f98cd75..14d450161bc60aa9515bb35567c4d498893aec0f 100644 (file)
@@ -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,