vfs_time_audit: remove init_search_op implementation
[nivanova/samba-autobuild/.git] / source3 / modules / vfs_time_audit.c
index a9289536e1c1b38737c909ea71c8eecd4bde43fc..8e08a7be095d03a740c739301ece60dcf9bc20a6 100644 (file)
@@ -157,43 +157,49 @@ static void smb_time_audit_disconnect(vfs_handle_struct *handle)
 }
 
 static uint64_t smb_time_audit_disk_free(vfs_handle_struct *handle,
-                                        const char *path,
-                                        bool small_query, uint64_t *bsize,
-                                        uint64_t *dfree, uint64_t *dsize)
+                                       const struct smb_filename *smb_fname,
+                                       uint64_t *bsize,
+                                       uint64_t *dfree,
+                                       uint64_t *dsize)
 {
        uint64_t result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_DISK_FREE(handle, path, small_query, bsize,
-                                       dfree, dsize);
+       result = SMB_VFS_NEXT_DISK_FREE(handle, smb_fname, bsize, dfree, dsize);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        /* Don't have a reasonable notion of failure here */
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("disk_free", timediff, path);
+               smb_time_audit_log_fname("disk_free",
+                               timediff,
+                               smb_fname->base_name);
        }
 
        return result;
 }
 
 static int smb_time_audit_get_quota(struct vfs_handle_struct *handle,
-                                   enum SMB_QUOTA_TYPE qtype, unid_t id,
-                                   SMB_DISK_QUOTA *qt)
+                                       const struct smb_filename *smb_fname,
+                                       enum SMB_QUOTA_TYPE qtype,
+                                       unid_t id,
+                                       SMB_DISK_QUOTA *qt)
 {
        int result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_GET_QUOTA(handle, qtype, id, qt);
+       result = SMB_VFS_NEXT_GET_QUOTA(handle, smb_fname, qtype, id, qt);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log("get_quota", timediff);
+               smb_time_audit_log_fname("get_quota",
+                               timediff,
+                               smb_fname->base_name);
        }
        return result;
 }
@@ -241,7 +247,7 @@ static int smb_time_audit_get_shadow_copy_data(struct vfs_handle_struct *handle,
 }
 
 static int smb_time_audit_statvfs(struct vfs_handle_struct *handle,
-                                 const char *path,
+                                 const struct smb_filename *smb_fname,
                                  struct vfs_statvfs_struct *statbuf)
 {
        int result;
@@ -249,12 +255,13 @@ static int smb_time_audit_statvfs(struct vfs_handle_struct *handle,
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_STATVFS(handle, path, statbuf);
+       result = SMB_VFS_NEXT_STATVFS(handle, smb_fname, statbuf);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("statvfs", timediff, path);
+               smb_time_audit_log_fname("statvfs", timediff,
+                       smb_fname->base_name);
        }
 
        return result;
@@ -279,21 +286,110 @@ static uint32_t smb_time_audit_fs_capabilities(struct vfs_handle_struct *handle,
        return result;
 }
 
+static NTSTATUS smb_time_audit_get_dfs_referrals(
+                       struct vfs_handle_struct *handle,
+                       struct dfs_GetDFSReferral *r)
+{
+       NTSTATUS result;
+       struct timespec ts1,ts2;
+       double timediff;
+
+       clock_gettime_mono(&ts1);
+       result = SMB_VFS_NEXT_GET_DFS_REFERRALS(handle, r);
+       clock_gettime_mono(&ts2);
+       timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
+
+       if (timediff > audit_timeout) {
+               smb_time_audit_log("get_dfs_referrals(", timediff);
+       }
+
+       return result;
+}
+
+static NTSTATUS smb_time_audit_snap_check_path(struct vfs_handle_struct *handle,
+                                              TALLOC_CTX *mem_ctx,
+                                              const char *service_path,
+                                              char **base_volume)
+{
+       NTSTATUS status;
+       struct timespec ts1,ts2;
+       double timediff;
+
+       clock_gettime_mono(&ts1);
+       status = SMB_VFS_NEXT_SNAP_CHECK_PATH(handle, mem_ctx, service_path,
+                                             base_volume);
+       clock_gettime_mono(&ts2);
+       timediff = nsec_time_diff(&ts2, &ts1) * 1.0e-9;
+
+       if (timediff > audit_timeout) {
+               smb_time_audit_log("snap_check_path", timediff);
+       }
+
+       return status;
+}
+
+static NTSTATUS smb_time_audit_snap_create(struct vfs_handle_struct *handle,
+                                          TALLOC_CTX *mem_ctx,
+                                          const char *base_volume,
+                                          time_t *tstamp,
+                                          bool rw,
+                                          char **base_path,
+                                          char **snap_path)
+{
+       NTSTATUS status;
+       struct timespec ts1,ts2;
+       double timediff;
+
+       clock_gettime_mono(&ts1);
+       status = SMB_VFS_NEXT_SNAP_CREATE(handle, mem_ctx, base_volume, tstamp,
+                                         rw, base_path, snap_path);
+       clock_gettime_mono(&ts2);
+       timediff = nsec_time_diff(&ts2 ,&ts1) * 1.0e-9;
+
+       if (timediff > audit_timeout) {
+               smb_time_audit_log("snap_create", timediff);
+       }
+
+       return status;
+}
+
+static NTSTATUS smb_time_audit_snap_delete(struct vfs_handle_struct *handle,
+                                          TALLOC_CTX *mem_ctx,
+                                          char *base_path,
+                                          char *snap_path)
+{
+       NTSTATUS status;
+       struct timespec ts1,ts2;
+       double timediff;
+
+       clock_gettime_mono(&ts1);
+       status = SMB_VFS_NEXT_SNAP_DELETE(handle, mem_ctx, base_path,
+                                         snap_path);
+       clock_gettime_mono(&ts2);
+       timediff = nsec_time_diff(&ts2, &ts1) * 1.0e-9;
+
+       if (timediff > audit_timeout) {
+               smb_time_audit_log("snap_delete", timediff);
+       }
+
+       return status;
+}
+
 static DIR *smb_time_audit_opendir(vfs_handle_struct *handle,
-                                             const char *fname,
-                                             const char *mask, uint32 attr)
+                                  const struct smb_filename *smb_fname,
+                                  const char *mask, uint32_t attr)
 {
        DIR *result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr);
+       result = SMB_VFS_NEXT_OPENDIR(handle, smb_fname, mask, attr);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("opendir", timediff, fname);
+               smb_time_audit_log_smb_fname("opendir", timediff, smb_fname);
        }
 
        return result;
@@ -301,7 +397,7 @@ static DIR *smb_time_audit_opendir(vfs_handle_struct *handle,
 
 static DIR *smb_time_audit_fdopendir(vfs_handle_struct *handle,
                                              files_struct *fsp,
-                                             const char *mask, uint32 attr)
+                                             const char *mask, uint32_t attr)
 {
        DIR *result;
        struct timespec ts1,ts2;
@@ -393,38 +489,43 @@ static void smb_time_audit_rewinddir(vfs_handle_struct *handle,
 }
 
 static int smb_time_audit_mkdir(vfs_handle_struct *handle,
-                               const char *path, mode_t mode)
+                               const struct smb_filename *smb_fname,
+                               mode_t mode)
 {
        int result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_MKDIR(handle, path, mode);
+       result = SMB_VFS_NEXT_MKDIR(handle, smb_fname, mode);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("mkdir", timediff, path);
+               smb_time_audit_log_smb_fname("mkdir",
+                       timediff,
+                       smb_fname);
        }
 
        return result;
 }
 
 static int smb_time_audit_rmdir(vfs_handle_struct *handle,
-                               const char *path)
+                               const struct smb_filename *smb_fname)
 {
        int result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_RMDIR(handle, path);
+       result = SMB_VFS_NEXT_RMDIR(handle, smb_fname);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("rmdir", timediff, path);
+               smb_time_audit_log_smb_fname("rmdir",
+                       timediff,
+                       smb_fname);
        }
 
        return result;
@@ -449,22 +550,6 @@ static int smb_time_audit_closedir(vfs_handle_struct *handle,
        return result;
 }
 
-static void smb_time_audit_init_search_op(vfs_handle_struct *handle,
-                                         DIR *dirp)
-{
-       struct timespec ts1,ts2;
-       double timediff;
-
-       clock_gettime_mono(&ts1);
-       SMB_VFS_NEXT_INIT_SEARCH_OP(handle, dirp);
-       clock_gettime_mono(&ts2);
-       timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
-
-       if (timediff > audit_timeout) {
-               smb_time_audit_log("init_search_op", timediff);
-       }
-}
-
 static int smb_time_audit_open(vfs_handle_struct *handle,
                               struct smb_filename *fname,
                               files_struct *fsp,
@@ -496,12 +581,15 @@ static NTSTATUS smb_time_audit_create_file(vfs_handle_struct *handle,
                                           uint32_t create_options,
                                           uint32_t file_attributes,
                                           uint32_t oplock_request,
+                                          struct smb2_lease *lease,
                                           uint64_t allocation_size,
                                           uint32_t private_flags,
                                           struct security_descriptor *sd,
                                           struct ea_list *ea_list,
                                           files_struct **result_fsp,
-                                          int *pinfo)
+                                          int *pinfo,
+                                          const struct smb2_create_blobs *in_context_blobs,
+                                          struct smb2_create_blobs *out_context_blobs)
 {
        NTSTATUS result;
        struct timespec ts1,ts2;
@@ -519,12 +607,14 @@ static NTSTATUS smb_time_audit_create_file(vfs_handle_struct *handle,
                create_options,                         /* create_options */
                file_attributes,                        /* file_attributes */
                oplock_request,                         /* oplock_request */
+               lease,                                  /* lease */
                allocation_size,                        /* allocation_size */
                private_flags,
                sd,                                     /* sd */
                ea_list,                                /* ea_list */
                result_fsp,                             /* result */
-               pinfo);
+               pinfo,
+               in_context_blobs, out_context_blobs);   /* create context */
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
@@ -599,9 +689,8 @@ static ssize_t smb_time_audit_pread(vfs_handle_struct *handle,
 
 struct smb_time_audit_pread_state {
        struct files_struct *fsp;
-       struct timespec ts1;
        ssize_t ret;
-       int err;
+       struct vfs_aio_state vfs_aio_state;
 };
 
 static void smb_time_audit_pread_done(struct tevent_req *subreq);
@@ -619,7 +708,6 @@ static struct tevent_req *smb_time_audit_pread_send(
        if (req == NULL) {
                return NULL;
        }
-       clock_gettime_mono(&state->ts1);
        state->fsp = fsp;
 
        subreq = SMB_VFS_NEXT_PREAD_SEND(state, ev, handle, fsp, data,
@@ -638,29 +726,28 @@ static void smb_time_audit_pread_done(struct tevent_req *subreq)
        struct smb_time_audit_pread_state *state = tevent_req_data(
                req, struct smb_time_audit_pread_state);
 
-       state->ret = SMB_VFS_PREAD_RECV(subreq, &state->err);
+       state->ret = SMB_VFS_PREAD_RECV(subreq, &state->vfs_aio_state);
        TALLOC_FREE(subreq);
        tevent_req_done(req);
 }
 
-static ssize_t smb_time_audit_pread_recv(struct tevent_req *req, int *err)
+static ssize_t smb_time_audit_pread_recv(struct tevent_req *req,
+                                        struct vfs_aio_state *vfs_aio_state)
 {
        struct smb_time_audit_pread_state *state = tevent_req_data(
                req, struct smb_time_audit_pread_state);
-       struct timespec ts2;
        double timediff;
 
-       clock_gettime_mono(&ts2);
-       timediff = nsec_time_diff(&ts2,&state->ts1)*1.0e-9;
+       timediff = state->vfs_aio_state.duration * 1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fsp("pread", timediff, state->fsp);
+               smb_time_audit_log_fsp("async pread", timediff, state->fsp);
        }
 
-       if (tevent_req_is_unix_error(req, err)) {
+       if (tevent_req_is_unix_error(req, &vfs_aio_state->error)) {
                return -1;
        }
-       *err = state->err;
+       *vfs_aio_state = state->vfs_aio_state;
        return state->ret;
 }
 
@@ -707,9 +794,8 @@ static ssize_t smb_time_audit_pwrite(vfs_handle_struct *handle,
 
 struct smb_time_audit_pwrite_state {
        struct files_struct *fsp;
-       struct timespec ts1;
        ssize_t ret;
-       int err;
+       struct vfs_aio_state vfs_aio_state;
 };
 
 static void smb_time_audit_pwrite_done(struct tevent_req *subreq);
@@ -727,7 +813,6 @@ static struct tevent_req *smb_time_audit_pwrite_send(
        if (req == NULL) {
                return NULL;
        }
-       clock_gettime_mono(&state->ts1);
        state->fsp = fsp;
 
        subreq = SMB_VFS_NEXT_PWRITE_SEND(state, ev, handle, fsp, data,
@@ -746,29 +831,28 @@ static void smb_time_audit_pwrite_done(struct tevent_req *subreq)
        struct smb_time_audit_pwrite_state *state = tevent_req_data(
                req, struct smb_time_audit_pwrite_state);
 
-       state->ret = SMB_VFS_PWRITE_RECV(subreq, &state->err);
+       state->ret = SMB_VFS_PWRITE_RECV(subreq, &state->vfs_aio_state);
        TALLOC_FREE(subreq);
        tevent_req_done(req);
 }
 
-static ssize_t smb_time_audit_pwrite_recv(struct tevent_req *req, int *err)
+static ssize_t smb_time_audit_pwrite_recv(struct tevent_req *req,
+                                         struct vfs_aio_state *vfs_aio_state)
 {
        struct smb_time_audit_pwrite_state *state = tevent_req_data(
                req, struct smb_time_audit_pwrite_state);
-       struct timespec ts2;
        double timediff;
 
-       clock_gettime_mono(&ts2);
-       timediff = nsec_time_diff(&ts2,&state->ts1)*1.0e-9;
+       timediff = state->vfs_aio_state.duration * 1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fsp("pwrite", timediff, state->fsp);
+               smb_time_audit_log_fsp("async pwrite", timediff, state->fsp);
        }
 
-       if (tevent_req_is_unix_error(req, err)) {
+       if (tevent_req_is_unix_error(req, &vfs_aio_state->error)) {
                return -1;
        }
-       *err = state->err;
+       *vfs_aio_state = state->vfs_aio_state;
        return state->ret;
 }
 
@@ -874,9 +958,8 @@ static int smb_time_audit_fsync(vfs_handle_struct *handle, files_struct *fsp)
 
 struct smb_time_audit_fsync_state {
        struct files_struct *fsp;
-       struct timespec ts1;
        int ret;
-       int err;
+       struct vfs_aio_state vfs_aio_state;
 };
 
 static void smb_time_audit_fsync_done(struct tevent_req *subreq);
@@ -893,7 +976,6 @@ static struct tevent_req *smb_time_audit_fsync_send(
        if (req == NULL) {
                return NULL;
        }
-       clock_gettime_mono(&state->ts1);
        state->fsp = fsp;
 
        subreq = SMB_VFS_NEXT_FSYNC_SEND(state, ev, handle, fsp);
@@ -911,29 +993,28 @@ static void smb_time_audit_fsync_done(struct tevent_req *subreq)
        struct smb_time_audit_fsync_state *state = tevent_req_data(
                req, struct smb_time_audit_fsync_state);
 
-       state->ret = SMB_VFS_FSYNC_RECV(subreq, &state->err);
+       state->ret = SMB_VFS_FSYNC_RECV(subreq, &state->vfs_aio_state);
        TALLOC_FREE(subreq);
        tevent_req_done(req);
 }
 
-static int smb_time_audit_fsync_recv(struct tevent_req *req, int *err)
+static int smb_time_audit_fsync_recv(struct tevent_req *req,
+                                    struct vfs_aio_state *vfs_aio_state)
 {
        struct smb_time_audit_fsync_state *state = tevent_req_data(
                req, struct smb_time_audit_fsync_state);
-       struct timespec ts2;
        double timediff;
 
-       clock_gettime_mono(&ts2);
-       timediff = nsec_time_diff(&ts2,&state->ts1)*1.0e-9;
+       timediff = state->vfs_aio_state.duration * 1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fsp("fsync", timediff, state->fsp);
+               smb_time_audit_log_fsp("async fsync", timediff, state->fsp);
        }
 
-       if (tevent_req_is_unix_error(req, err)) {
+       if (tevent_req_is_unix_error(req, &vfs_aio_state->error)) {
                return -1;
        }
-       *err = state->err;
+       *vfs_aio_state = state->vfs_aio_state;
        return state->ret;
 }
 
@@ -1034,19 +1115,22 @@ static int smb_time_audit_unlink(vfs_handle_struct *handle,
 }
 
 static int smb_time_audit_chmod(vfs_handle_struct *handle,
-                               const char *path, mode_t mode)
+                       const struct smb_filename *smb_fname,
+                       mode_t mode)
 {
        int result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_CHMOD(handle, path, mode);
+       result = SMB_VFS_NEXT_CHMOD(handle, smb_fname, mode);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("chmod", timediff, path);
+               smb_time_audit_log_fname("chmod",
+                       timediff,
+                       smb_fname->base_name);
        }
 
        return result;
@@ -1072,19 +1156,23 @@ static int smb_time_audit_fchmod(vfs_handle_struct *handle, files_struct *fsp,
 }
 
 static int smb_time_audit_chown(vfs_handle_struct *handle,
-                               const char *path, uid_t uid, gid_t gid)
+                       const struct smb_filename *smb_fname,
+                       uid_t uid,
+                       gid_t gid)
 {
        int result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_CHOWN(handle, path, uid, gid);
+       result = SMB_VFS_NEXT_CHOWN(handle, smb_fname, uid, gid);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("chown", timediff, path);
+               smb_time_audit_log_fname("chown",
+                       timediff,
+                       smb_fname->base_name);
        }
 
        return result;
@@ -1110,50 +1198,58 @@ static int smb_time_audit_fchown(vfs_handle_struct *handle, files_struct *fsp,
 }
 
 static int smb_time_audit_lchown(vfs_handle_struct *handle,
-                                const char *path, uid_t uid, gid_t gid)
+                       const struct smb_filename *smb_fname,
+                       uid_t uid,
+                       gid_t gid)
 {
        int result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_LCHOWN(handle, path, uid, gid);
+       result = SMB_VFS_NEXT_LCHOWN(handle, smb_fname, uid, gid);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("lchown", timediff, path);
+               smb_time_audit_log_fname("lchown",
+                       timediff,
+                       smb_fname->base_name);
        }
 
        return result;
 }
 
-static int smb_time_audit_chdir(vfs_handle_struct *handle, const char *path)
+static int smb_time_audit_chdir(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname)
 {
        int result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_CHDIR(handle, path);
+       result = SMB_VFS_NEXT_CHDIR(handle, smb_fname);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("chdir", timediff, path);
+               smb_time_audit_log_fname("chdir",
+                       timediff,
+                       smb_fname->base_name);
        }
 
        return result;
 }
 
-static char *smb_time_audit_getwd(vfs_handle_struct *handle)
+static struct smb_filename *smb_time_audit_getwd(vfs_handle_struct *handle,
+                                       TALLOC_CTX *mem_ctx)
 {
-       char *result;
+       struct smb_filename *result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_GETWD(handle);
+       result = SMB_VFS_NEXT_GETWD(handle, mem_ctx);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
@@ -1206,23 +1302,29 @@ static int smb_time_audit_ftruncate(vfs_handle_struct *handle,
 
 static int smb_time_audit_fallocate(vfs_handle_struct *handle,
                                    files_struct *fsp,
-                                   enum vfs_fallocate_mode mode,
+                                   uint32_t mode,
                                    off_t offset,
                                    off_t len)
 {
        int result;
+       int saved_errno = 0;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
        result = SMB_VFS_NEXT_FALLOCATE(handle, fsp, mode, offset, len);
+       if (result == -1) {
+               saved_errno = errno;
+       }
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
                smb_time_audit_log_fsp("fallocate", timediff, fsp);
        }
-
+       if (result == -1) {
+               errno = saved_errno;
+       }
        return result;
 }
 
@@ -1248,7 +1350,7 @@ static bool smb_time_audit_lock(vfs_handle_struct *handle, files_struct *fsp,
 
 static int smb_time_audit_kernel_flock(struct vfs_handle_struct *handle,
                                       struct files_struct *fsp,
-                                      uint32 share_mode, uint32 access_mask)
+                                      uint32_t share_mode, uint32_t access_mask)
 {
        int result;
        struct timespec ts1,ts2;
@@ -1310,64 +1412,73 @@ static bool smb_time_audit_getlock(vfs_handle_struct *handle,
 }
 
 static int smb_time_audit_symlink(vfs_handle_struct *handle,
-                                 const char *oldpath, const char *newpath)
+                               const char *link_contents,
+                               const struct smb_filename *new_smb_fname)
 {
        int result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_SYMLINK(handle, oldpath, newpath);
+       result = SMB_VFS_NEXT_SYMLINK(handle, link_contents, new_smb_fname);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("symlink", timediff, newpath);
+               smb_time_audit_log_fname("symlink", timediff,
+                       new_smb_fname->base_name);
        }
 
        return result;
 }
 
 static int smb_time_audit_readlink(vfs_handle_struct *handle,
-                         const char *path, char *buf, size_t bufsiz)
+                               const struct smb_filename *smb_fname,
+                               char *buf,
+                               size_t bufsiz)
 {
        int result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_READLINK(handle, path, buf, bufsiz);
+       result = SMB_VFS_NEXT_READLINK(handle, smb_fname,
+                               buf, bufsiz);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("readlink", timediff, path);
+               smb_time_audit_log_fname("readlink", timediff,
+                               smb_fname->base_name);
        }
 
        return result;
 }
 
 static int smb_time_audit_link(vfs_handle_struct *handle,
-                              const char *oldpath, const char *newpath)
+                               const struct smb_filename *old_smb_fname,
+                               const struct smb_filename *new_smb_fname)
 {
        int result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_LINK(handle, oldpath, newpath);
+       result = SMB_VFS_NEXT_LINK(handle, old_smb_fname, new_smb_fname);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("link", timediff, newpath);
+               smb_time_audit_log_fname("link", timediff,
+                       new_smb_fname->base_name);
        }
 
        return result;
 }
 
 static int smb_time_audit_mknod(vfs_handle_struct *handle,
-                               const char *pathname, mode_t mode,
+                               const struct smb_filename *smb_fname,
+                               mode_t mode,
                                SMB_DEV_T dev)
 {
        int result;
@@ -1375,78 +1486,53 @@ static int smb_time_audit_mknod(vfs_handle_struct *handle,
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_MKNOD(handle, pathname, mode, dev);
+       result = SMB_VFS_NEXT_MKNOD(handle, smb_fname, mode, dev);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("mknod", timediff, pathname);
+               smb_time_audit_log_smb_fname("mknod", timediff, smb_fname);
        }
 
        return result;
 }
 
-static char *smb_time_audit_realpath(vfs_handle_struct *handle,
-                                    const char *path)
+static struct smb_filename *smb_time_audit_realpath(vfs_handle_struct *handle,
+                               TALLOC_CTX *ctx,
+                               const struct smb_filename *smb_fname)
 {
-       char *result;
+       struct smb_filename *result_fname;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_REALPATH(handle, path);
+       result_fname = SMB_VFS_NEXT_REALPATH(handle, ctx, smb_fname);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("realpath", timediff, path);
+               smb_time_audit_log_fname("realpath", timediff,
+                               smb_fname->base_name);
        }
 
-       return result;
-}
-
-static NTSTATUS smb_time_audit_notify_watch(struct vfs_handle_struct *handle,
-                       struct sys_notify_context *ctx,
-                       const char *path,
-                       uint32_t *filter,
-                       uint32_t *subdir_filter,
-                       void (*callback)(struct sys_notify_context *ctx,
-                                       void *private_data,
-                                       struct notify_event *ev),
-                       void *private_data, void *handle_p)
-{
-       NTSTATUS result;
-       struct timespec ts1,ts2;
-       double timediff;
-
-       clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_NOTIFY_WATCH(handle, ctx, path,
-                                          filter, subdir_filter, callback,
-                                          private_data, handle_p);
-       clock_gettime_mono(&ts2);
-       timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
-
-       if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("notify_watch", timediff, path);
-       }
-
-       return result;
+       return result_fname;
 }
 
 static int smb_time_audit_chflags(vfs_handle_struct *handle,
-                                 const char *path, unsigned int flags)
+                               const struct smb_filename *smb_fname,
+                               unsigned int flags)
 {
        int result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_CHFLAGS(handle, path, flags);
+       result = SMB_VFS_NEXT_CHFLAGS(handle, smb_fname, flags);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("chflags", timediff, path);
+               smb_time_audit_log_smb_fname("chflags", timediff, smb_fname);
        }
 
        return result;
@@ -1476,7 +1562,7 @@ static struct file_id smb_time_audit_file_id_create(struct vfs_handle_struct *ha
 
 static NTSTATUS smb_time_audit_streaminfo(vfs_handle_struct *handle,
                                          struct files_struct *fsp,
-                                         const char *fname,
+                                         const struct smb_filename *smb_fname,
                                          TALLOC_CTX *mem_ctx,
                                          unsigned int *pnum_streams,
                                          struct stream_struct **pstreams)
@@ -1486,7 +1572,7 @@ static NTSTATUS smb_time_audit_streaminfo(vfs_handle_struct *handle,
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_STREAMINFO(handle, fsp, fname, mem_ctx,
+       result = SMB_VFS_NEXT_STREAMINFO(handle, fsp, smb_fname, mem_ctx,
                                         pnum_streams, pstreams);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
@@ -1522,19 +1608,20 @@ static int smb_time_audit_get_real_filename(struct vfs_handle_struct *handle,
 }
 
 static const char *smb_time_audit_connectpath(vfs_handle_struct *handle,
-                                             const char *fname)
+                                       const struct smb_filename *smb_fname)
 {
        const char *result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_CONNECTPATH(handle, fname);
+       result = SMB_VFS_NEXT_CONNECTPATH(handle, smb_fname);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("connectpath", timediff, fname);
+               smb_time_audit_log_fname("connectpath", timediff,
+                       smb_fname->base_name);
        }
 
        return result;
@@ -1543,8 +1630,7 @@ static const char *smb_time_audit_connectpath(vfs_handle_struct *handle,
 static NTSTATUS smb_time_audit_brl_lock_windows(struct vfs_handle_struct *handle,
                                                struct byte_range_lock *br_lck,
                                                struct lock_struct *plock,
-                                               bool blocking_lock,
-                                               struct blocking_lock_record *blr)
+                                               bool blocking_lock)
 {
        NTSTATUS result;
        struct timespec ts1,ts2;
@@ -1552,7 +1638,7 @@ static NTSTATUS smb_time_audit_brl_lock_windows(struct vfs_handle_struct *handle
 
        clock_gettime_mono(&ts1);
        result = SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle, br_lck, plock,
-                                              blocking_lock, blr);
+                                              blocking_lock);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
@@ -1589,15 +1675,14 @@ static bool smb_time_audit_brl_unlock_windows(struct vfs_handle_struct *handle,
 
 static bool smb_time_audit_brl_cancel_windows(struct vfs_handle_struct *handle,
                                              struct byte_range_lock *br_lck,
-                                             struct lock_struct *plock,
-                                             struct blocking_lock_record *blr)
+                                             struct lock_struct *plock)
 {
        bool result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_BRL_CANCEL_WINDOWS(handle, br_lck, plock, blr);
+       result = SMB_VFS_NEXT_BRL_CANCEL_WINDOWS(handle, br_lck, plock);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
@@ -1609,115 +1694,325 @@ static bool smb_time_audit_brl_cancel_windows(struct vfs_handle_struct *handle,
        return result;
 }
 
-static bool smb_time_audit_strict_lock(struct vfs_handle_struct *handle,
-                                      struct files_struct *fsp,
-                                      struct lock_struct *plock)
+static bool smb_time_audit_strict_lock_check(struct vfs_handle_struct *handle,
+                                            struct files_struct *fsp,
+                                            struct lock_struct *plock)
 {
        bool result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_STRICT_LOCK(handle, fsp, plock);
+       result = SMB_VFS_NEXT_STRICT_LOCK_CHECK(handle, fsp, plock);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fsp("strict_lock", timediff, fsp);
+               smb_time_audit_log_fsp("strict_lock_check", timediff, fsp);
        }
 
        return result;
 }
 
-static void smb_time_audit_strict_unlock(struct vfs_handle_struct *handle,
-                                        struct files_struct *fsp,
-                                        struct lock_struct *plock)
+static NTSTATUS smb_time_audit_translate_name(struct vfs_handle_struct *handle,
+                                             const char *name,
+                                             enum vfs_translate_direction direction,
+                                             TALLOC_CTX *mem_ctx,
+                                             char **mapped_name)
 {
+       NTSTATUS result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       SMB_VFS_NEXT_STRICT_UNLOCK(handle, fsp, plock);
+       result = SMB_VFS_NEXT_TRANSLATE_NAME(handle, name, direction, mem_ctx,
+                                            mapped_name);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fsp("strict_unlock", timediff, fsp);
+               smb_time_audit_log_fname("translate_name", timediff, name);
        }
+
+       return result;
 }
 
-static NTSTATUS smb_time_audit_translate_name(struct vfs_handle_struct *handle,
-                                             const char *name,
-                                             enum vfs_translate_direction direction,
-                                             TALLOC_CTX *mem_ctx,
-                                             char **mapped_name)
+static NTSTATUS smb_time_audit_fsctl(struct vfs_handle_struct *handle,
+                               struct files_struct *fsp,
+                               TALLOC_CTX *ctx,
+                               uint32_t function,
+                               uint16_t req_flags,
+                               const uint8_t *_in_data,
+                               uint32_t in_len,
+                               uint8_t **_out_data,
+                               uint32_t max_out_len,
+                               uint32_t *out_len)
 {
        NTSTATUS result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_TRANSLATE_NAME(handle, name, direction, mem_ctx,
-                                            mapped_name);
+       result = SMB_VFS_NEXT_FSCTL(handle,
+                               fsp,
+                               ctx,
+                               function,
+                               req_flags,
+                               _in_data,
+                               in_len,
+                               _out_data,
+                               max_out_len,
+                               out_len);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("translate_name", timediff, name);
+               smb_time_audit_log_fsp("fsctl", timediff, fsp);
+       }
+
+       return result;
+}
+
+static NTSTATUS smb_time_get_dos_attributes(struct vfs_handle_struct *handle,
+                                       struct smb_filename *smb_fname,
+                                       uint32_t *dosmode)
+{
+       NTSTATUS result;
+       struct timespec ts1,ts2;
+       double timediff;
+
+       clock_gettime_mono(&ts1);
+       result = SMB_VFS_NEXT_GET_DOS_ATTRIBUTES(handle,
+                               smb_fname,
+                               dosmode);
+       clock_gettime_mono(&ts2);
+       timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
+
+       if (timediff > audit_timeout) {
+               smb_time_audit_log_fname("get_dos_attributes",
+                               timediff,
+                               smb_fname->base_name);
+       }
+
+       return result;
+}
+
+static NTSTATUS smb_time_fget_dos_attributes(struct vfs_handle_struct *handle,
+                                       struct files_struct *fsp,
+                                       uint32_t *dosmode)
+{
+       NTSTATUS result;
+       struct timespec ts1,ts2;
+       double timediff;
+
+       clock_gettime_mono(&ts1);
+       result = SMB_VFS_NEXT_FGET_DOS_ATTRIBUTES(handle,
+                               fsp,
+                               dosmode);
+       clock_gettime_mono(&ts2);
+       timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
+
+       if (timediff > audit_timeout) {
+               smb_time_audit_log_fsp("fget_dos_attributes", timediff, fsp);
+       }
+
+       return result;
+}
+
+static NTSTATUS smb_time_set_dos_attributes(struct vfs_handle_struct *handle,
+                                       const struct smb_filename *smb_fname,
+                                       uint32_t dosmode)
+{
+       NTSTATUS result;
+       struct timespec ts1,ts2;
+       double timediff;
+
+       clock_gettime_mono(&ts1);
+       result = SMB_VFS_NEXT_SET_DOS_ATTRIBUTES(handle,
+                               smb_fname,
+                               dosmode);
+       clock_gettime_mono(&ts2);
+       timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
+
+       if (timediff > audit_timeout) {
+               smb_time_audit_log_fname("set_dos_attributes",
+                               timediff,
+                               smb_fname->base_name);
+       }
+
+       return result;
+}
+
+static NTSTATUS smb_time_fset_dos_attributes(struct vfs_handle_struct *handle,
+                                       struct files_struct *fsp,
+                                       uint32_t dosmode)
+{
+       NTSTATUS result;
+       struct timespec ts1,ts2;
+       double timediff;
+
+       clock_gettime_mono(&ts1);
+       result = SMB_VFS_NEXT_FSET_DOS_ATTRIBUTES(handle,
+                               fsp,
+                               dosmode);
+       clock_gettime_mono(&ts2);
+       timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
+
+       if (timediff > audit_timeout) {
+               smb_time_audit_log_fsp("fset_dos_attributes", timediff, fsp);
        }
 
        return result;
 }
 
-struct time_audit_cc_state {
+struct time_audit_offload_read_state {
+       struct vfs_handle_struct *handle;
+       struct timespec ts_send;
+       DATA_BLOB token_blob;
+};
+
+static void smb_time_audit_offload_read_done(struct tevent_req *subreq);
+
+static struct tevent_req *smb_time_audit_offload_read_send(
+       TALLOC_CTX *mem_ctx,
+       struct tevent_context *ev,
+       struct vfs_handle_struct *handle,
+       struct files_struct *fsp,
+       uint32_t fsctl,
+       uint32_t ttl,
+       off_t offset,
+       size_t to_copy)
+{
+       struct tevent_req *req = NULL;
+       struct tevent_req *subreq = NULL;
+       struct time_audit_offload_read_state *state = NULL;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct time_audit_offload_read_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->handle = handle;
+       clock_gettime_mono(&state->ts_send);
+
+       subreq = SMB_VFS_NEXT_OFFLOAD_READ_SEND(mem_ctx, ev,
+                                               handle, fsp,
+                                               fsctl, ttl,
+                                               offset, to_copy);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+
+       tevent_req_set_callback(subreq, smb_time_audit_offload_read_done, req);
+       return req;
+}
+
+static void smb_time_audit_offload_read_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct time_audit_offload_read_state *state = tevent_req_data(
+               req, struct time_audit_offload_read_state);
+       NTSTATUS status;
+
+       status = SMB_VFS_NEXT_OFFLOAD_READ_RECV(subreq,
+                                               state->handle,
+                                               state,
+                                               &state->token_blob);
+       TALLOC_FREE(subreq);
+       if (tevent_req_nterror(req, status)) {
+               return;
+       }
+       tevent_req_done(req);
+}
+
+static NTSTATUS smb_time_audit_offload_read_recv(
+       struct tevent_req *req,
+       struct vfs_handle_struct *handle,
+       TALLOC_CTX *mem_ctx,
+       DATA_BLOB *_token_blob)
+{
+       struct time_audit_offload_read_state *state = tevent_req_data(
+               req, struct time_audit_offload_read_state);
+       struct timespec ts_recv;
+       double timediff;
+       DATA_BLOB token_blob;
+       NTSTATUS status;
+
+       clock_gettime_mono(&ts_recv);
+       timediff = nsec_time_diff(&ts_recv, &state->ts_send) * 1.0e-9;
+       if (timediff > audit_timeout) {
+               smb_time_audit_log("offload_read", timediff);
+       }
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
+               return status;
+       }
+
+       token_blob = data_blob_talloc(mem_ctx,
+                                     state->token_blob.data,
+                                     state->token_blob.length);
+       if (token_blob.data == NULL) {
+               tevent_req_received(req);
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
+}
+
+struct time_audit_offload_write_state {
        struct timespec ts_send;
        struct vfs_handle_struct *handle;
        off_t copied;
 };
-static void smb_time_audit_copy_chunk_done(struct tevent_req *subreq);
+static void smb_time_audit_offload_write_done(struct tevent_req *subreq);
 
-static struct tevent_req *smb_time_audit_copy_chunk_send(struct vfs_handle_struct *handle,
+static struct tevent_req *smb_time_audit_offload_write_send(struct vfs_handle_struct *handle,
                                                         TALLOC_CTX *mem_ctx,
                                                         struct tevent_context *ev,
-                                                        struct files_struct *src_fsp,
-                                                        off_t src_off,
+                                                        uint32_t fsctl,
+                                                        DATA_BLOB *token,
+                                                        off_t transfer_offset,
                                                         struct files_struct *dest_fsp,
                                                         off_t dest_off,
                                                         off_t num)
 {
        struct tevent_req *req;
        struct tevent_req *subreq;
-       struct time_audit_cc_state *cc_state;
+       struct time_audit_offload_write_state *state;
 
-       req = tevent_req_create(mem_ctx, &cc_state, struct time_audit_cc_state);
+       req = tevent_req_create(mem_ctx, &state,
+                               struct time_audit_offload_write_state);
        if (req == NULL) {
                return NULL;
        }
 
-       cc_state->handle = handle;
-       clock_gettime_mono(&cc_state->ts_send);
-       subreq = SMB_VFS_NEXT_COPY_CHUNK_SEND(handle, cc_state, ev,
-                                             src_fsp, src_off,
+       state->handle = handle;
+       clock_gettime_mono(&state->ts_send);
+       subreq = SMB_VFS_NEXT_OFFLOAD_WRITE_SEND(handle, state, ev,
+                                             fsctl, token, transfer_offset,
                                              dest_fsp, dest_off, num);
        if (tevent_req_nomem(subreq, req)) {
                return tevent_req_post(req, ev);
        }
 
-       tevent_req_set_callback(subreq, smb_time_audit_copy_chunk_done, req);
+       tevent_req_set_callback(subreq, smb_time_audit_offload_write_done, req);
        return req;
 }
 
-static void smb_time_audit_copy_chunk_done(struct tevent_req *subreq)
+static void smb_time_audit_offload_write_done(struct tevent_req *subreq)
 {
        struct tevent_req *req = tevent_req_callback_data(
                subreq, struct tevent_req);
-       struct time_audit_cc_state *cc_state
-                       = tevent_req_data(req, struct time_audit_cc_state);
+       struct time_audit_offload_write_state *state = tevent_req_data(
+               req, struct time_audit_offload_write_state);
        NTSTATUS status;
 
-       status = SMB_VFS_NEXT_COPY_CHUNK_RECV(cc_state->handle,
+       status = SMB_VFS_NEXT_OFFLOAD_WRITE_RECV(state->handle,
                                              subreq,
-                                             &cc_state->copied);
+                                             &state->copied);
        TALLOC_FREE(subreq);
        if (tevent_req_nterror(req, status)) {
                return;
@@ -1725,23 +2020,23 @@ static void smb_time_audit_copy_chunk_done(struct tevent_req *subreq)
        tevent_req_done(req);
 }
 
-static NTSTATUS smb_time_audit_copy_chunk_recv(struct vfs_handle_struct *handle,
+static NTSTATUS smb_time_audit_offload_write_recv(struct vfs_handle_struct *handle,
                                               struct tevent_req *req,
                                               off_t *copied)
 {
-       struct time_audit_cc_state *cc_state
-                       = tevent_req_data(req, struct time_audit_cc_state);
+       struct time_audit_offload_write_state *state = tevent_req_data(
+               req, struct time_audit_offload_write_state);
        struct timespec ts_recv;
        double timediff;
        NTSTATUS status;
 
        clock_gettime_mono(&ts_recv);
-       timediff = nsec_time_diff(&ts_recv, &cc_state->ts_send)*1.0e-9;
+       timediff = nsec_time_diff(&ts_recv, &state->ts_send)*1.0e-9;
        if (timediff > audit_timeout) {
-               smb_time_audit_log("copy_chunk", timediff);
+               smb_time_audit_log("offload_write", timediff);
        }
 
-       *copied = cc_state->copied;
+       *copied = state->copied;
        if (tevent_req_is_nterror(req, &status)) {
                tevent_req_received(req);
                return status;
@@ -1751,9 +2046,81 @@ static NTSTATUS smb_time_audit_copy_chunk_recv(struct vfs_handle_struct *handle,
        return NT_STATUS_OK;
 }
 
+static NTSTATUS smb_time_audit_get_compression(vfs_handle_struct *handle,
+                                              TALLOC_CTX *mem_ctx,
+                                              struct files_struct *fsp,
+                                              struct smb_filename *smb_fname,
+                                              uint16_t *_compression_fmt)
+{
+       NTSTATUS result;
+       struct timespec ts1,ts2;
+       double timediff;
+
+       clock_gettime_mono(&ts1);
+       result = SMB_VFS_NEXT_GET_COMPRESSION(handle, mem_ctx, fsp, smb_fname,
+                                             _compression_fmt);
+       clock_gettime_mono(&ts2);
+       timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
+
+       if (timediff > audit_timeout) {
+               if (fsp !=  NULL) {
+                       smb_time_audit_log_fsp("get_compression",
+                                              timediff, fsp);
+               } else {
+                       smb_time_audit_log_smb_fname("get_compression",
+                                                    timediff, smb_fname);
+               }
+       }
+
+       return result;
+}
+
+static NTSTATUS smb_time_audit_set_compression(vfs_handle_struct *handle,
+                                              TALLOC_CTX *mem_ctx,
+                                              struct files_struct *fsp,
+                                              uint16_t compression_fmt)
+{
+       NTSTATUS result;
+       struct timespec ts1,ts2;
+       double timediff;
+
+       clock_gettime_mono(&ts1);
+       result = SMB_VFS_NEXT_SET_COMPRESSION(handle, mem_ctx, fsp,
+                                             compression_fmt);
+       clock_gettime_mono(&ts2);
+       timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
+
+       if (timediff > audit_timeout) {
+               smb_time_audit_log_fsp("set_compression", timediff, fsp);
+       }
+
+       return result;
+}
+
+static NTSTATUS smb_time_audit_readdir_attr(struct vfs_handle_struct *handle,
+                                           const struct smb_filename *fname,
+                                           TALLOC_CTX *mem_ctx,
+                                           struct readdir_attr_data **pattr_data)
+{
+       NTSTATUS status;
+       struct timespec ts1,ts2;
+       double timediff;
+
+       clock_gettime_mono(&ts1);
+       status = SMB_VFS_NEXT_READDIR_ATTR(handle, fname, mem_ctx, pattr_data);
+       clock_gettime_mono(&ts2);
+       timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
+
+       if (timediff > audit_timeout) {
+               smb_time_audit_log_smb_fname("readdir_attr", timediff, fname);
+       }
+
+       return status;
+}
+
 static NTSTATUS smb_time_audit_fget_nt_acl(vfs_handle_struct *handle,
                                           files_struct *fsp,
-                                          uint32 security_info,
+                                          uint32_t security_info,
                                           TALLOC_CTX *mem_ctx,
                                           struct security_descriptor **ppdesc)
 {
@@ -1775,8 +2142,8 @@ static NTSTATUS smb_time_audit_fget_nt_acl(vfs_handle_struct *handle,
 }
 
 static NTSTATUS smb_time_audit_get_nt_acl(vfs_handle_struct *handle,
-                                         const char *name,
-                                         uint32 security_info,
+                                         const struct smb_filename *smb_fname,
+                                         uint32_t security_info,
                                          TALLOC_CTX *mem_ctx,
                                          struct security_descriptor **ppdesc)
 {
@@ -1785,13 +2152,15 @@ static NTSTATUS smb_time_audit_get_nt_acl(vfs_handle_struct *handle,
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_GET_NT_ACL(handle, name, security_info,
+       result = SMB_VFS_NEXT_GET_NT_ACL(handle, smb_fname, security_info,
                                         mem_ctx, ppdesc);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("get_nt_acl", timediff, name);
+               smb_time_audit_log_fname("get_nt_acl",
+                       timediff,
+                       smb_fname->base_name);
        }
 
        return result;
@@ -1799,7 +2168,7 @@ static NTSTATUS smb_time_audit_get_nt_acl(vfs_handle_struct *handle,
 
 static NTSTATUS smb_time_audit_fset_nt_acl(vfs_handle_struct *handle,
                                           files_struct *fsp,
-                                          uint32 security_info_sent,
+                                          uint32_t security_info_sent,
                                           const struct security_descriptor *psd)
 {
        NTSTATUS result;
@@ -1819,20 +2188,53 @@ static NTSTATUS smb_time_audit_fset_nt_acl(vfs_handle_struct *handle,
        return result;
 }
 
+static NTSTATUS smb_time_audit_audit_file(struct vfs_handle_struct *handle,
+                               struct smb_filename *smb_fname,
+                               struct security_acl *sacl,
+                               uint32_t access_requested,
+                               uint32_t access_denied)
+{
+       NTSTATUS result;
+       struct timespec ts1,ts2;
+       double timediff;
+
+       clock_gettime_mono(&ts1);
+       result = SMB_VFS_NEXT_AUDIT_FILE(handle,
+                                       smb_fname,
+                                       sacl,
+                                       access_requested,
+                                       access_denied);
+       clock_gettime_mono(&ts2);
+       timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
+
+       if (timediff > audit_timeout) {
+               smb_time_audit_log_fname("audit_file",
+                       timediff,
+                       smb_fname->base_name);
+       }
+
+       return result;
+}
+
+
+
 static int smb_time_audit_chmod_acl(vfs_handle_struct *handle,
-                                   const char *path, mode_t mode)
+                       const struct smb_filename *smb_fname,
+                       mode_t mode)
 {
        int result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_CHMOD_ACL(handle, path, mode);
+       result = SMB_VFS_NEXT_CHMOD_ACL(handle, smb_fname, mode);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("chmod_acl", timediff, path);
+               smb_time_audit_log_fname("chmod_acl",
+                       timediff,
+                       smb_fname->base_name);
        }
 
        return result;
@@ -1858,21 +2260,23 @@ static int smb_time_audit_fchmod_acl(vfs_handle_struct *handle,
 }
 
 static SMB_ACL_T smb_time_audit_sys_acl_get_file(vfs_handle_struct *handle,
-                                                const char *path_p,
-                                                SMB_ACL_TYPE_T type,
-                                                TALLOC_CTX *mem_ctx)
+                                       const struct smb_filename *smb_fname,
+                                       SMB_ACL_TYPE_T type,
+                                       TALLOC_CTX *mem_ctx)
 {
        SMB_ACL_T result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, path_p, type, mem_ctx);
+       result = SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, smb_fname,
+                               type, mem_ctx);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("sys_acl_get_file", timediff, path_p);
+               smb_time_audit_log_fname("sys_acl_get_file", timediff,
+                       smb_fname->base_name);
        }
 
        return result;
@@ -1900,17 +2304,18 @@ static SMB_ACL_T smb_time_audit_sys_acl_get_fd(vfs_handle_struct *handle,
 
 
 static int smb_time_audit_sys_acl_blob_get_file(vfs_handle_struct *handle,
-                                               const char *path_p,
-                                               TALLOC_CTX *mem_ctx, 
-                                               char **blob_description,
-                                               DATA_BLOB *blob)
+                               const struct smb_filename *smb_fname,
+                               TALLOC_CTX *mem_ctx,
+                               char **blob_description,
+                               DATA_BLOB *blob)
 {
        int result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle, path_p, mem_ctx, blob_description, blob);
+       result = SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle, smb_fname,
+                               mem_ctx, blob_description, blob);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
@@ -1944,7 +2349,7 @@ static int smb_time_audit_sys_acl_blob_get_fd(vfs_handle_struct *handle,
 }
 
 static int smb_time_audit_sys_acl_set_file(vfs_handle_struct *handle,
-                                          const char *name,
+                                          const struct smb_filename *smb_fname,
                                           SMB_ACL_TYPE_T acltype,
                                           SMB_ACL_T theacl)
 {
@@ -1953,13 +2358,14 @@ static int smb_time_audit_sys_acl_set_file(vfs_handle_struct *handle,
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, acltype,
+       result = SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, smb_fname, acltype,
                                               theacl);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("sys_acl_set_file", timediff, name);
+               smb_time_audit_log_fname("sys_acl_set_file", timediff,
+                       smb_fname->base_name);
        }
 
        return result;
@@ -1986,39 +2392,43 @@ static int smb_time_audit_sys_acl_set_fd(vfs_handle_struct *handle,
 }
 
 static int smb_time_audit_sys_acl_delete_def_file(vfs_handle_struct *handle,
-                                                 const char *path)
+                               const struct smb_filename *smb_fname)
 {
        int result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, path);
+       result = SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, smb_fname);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("sys_acl_delete_def_file", timediff, path);
+               smb_time_audit_log_fname("sys_acl_delete_def_file", timediff,
+                       smb_fname->base_name);
        }
 
        return result;
 }
 
 static ssize_t smb_time_audit_getxattr(struct vfs_handle_struct *handle,
-                                      const char *path, const char *name,
-                                      void *value, size_t size)
+                               const struct smb_filename *smb_fname,
+                               const char *name,
+                               void *value,
+                               size_t size)
 {
        ssize_t result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_GETXATTR(handle, path, name, value, size);
+       result = SMB_VFS_NEXT_GETXATTR(handle, smb_fname, name, value, size);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("getxattr", timediff, path);
+               smb_time_audit_log_fname("getxattr", timediff,
+                       smb_fname->base_name);
        }
 
        return result;
@@ -2046,7 +2456,8 @@ static ssize_t smb_time_audit_fgetxattr(struct vfs_handle_struct *handle,
 }
 
 static ssize_t smb_time_audit_listxattr(struct vfs_handle_struct *handle,
-                                       const char *path, char *list,
+                                       const struct smb_filename *smb_fname,
+                                       char *list,
                                        size_t size)
 {
        ssize_t result;
@@ -2054,12 +2465,13 @@ static ssize_t smb_time_audit_listxattr(struct vfs_handle_struct *handle,
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_LISTXATTR(handle, path, list, size);
+       result = SMB_VFS_NEXT_LISTXATTR(handle, smb_fname, list, size);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("listxattr", timediff, path);
+               smb_time_audit_log_fname("listxattr", timediff,
+                               smb_fname->base_name);
        }
 
        return result;
@@ -2086,19 +2498,21 @@ static ssize_t smb_time_audit_flistxattr(struct vfs_handle_struct *handle,
 }
 
 static int smb_time_audit_removexattr(struct vfs_handle_struct *handle,
-                                     const char *path, const char *name)
+                               const struct smb_filename *smb_fname,
+                               const char *name)
 {
        int result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_REMOVEXATTR(handle, path, name);
+       result = SMB_VFS_NEXT_REMOVEXATTR(handle, smb_fname, name);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("removexattr", timediff, path);
+               smb_time_audit_log_fname("removexattr", timediff,
+                       smb_fname->base_name);
        }
 
        return result;
@@ -2125,22 +2539,25 @@ static int smb_time_audit_fremovexattr(struct vfs_handle_struct *handle,
 }
 
 static int smb_time_audit_setxattr(struct vfs_handle_struct *handle,
-                                  const char *path, const char *name,
-                                  const void *value, size_t size,
-                                  int flags)
+                               const struct smb_filename *smb_fname,
+                               const char *name,
+                               const void *value,
+                               size_t size,
+                               int flags)
 {
        int result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_SETXATTR(handle, path, name, value, size,
+       result = SMB_VFS_NEXT_SETXATTR(handle, smb_fname, name, value, size,
                                       flags);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("setxattr", timediff, path);
+               smb_time_audit_log_fname("setxattr", timediff,
+                               smb_fname->base_name);
        }
 
        return result;
@@ -2185,49 +2602,10 @@ static bool smb_time_audit_aio_force(struct vfs_handle_struct *handle,
        return result;
 }
 
-static bool smb_time_audit_is_offline(struct vfs_handle_struct *handle,
-                                     const struct smb_filename *fname,
-                                     SMB_STRUCT_STAT *sbuf)
-{
-       bool result;
-       struct timespec ts1,ts2;
-       double timediff;
-
-       clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_IS_OFFLINE(handle, fname, sbuf);
-       clock_gettime_mono(&ts2);
-       timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
-
-       if (timediff > audit_timeout) {
-               smb_time_audit_log_smb_fname("is_offline", timediff, fname);
-       }
-
-       return result;
-}
-
-static int smb_time_audit_set_offline(struct vfs_handle_struct *handle,
-                                     const struct smb_filename *fname)
-{
-       int result;
-       struct timespec ts1,ts2;
-       double timediff;
-
-       clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_SET_OFFLINE(handle, fname);
-       clock_gettime_mono(&ts2);
-       timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
-
-       if (timediff > audit_timeout) {
-               smb_time_audit_log_smb_fname("set_offline", timediff, fname);
-       }
-
-       return result;
-}
-
-NTSTATUS smb_time_audit_durable_cookie(struct vfs_handle_struct *handle,
-                                      struct files_struct *fsp,
-                                      TALLOC_CTX *mem_ctx,
-                                      DATA_BLOB *cookie)
+static NTSTATUS smb_time_audit_durable_cookie(struct vfs_handle_struct *handle,
+                                             struct files_struct *fsp,
+                                             TALLOC_CTX *mem_ctx,
+                                             DATA_BLOB *cookie)
 {
        NTSTATUS result;
        struct timespec ts1,ts2;
@@ -2245,11 +2623,11 @@ NTSTATUS smb_time_audit_durable_cookie(struct vfs_handle_struct *handle,
        return result;
 }
 
-NTSTATUS smb_time_audit_durable_disconnect(struct vfs_handle_struct *handle,
-                                          struct files_struct *fsp,
-                                          const DATA_BLOB old_cookie,
-                                          TALLOC_CTX *mem_ctx,
-                                          DATA_BLOB *new_cookie)
+static NTSTATUS smb_time_audit_durable_disconnect(struct vfs_handle_struct *handle,
+                                                 struct files_struct *fsp,
+                                                 const DATA_BLOB old_cookie,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 DATA_BLOB *new_cookie)
 {
        NTSTATUS result;
        struct timespec ts1,ts2;
@@ -2268,13 +2646,13 @@ NTSTATUS smb_time_audit_durable_disconnect(struct vfs_handle_struct *handle,
        return result;
 }
 
-NTSTATUS smb_time_audit_durable_reconnect(struct vfs_handle_struct *handle,
-                                         struct smb_request *smb1req,
-                                         struct smbXsrv_open *op,
-                                         const DATA_BLOB old_cookie,
-                                         TALLOC_CTX *mem_ctx,
-                                         struct files_struct **fsp,
-                                         DATA_BLOB *new_cookie)
+static NTSTATUS smb_time_audit_durable_reconnect(struct vfs_handle_struct *handle,
+                                                struct smb_request *smb1req,
+                                                struct smbXsrv_open *op,
+                                                const DATA_BLOB old_cookie,
+                                                TALLOC_CTX *mem_ctx,
+                                                struct files_struct **fsp,
+                                                DATA_BLOB *new_cookie)
 {
        NTSTATUS result;
        struct timespec ts1,ts2;
@@ -2304,6 +2682,7 @@ static struct vfs_fn_pointers vfs_time_audit_fns = {
        .get_shadow_copy_data_fn = smb_time_audit_get_shadow_copy_data,
        .statvfs_fn = smb_time_audit_statvfs,
        .fs_capabilities_fn = smb_time_audit_fs_capabilities,
+       .get_dfs_referrals_fn = smb_time_audit_get_dfs_referrals,
        .opendir_fn = smb_time_audit_opendir,
        .fdopendir_fn = smb_time_audit_fdopendir,
        .readdir_fn = smb_time_audit_readdir,
@@ -2313,7 +2692,6 @@ static struct vfs_fn_pointers vfs_time_audit_fns = {
        .mkdir_fn = smb_time_audit_mkdir,
        .rmdir_fn = smb_time_audit_rmdir,
        .closedir_fn = smb_time_audit_closedir,
-       .init_search_op_fn = smb_time_audit_init_search_op,
        .open_fn = smb_time_audit_open,
        .create_file_fn = smb_time_audit_create_file,
        .close_fn = smb_time_audit_close,
@@ -2356,23 +2734,34 @@ static struct vfs_fn_pointers vfs_time_audit_fns = {
        .link_fn = smb_time_audit_link,
        .mknod_fn = smb_time_audit_mknod,
        .realpath_fn = smb_time_audit_realpath,
-       .notify_watch_fn = smb_time_audit_notify_watch,
        .chflags_fn = smb_time_audit_chflags,
        .file_id_create_fn = smb_time_audit_file_id_create,
+       .offload_read_send_fn = smb_time_audit_offload_read_send,
+       .offload_read_recv_fn = smb_time_audit_offload_read_recv,
+       .offload_write_send_fn = smb_time_audit_offload_write_send,
+       .offload_write_recv_fn = smb_time_audit_offload_write_recv,
+       .get_compression_fn = smb_time_audit_get_compression,
+       .set_compression_fn = smb_time_audit_set_compression,
+       .snap_check_path_fn = smb_time_audit_snap_check_path,
+       .snap_create_fn = smb_time_audit_snap_create,
+       .snap_delete_fn = smb_time_audit_snap_delete,
        .streaminfo_fn = smb_time_audit_streaminfo,
        .get_real_filename_fn = smb_time_audit_get_real_filename,
        .connectpath_fn = smb_time_audit_connectpath,
        .brl_lock_windows_fn = smb_time_audit_brl_lock_windows,
        .brl_unlock_windows_fn = smb_time_audit_brl_unlock_windows,
        .brl_cancel_windows_fn = smb_time_audit_brl_cancel_windows,
-       .strict_lock_fn = smb_time_audit_strict_lock,
-       .strict_unlock_fn = smb_time_audit_strict_unlock,
+       .strict_lock_check_fn = smb_time_audit_strict_lock_check,
        .translate_name_fn = smb_time_audit_translate_name,
-       .copy_chunk_send_fn = smb_time_audit_copy_chunk_send,
-       .copy_chunk_recv_fn = smb_time_audit_copy_chunk_recv,
+       .fsctl_fn = smb_time_audit_fsctl,
+       .get_dos_attributes_fn = smb_time_get_dos_attributes,
+       .fget_dos_attributes_fn = smb_time_fget_dos_attributes,
+       .set_dos_attributes_fn = smb_time_set_dos_attributes,
+       .fset_dos_attributes_fn = smb_time_fset_dos_attributes,
        .fget_nt_acl_fn = smb_time_audit_fget_nt_acl,
        .get_nt_acl_fn = smb_time_audit_get_nt_acl,
        .fset_nt_acl_fn = smb_time_audit_fset_nt_acl,
+       .audit_file_fn = smb_time_audit_audit_file,
        .chmod_acl_fn = smb_time_audit_chmod_acl,
        .fchmod_acl_fn = smb_time_audit_fchmod_acl,
        .sys_acl_get_file_fn = smb_time_audit_sys_acl_get_file,
@@ -2391,17 +2780,18 @@ static struct vfs_fn_pointers vfs_time_audit_fns = {
        .setxattr_fn = smb_time_audit_setxattr,
        .fsetxattr_fn = smb_time_audit_fsetxattr,
        .aio_force_fn = smb_time_audit_aio_force,
-       .is_offline_fn = smb_time_audit_is_offline,
-       .set_offline_fn = smb_time_audit_set_offline,
        .durable_cookie_fn = smb_time_audit_durable_cookie,
        .durable_disconnect_fn = smb_time_audit_durable_disconnect,
        .durable_reconnect_fn = smb_time_audit_durable_reconnect,
+       .readdir_attr_fn = smb_time_audit_readdir_attr,
 };
 
 
-NTSTATUS vfs_time_audit_init(void);
-NTSTATUS vfs_time_audit_init(void)
+NTSTATUS vfs_time_audit_init(TALLOC_CTX *);
+NTSTATUS vfs_time_audit_init(TALLOC_CTX *ctx)
 {
+       smb_vfs_assert_all_fns(&vfs_time_audit_fns, "time_audit");
+
        audit_timeout = (double)lp_parm_int(-1, "time_audit", "timeout",
                                            10000) / 1000.0;
        return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "time_audit",