vfs_glusterfs: call clock_gettime_mono() only on profile-enabled build
authorUri Simchoni <uri@samba.org>
Mon, 28 Mar 2016 07:20:22 +0000 (10:20 +0300)
committerJeremy Allison <jra@samba.org>
Mon, 28 Mar 2016 22:12:14 +0000 (00:12 +0200)
Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Mar 29 00:12:14 CEST 2016 on sn-devel-144

source3/modules/vfs_glusterfs.c

index e2026729190619398d1db2c1bc609559e73e80d1..5ffbee01eea800fe7eddc1dba0c3648b7fe477f1 100644 (file)
@@ -44,6 +44,7 @@
 #include "lib/tevent/tevent_internal.h"
 #include "smbd/globals.h"
 #include "lib/util/sys_rw.h"
+#include "smbprofile.h"
 
 #define DEFAULT_VOLFILE_SERVER "localhost"
 
@@ -527,7 +528,7 @@ static void aio_glusterfs_done(glfs_fd_t *fd, ssize_t ret, void *data)
 
        state = (struct glusterfs_aio_state *)data;
 
-       clock_gettime_mono(&end);
+       PROFILE_TIMESTAMP(&end);
 
        if (ret < 0) {
                state->ret = -1;
@@ -695,7 +696,7 @@ static struct tevent_req *vfs_gluster_pread_send(struct vfs_handle_struct
                return tevent_req_post(req, ev);
        }
 
-       clock_gettime_mono(&state->start);
+       PROFILE_TIMESTAMP(&state->start);
        ret = glfs_pread_async(*(glfs_fd_t **)VFS_FETCH_FSP_EXTENSION(handle,
                                fsp), data, n, offset, 0, aio_glusterfs_done,
                                state);
@@ -731,7 +732,7 @@ static struct tevent_req *vfs_gluster_pwrite_send(struct vfs_handle_struct
                return tevent_req_post(req, ev);
        }
 
-       clock_gettime_mono(&state->start);
+       PROFILE_TIMESTAMP(&state->start);
        ret = glfs_pwrite_async(*(glfs_fd_t **)VFS_FETCH_FSP_EXTENSION(handle,
                                fsp), data, n, offset, 0, aio_glusterfs_done,
                                state);
@@ -845,7 +846,7 @@ static struct tevent_req *vfs_gluster_fsync_send(struct vfs_handle_struct
                return tevent_req_post(req, ev);
        }
 
-       clock_gettime_mono(&state->start);
+       PROFILE_TIMESTAMP(&state->start);
        ret = glfs_fsync_async(*(glfs_fd_t **)VFS_FETCH_FSP_EXTENSION(handle,
                                fsp), aio_glusterfs_done, req);
        if (ret < 0) {