diff options
author | David Disseldorp <ddiss@samba.org> | 2012-04-10 03:16:57 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2015-03-31 18:40:24 +0200 |
commit | 67ee428467e1f49bf8d0b819280329554ef5aee6 (patch) | |
tree | 0dae4ffb5748e74fa2413b19d9b43f5722a849c0 /examples | |
parent | 13fa1b8776d2280ba3d4dfc35e7134cd0aaee70f (diff) | |
download | samba-67ee428467e1f49bf8d0b819280329554ef5aee6.tar.gz |
vfs: add snapshot create/delete hooks
This change adds three new VFS hooks covering snapshot manipulation:
- snap_check_path
Check whether a path supports snapshots.
- snap_create
Request the creation of a snapshot of the provided path.
- snap_delete
Request the deletion of a snapshot.
These VFS call-outs will be used in future by Samba's File Server Remote
VSS Protocol (FSRVP) server.
MS-FSVRP states:
At any given time, Windows servers allow only one shadow copy set to
be going through the creation process.
Therefore, only provide synchronous hooks for now, which can be
converted to asynchronous _send/_recv functions when the corresponding
DCE/RPC server infrastructure is in place.
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/VFS/skel_opaque.c | 30 | ||||
-rw-r--r-- | examples/VFS/skel_transparent.c | 32 |
2 files changed, 62 insertions, 0 deletions
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index b6b1aefe5b0..a9cbabf8057 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -102,6 +102,33 @@ static DIR *skel_opendir(vfs_handle_struct *handle, const char *fname, return NULL; } +static NTSTATUS skel_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 skel_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 skel_snap_delete(struct vfs_handle_struct *handle, + TALLOC_CTX *mem_ctx, + char *base_path, + char *snap_path) +{ + return NT_STATUS_NOT_SUPPORTED; +} + static DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32 attr) { @@ -830,6 +857,9 @@ struct vfs_fn_pointers skel_opaque_fns = { .statvfs_fn = skel_statvfs, .fs_capabilities_fn = skel_fs_capabilities, .get_dfs_referrals_fn = skel_get_dfs_referrals, + .snap_check_path_fn = skel_snap_check_path, + .snap_create_fn = skel_snap_create, + .snap_delete_fn = skel_snap_delete, /* Directory operations */ diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index f7ed537025e..651eb2f840d 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -100,6 +100,35 @@ static DIR *skel_opendir(vfs_handle_struct *handle, const char *fname, return SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr); } +static NTSTATUS skel_snap_check_path(struct vfs_handle_struct *handle, + TALLOC_CTX *mem_ctx, + const char *service_path, + char **base_volume) +{ + return SMB_VFS_NEXT_SNAP_CHECK_PATH(handle, mem_ctx, service_path, + base_volume); +} + +static NTSTATUS skel_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 SMB_VFS_NEXT_SNAP_CREATE(handle, mem_ctx, base_volume, tstamp, + rw, base_path, snap_path); +} + +static NTSTATUS skel_snap_delete(struct vfs_handle_struct *handle, + TALLOC_CTX *mem_ctx, + char *base_path, + char *snap_path) +{ + return SMB_VFS_NEXT_SNAP_DELETE(handle, mem_ctx, base_path, snap_path); +} + static DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32 attr) { @@ -939,6 +968,9 @@ struct vfs_fn_pointers skel_transparent_fns = { .statvfs_fn = skel_statvfs, .fs_capabilities_fn = skel_fs_capabilities, .get_dfs_referrals_fn = skel_get_dfs_referrals, + .snap_check_path_fn = skel_snap_check_path, + .snap_create_fn = skel_snap_create, + .snap_delete_fn = skel_snap_delete, /* Directory operations */ |