VFS: Modify chown to take a const struct smb_filename * instead of const char *
[kai/samba-autobuild/.git] / source3 / modules / vfs_default.c
index 1e1c318a8934c6986fe85d7db989f673edaa86e8..604ee4519b71bead7e9552b8bbfb3276f1288586 100644 (file)
@@ -32,7 +32,7 @@
 #include "lib/util/tevent_unix.h"
 #include "lib/asys/asys.h"
 #include "lib/util/tevent_ntstatus.h"
-#include "lib/sys_rw.h"
+#include "lib/util/sys_rw.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_VFS
@@ -54,22 +54,27 @@ static void vfswrap_disconnect(vfs_handle_struct *handle)
 
 /* Disk operations */
 
-static uint64_t vfswrap_disk_free(vfs_handle_struct *handle, const char *path, bool small_query, uint64_t *bsize,
-                              uint64_t *dfree, uint64_t *dsize)
+static uint64_t vfswrap_disk_free(vfs_handle_struct *handle, const char *path,
+                                 uint64_t *bsize, uint64_t *dfree,
+                                 uint64_t *dsize)
 {
-       uint64_t result;
+       if (sys_fsusage(path, dfree, dsize) != 0) {
+               return (uint64_t)-1;
+       }
 
-       result = sys_disk_free(handle->conn, path, small_query, bsize, dfree, dsize);
-       return result;
+       *bsize = 512;
+       return *dfree / 2;
 }
 
-static int vfswrap_get_quota(struct vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt)
+static int vfswrap_get_quota(struct vfs_handle_struct *handle, const char *path,
+                            enum SMB_QUOTA_TYPE qtype, unid_t id,
+                            SMB_DISK_QUOTA *qt)
 {
 #ifdef HAVE_SYS_QUOTAS
        int result;
 
        START_PROFILE(syscall_get_quota);
-       result = sys_get_quota(handle->conn->connectpath, qtype, id, qt);
+       result = sys_get_quota(path, qtype, id, qt);
        END_PROFILE(syscall_get_quota);
        return result;
 #else
@@ -223,8 +228,7 @@ static NTSTATUS vfswrap_get_dfs_referrals(struct vfs_handle_struct *handle,
                pathnamep[consumedcnt] = '\0';
 
                if (DEBUGLVL(3)) {
-                       dbgtext("setup_dfs_referral: Path %s to "
-                               "alternate path(s):",
+                       dbgtext("Path %s to alternate path(s):",
                                pathnamep);
                        for (i=0; i < junction->referral_count; i++) {
                                dbgtext(" %s",
@@ -330,8 +334,7 @@ static NTSTATUS vfswrap_get_dfs_referrals(struct vfs_handle_struct *handle,
                }
                break;
        default:
-               DEBUG(0,("setup_dfs_referral: Invalid dfs referral "
-                       "version: %d\n",
+               DEBUG(0,("Invalid dfs referral version: %d\n",
                        max_referral_level));
                return NT_STATUS_INVALID_LEVEL;
        }
@@ -343,14 +346,44 @@ static NTSTATUS vfswrap_get_dfs_referrals(struct vfs_handle_struct *handle,
        return NT_STATUS_OK;
 }
 
+static NTSTATUS vfswrap_snap_check_path(struct vfs_handle_struct *handle,
+                                       TALLOC_CTX *mem_ctx,
+                                       const char *service_path,
+                                       char **base_volume)
+{
+       return NT_STATUS_NOT_SUPPORTED;
+}
+
+static NTSTATUS vfswrap_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)
+{
+       return NT_STATUS_NOT_SUPPORTED;
+}
+
+static NTSTATUS vfswrap_snap_delete(struct vfs_handle_struct *handle,
+                                   TALLOC_CTX *mem_ctx,
+                                   char *base_path,
+                                   char *snap_path)
+{
+       return NT_STATUS_NOT_SUPPORTED;
+}
+
 /* Directory operations */
 
-static DIR *vfswrap_opendir(vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr)
+static DIR *vfswrap_opendir(vfs_handle_struct *handle,
+                               const struct smb_filename *smb_fname,
+                               const char *mask,
+                               uint32_t attr)
 {
        DIR *result;
 
        START_PROFILE(syscall_opendir);
-       result = opendir(fname);
+       result = opendir(smb_fname->base_name);
        END_PROFILE(syscall_opendir);
        return result;
 }
@@ -358,7 +391,7 @@ static DIR *vfswrap_opendir(vfs_handle_struct *handle, const char *fname, const
 static DIR *vfswrap_fdopendir(vfs_handle_struct *handle,
                        files_struct *fsp,
                        const char *mask,
-                       uint32 attr)
+                       uint32_t attr)
 {
        DIR *result;
 
@@ -435,18 +468,22 @@ static void vfswrap_rewinddir(vfs_handle_struct *handle, DIR *dirp)
        END_PROFILE(syscall_rewinddir);
 }
 
-static int vfswrap_mkdir(vfs_handle_struct *handle, const char *path, mode_t mode)
+static int vfswrap_mkdir(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname,
+                       mode_t mode)
 {
        int result;
        bool has_dacl = False;
+       const char *path = smb_fname->base_name;
        char *parent = NULL;
 
        START_PROFILE(syscall_mkdir);
 
        if (lp_inherit_acls(SNUM(handle->conn))
            && parent_dirname(talloc_tos(), path, &parent, NULL)
-           && (has_dacl = directory_has_default_acl(handle->conn, parent)))
+           && (has_dacl = directory_has_default_acl(handle->conn, parent))) {
                mode = (0777 & lp_directory_mask(SNUM(handle->conn)));
+       }
 
        TALLOC_FREE(parent);
 
@@ -461,20 +498,23 @@ static int vfswrap_mkdir(vfs_handle_struct *handle, const char *path, mode_t mod
                 * mess up any inherited ACL bits that were set. JRA.
                 */
                int saved_errno = errno; /* We may get ENOSYS */
-               if ((SMB_VFS_CHMOD_ACL(handle->conn, path, mode) == -1) && (errno == ENOSYS))
+               if ((SMB_VFS_CHMOD_ACL(handle->conn, smb_fname, mode) == -1) &&
+                               (errno == ENOSYS)) {
                        errno = saved_errno;
+               }
        }
 
        END_PROFILE(syscall_mkdir);
        return result;
 }
 
-static int vfswrap_rmdir(vfs_handle_struct *handle, const char *path)
+static int vfswrap_rmdir(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname)
 {
        int result;
 
        START_PROFILE(syscall_rmdir);
-       result = rmdir(path);
+       result = rmdir(smb_fname->base_name);
        END_PROFILE(syscall_rmdir);
        return result;
 }
@@ -664,40 +704,50 @@ static void vfswrap_asys_finished(struct tevent_context *ev,
 
 static bool vfswrap_init_asys_ctx(struct smbd_server_connection *conn)
 {
+       struct asys_context *ctx;
+       struct tevent_fd *fde;
        int ret;
        int fd;
 
        if (conn->asys_ctx != NULL) {
                return true;
        }
-       ret = asys_context_init(&conn->asys_ctx, aio_pending_size);
+
+       ret = asys_context_init(&ctx, lp_aio_max_threads());
        if (ret != 0) {
                DEBUG(1, ("asys_context_init failed: %s\n", strerror(ret)));
                return false;
        }
 
-       fd = asys_signalfd(conn->asys_ctx);
+       fd = asys_signalfd(ctx);
 
-       set_blocking(fd, false);
+       ret = set_blocking(fd, false);
+       if (ret != 0) {
+               DBG_WARNING("set_blocking failed: %s\n", strerror(errno));
+               goto fail;
+       }
 
-       conn->asys_fde = tevent_add_fd(conn->ev_ctx, conn, fd,
-                                      TEVENT_FD_READ,
-                                      vfswrap_asys_finished,
-                                      conn->asys_ctx);
-       if (conn->asys_fde == NULL) {
+       fde = tevent_add_fd(conn->ev_ctx, conn, fd, TEVENT_FD_READ,
+                           vfswrap_asys_finished, ctx);
+       if (fde == NULL) {
                DEBUG(1, ("tevent_add_fd failed\n"));
-               asys_context_destroy(conn->asys_ctx);
-               conn->asys_ctx = NULL;
-               return false;
+               goto fail;
        }
+
+       conn->asys_ctx = ctx;
+       conn->asys_fde = fde;
        return true;
+
+fail:
+       asys_context_destroy(ctx);
+       return false;
 }
 
 struct vfswrap_asys_state {
        struct asys_context *asys_ctx;
        struct tevent_req *req;
        ssize_t ret;
-       int err;
+       struct vfs_aio_state vfs_aio_state;
        SMBPROFILE_BASIC_ASYNC_STATE(profile_basic);
        SMBPROFILE_BYTES_ASYNC_STATE(profile_bytes);
 };
@@ -813,14 +863,14 @@ static void vfswrap_asys_finished(struct tevent_context *ev,
                                        uint16_t flags, void *p)
 {
        struct asys_context *asys_ctx = (struct asys_context *)p;
-       struct asys_result results[outstanding_aio_calls];
+       struct asys_result results[get_outstanding_aio_calls()];
        int i, ret;
 
        if ((flags & TEVENT_FD_READ) == 0) {
                return;
        }
 
-       ret = asys_results(asys_ctx, results, outstanding_aio_calls);
+       ret = asys_results(asys_ctx, results, get_outstanding_aio_calls());
        if (ret < 0) {
                DEBUG(1, ("asys_results returned %s\n", strerror(-ret)));
                return;
@@ -844,33 +894,36 @@ static void vfswrap_asys_finished(struct tevent_context *ev,
                SMBPROFILE_BASIC_ASYNC_END(state->profile_basic);
                SMBPROFILE_BYTES_ASYNC_END(state->profile_bytes);
                state->ret = result->ret;
-               state->err = result->err;
+               state->vfs_aio_state.error = result->err;
+               state->vfs_aio_state.duration = result->duration;
                tevent_req_defer_callback(req, ev);
                tevent_req_done(req);
        }
 }
 
-static ssize_t vfswrap_asys_ssize_t_recv(struct tevent_req *req, int *err)
+static ssize_t vfswrap_asys_ssize_t_recv(struct tevent_req *req,
+                                        struct vfs_aio_state *vfs_aio_state)
 {
        struct vfswrap_asys_state *state = tevent_req_data(
                req, struct vfswrap_asys_state);
 
-       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;
 }
 
-static int vfswrap_asys_int_recv(struct tevent_req *req, int *err)
+static int vfswrap_asys_int_recv(struct tevent_req *req,
+                                struct vfs_aio_state *vfs_aio_state)
 {
        struct vfswrap_asys_state *state = tevent_req_data(
                req, struct vfswrap_asys_state);
 
-       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;
 }
 
@@ -1115,8 +1168,8 @@ static NTSTATUS vfswrap_fsctl(struct vfs_handle_struct *handle,
                 */
                struct shadow_copy_data *shadow_data = NULL;
                bool labels = False;
-               uint32 labels_data_count = 0;
-               uint32 i;
+               uint32_t labels_data_count = 0;
+               uint32_t i;
                char *cur_pdata = NULL;
 
                if (max_out_len < 16) {
@@ -1244,7 +1297,7 @@ static NTSTATUS vfswrap_fsctl(struct vfs_handle_struct *handle,
                /* unknown 4 bytes: this is not the length of the sid :-(  */
                /*unknown = IVAL(pdata,0);*/
 
-               if (!sid_parse(in_data + 4, sid_len, &sid)) {
+               if (!sid_parse(_in_data + 4, sid_len, &sid)) {
                        return NT_STATUS_INVALID_PARAMETER;
                }
                DEBUGADD(10, ("for SID: %s\n", sid_string_dbg(&sid)));
@@ -1369,7 +1422,7 @@ static NTSTATUS vfswrap_fsctl(struct vfs_handle_struct *handle,
 
 struct vfs_cc_state {
        off_t copied;
-       uint8_t buf[65536];
+       uint8_t *buf;
 };
 
 static struct tevent_req *vfswrap_copy_chunk_send(struct vfs_handle_struct *handle,
@@ -1393,6 +1446,12 @@ static struct tevent_req *vfswrap_copy_chunk_send(struct vfs_handle_struct *hand
                return NULL;
        }
 
+       vfs_cc_state->buf = talloc_array(vfs_cc_state, uint8_t,
+                                        MIN(num, 8*1024*1024));
+       if (tevent_req_nomem(vfs_cc_state->buf, req)) {
+               return tevent_req_post(req, ev);
+       }
+
        status = vfs_stat_fsp(src_fsp);
        if (tevent_req_nterror(req, status)) {
                return tevent_req_post(req, ev);
@@ -1418,7 +1477,7 @@ static struct tevent_req *vfswrap_copy_chunk_send(struct vfs_handle_struct *hand
                struct lock_struct lck;
                int saved_errno;
 
-               off_t this_num = MIN(sizeof(vfs_cc_state->buf),
+               off_t this_num = MIN(talloc_array_length(vfs_cc_state->buf),
                                     num - vfs_cc_state->copied);
 
                if (src_fsp->op == NULL) {
@@ -1619,7 +1678,9 @@ static int vfswrap_unlink(vfs_handle_struct *handle,
        return result;
 }
 
-static int vfswrap_chmod(vfs_handle_struct *handle, const char *path, mode_t mode)
+static int vfswrap_chmod(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname,
+                       mode_t mode)
 {
        int result;
 
@@ -1634,7 +1695,10 @@ static int vfswrap_chmod(vfs_handle_struct *handle, const char *path, mode_t mod
 
        {
                int saved_errno = errno; /* We might get ENOSYS */
-               if ((result = SMB_VFS_CHMOD_ACL(handle->conn, path, mode)) == 0) {
+               result = SMB_VFS_CHMOD_ACL(handle->conn,
+                               smb_fname,
+                               mode);
+               if (result == 0) {
                        END_PROFILE(syscall_chmod);
                        return result;
                }
@@ -1642,7 +1706,7 @@ static int vfswrap_chmod(vfs_handle_struct *handle, const char *path, mode_t mod
                errno = saved_errno;
        }
 
-       result = chmod(path, mode);
+       result = chmod(smb_fname->base_name, mode);
        END_PROFILE(syscall_chmod);
        return result;
 }
@@ -1680,12 +1744,15 @@ static int vfswrap_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t m
        return result;
 }
 
-static int vfswrap_chown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid)
+static int vfswrap_chown(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname,
+                       uid_t uid,
+                       gid_t gid)
 {
        int result;
 
        START_PROFILE(syscall_chown);
-       result = chown(path, uid, gid);
+       result = chown(smb_fname->base_name, uid, gid);
        END_PROFILE(syscall_chown);
        return result;
 }
@@ -1862,22 +1929,20 @@ static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fs
           emulation is being done by the libc (like on AIX with JFS1). In that
           case we do our own emulation. fallocate implementations can
           return ENOTSUP or EINVAL in cases like that. */
-       ret = SMB_VFS_FALLOCATE(fsp, VFS_FALLOCATE_EXTEND_SIZE,
-                               pst->st_ex_size, space_to_write);
-       if (ret == ENOSPC) {
-               errno = ENOSPC;
+       ret = SMB_VFS_FALLOCATE(fsp, 0, pst->st_ex_size, space_to_write);
+       if (ret == -1 && errno == ENOSPC) {
                return -1;
        }
        if (ret == 0) {
                return 0;
        }
        DEBUG(10,("strict_allocate_ftruncate: SMB_VFS_FALLOCATE failed with "
-               "error %d. Falling back to slow manual allocation\n", ret));
+               "error %d. Falling back to slow manual allocation\n", errno));
 
        /* available disk space is enough or not? */
        space_avail = get_dfree_info(fsp->conn,
-                                    fsp->fsp_name->base_name, false,
-                                    &bsize,&dfree,&dsize);
+                                    fsp->fsp_name->base_name,
+                                    &bsize, &dfree, &dsize);
        /* space_avail is 1k blocks */
        if (space_avail == (uint64_t)-1 ||
                        ((uint64_t)space_to_write/1024 > space_avail) ) {
@@ -1888,8 +1953,7 @@ static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fs
        /* Write out the real space on disk. */
        ret = vfs_slow_fallocate(fsp, pst->st_ex_size, space_to_write);
        if (ret != 0) {
-               errno = ret;
-               ret = -1;
+               return -1;
        }
 
        return 0;
@@ -1917,8 +1981,6 @@ static int vfswrap_ftruncate(vfs_handle_struct *handle, files_struct *fsp, off_t
           ftruncate extend but ext2 can. */
 
        result = ftruncate(fsp->fh->fd, len);
-       if (result == 0)
-               goto done;
 
        /* According to W. R. Stevens advanced UNIX prog. Pure 4.3 BSD cannot
           extend a file with ftruncate. Provide alternate implementation
@@ -1932,6 +1994,12 @@ static int vfswrap_ftruncate(vfs_handle_struct *handle, files_struct *fsp, off_t
        if (!NT_STATUS_IS_OK(status)) {
                goto done;
        }
+
+       /* We need to update the files_struct after successful ftruncate */
+       if (result == 0) {
+               goto done;
+       }
+
        pst = &fsp->fsp_name->st;
 
 #ifdef S_ISFIFO
@@ -1965,20 +2033,27 @@ static int vfswrap_ftruncate(vfs_handle_struct *handle, files_struct *fsp, off_t
 
 static int vfswrap_fallocate(vfs_handle_struct *handle,
                        files_struct *fsp,
-                       enum vfs_fallocate_mode mode,
+                       uint32_t mode,
                        off_t offset,
                        off_t len)
 {
        int result;
 
        START_PROFILE(syscall_fallocate);
-       if (mode == VFS_FALLOCATE_EXTEND_SIZE) {
+       if (mode == 0) {
                result = sys_posix_fallocate(fsp->fh->fd, offset, len);
-       } else if (mode == VFS_FALLOCATE_KEEP_SIZE) {
-               result = sys_fallocate(fsp->fh->fd, mode, offset, len);
+               /*
+                * posix_fallocate returns 0 on success, errno on error
+                * and doesn't set errno. Make it behave like fallocate()
+                * which returns -1, and sets errno on failure.
+                */
+               if (result != 0) {
+                       errno = result;
+                       result = -1;
+               }
        } else {
-               errno = EINVAL;
-               result = -1;
+               /* sys_fallocate handles filtering of unsupported mode flags */
+               result = sys_fallocate(fsp->fh->fd, mode, offset, len);
        }
        END_PROFILE(syscall_fallocate);
        return result;
@@ -1995,7 +2070,7 @@ static bool vfswrap_lock(vfs_handle_struct *handle, files_struct *fsp, int op, o
 }
 
 static int vfswrap_kernel_flock(vfs_handle_struct *handle, files_struct *fsp,
-                               uint32 share_mode, uint32 access_mask)
+                               uint32_t share_mode, uint32_t access_mask)
 {
        START_PROFILE(syscall_kernel_flock);
        kernel_flock(fsp->fh->fd, share_mode, access_mask);
@@ -2074,54 +2149,11 @@ static char *vfswrap_realpath(vfs_handle_struct *handle, const char *path)
        char *result;
 
        START_PROFILE(syscall_realpath);
-#ifdef REALPATH_TAKES_NULL
-       result = realpath(path, NULL);
-#else
-       result = SMB_MALLOC_ARRAY(char, PATH_MAX+1);
-       if (result) {
-               char *resolved_path = realpath(path, result);
-               if (!resolved_path) {
-                       SAFE_FREE(result);
-               } else {
-                       /* SMB_ASSERT(result == resolved_path) ? */
-                       result = resolved_path;
-               }
-       }
-#endif
+       result = sys_realpath(path);
        END_PROFILE(syscall_realpath);
        return result;
 }
 
-static NTSTATUS vfswrap_notify_watch(vfs_handle_struct *vfs_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)
-{
-       /*
-        * So far inotify is the only supported default notify mechanism. If
-        * another platform like the the BSD's or a proprietary Unix comes
-        * along and wants another default, we can play the same trick we
-        * played with Posix ACLs.
-        *
-        * Until that is the case, hard-code inotify here.
-        */
-#ifdef HAVE_INOTIFY
-       if (lp_kernel_change_notify(vfs_handle->conn->params)) {
-               return inotify_watch(ctx, path, filter, subdir_filter,
-                                    callback, private_data, handle);
-       }
-#endif
-       /*
-        * Do nothing, leave everything to notify_internal.c
-        */
-       return NT_STATUS_OK;
-}
-
 static int vfswrap_chflags(vfs_handle_struct *handle, const char *path,
                           unsigned int flags)
 {
@@ -2285,7 +2317,7 @@ static void vfswrap_strict_unlock(struct vfs_handle_struct *handle,
 
 static NTSTATUS vfswrap_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)
 {
@@ -2299,21 +2331,24 @@ static NTSTATUS vfswrap_fget_nt_acl(vfs_handle_struct *handle,
 }
 
 static NTSTATUS vfswrap_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)
 {
        NTSTATUS result;
 
        START_PROFILE(get_nt_acl);
-       result = posix_get_nt_acl(handle->conn, name, security_info,
-                                 mem_ctx, ppdesc);
+       result = posix_get_nt_acl(handle->conn,
+                               smb_fname->base_name,
+                               security_info,
+                               mem_ctx,
+                               ppdesc);
        END_PROFILE(get_nt_acl);
        return result;
 }
 
-static NTSTATUS vfswrap_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint32 security_info_sent, const struct security_descriptor *psd)
+static NTSTATUS vfswrap_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint32_t security_info_sent, const struct security_descriptor *psd)
 {
        NTSTATUS result;
 
@@ -2332,7 +2367,9 @@ static NTSTATUS vfswrap_audit_file(struct vfs_handle_struct *handle,
        return NT_STATUS_OK; /* Nothing to do here ... */
 }
 
-static int vfswrap_chmod_acl(vfs_handle_struct *handle, const char *name, mode_t mode)
+static int vfswrap_chmod_acl(vfs_handle_struct *handle,
+                               const struct smb_filename *smb_fname,
+                               mode_t mode)
 {
 #ifdef HAVE_NO_ACL
        errno = ENOSYS;
@@ -2341,7 +2378,7 @@ static int vfswrap_chmod_acl(vfs_handle_struct *handle, const char *name, mode_t
        int result;
 
        START_PROFILE(chmod_acl);
-       result = chmod_acl(handle->conn, name, mode);
+       result = chmod_acl(handle->conn, smb_fname->base_name, mode);
        END_PROFILE(chmod_acl);
        return result;
 #endif
@@ -2526,6 +2563,9 @@ static struct vfs_fn_pointers vfs_default_fns = {
        .statvfs_fn = vfswrap_statvfs,
        .fs_capabilities_fn = vfswrap_fs_capabilities,
        .get_dfs_referrals_fn = vfswrap_get_dfs_referrals,
+       .snap_check_path_fn = vfswrap_snap_check_path,
+       .snap_create_fn = vfswrap_snap_create,
+       .snap_delete_fn = vfswrap_snap_delete,
 
        /* Directory operations */
 
@@ -2585,7 +2625,6 @@ static struct vfs_fn_pointers vfs_default_fns = {
        .link_fn = vfswrap_link,
        .mknod_fn = vfswrap_mknod,
        .realpath_fn = vfswrap_realpath,
-       .notify_watch_fn = vfswrap_notify_watch,
        .chflags_fn = vfswrap_chflags,
        .file_id_create_fn = vfswrap_file_id_create,
        .streaminfo_fn = vfswrap_streaminfo,