]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: vfs_ceph. Implement mknodat().
authorJeremy Allison <jra@samba.org>
Tue, 20 Aug 2019 23:50:57 +0000 (16:50 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 22 Aug 2019 18:00:33 +0000 (18:00 +0000)
Currently identical to mknod().

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

index 93d5801136d66c56ced91bb9e5901de666d734d8..1beafba4f7b8321cf51f76f700064b698fbf2382 100644 (file)
@@ -1190,6 +1190,20 @@ static int cephwrap_mknod(struct vfs_handle_struct *handle,
        WRAP_RETURN(result);
 }
 
+static int cephwrap_mknodat(struct vfs_handle_struct *handle,
+               files_struct *dirfsp,
+               const struct smb_filename *smb_fname,
+               mode_t mode,
+               SMB_DEV_T dev)
+{
+       int result = -1;
+       DBG_DEBUG("[CEPH] mknodat(%p, %s)\n", handle, smb_fname->base_name);
+       SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp);
+       result = ceph_mknod(handle->data, smb_fname->base_name, mode, dev);
+       DBG_DEBUG("[CEPH] mknodat(...) = %d\n", result);
+       WRAP_RETURN(result);
+}
+
 /*
  * This is a simple version of real-path ... a better version is needed to
  * ask libceph about symbolic links.
@@ -1460,6 +1474,7 @@ static struct vfs_fn_pointers ceph_fns = {
        .readlink_fn = cephwrap_readlink,
        .linkat_fn = cephwrap_linkat,
        .mknod_fn = cephwrap_mknod,
+       .mknodat_fn = cephwrap_mknodat,
        .realpath_fn = cephwrap_realpath,
        .chflags_fn = cephwrap_chflags,
        .get_real_filename_fn = cephwrap_get_real_filename,