1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

vfs_btrfs: advertise per-file compression capability

Plumb into the get_fs_capabilities code path to advertise the
FILE_FILE_COMPRESSION attribute.

Also, document file compression support in the VFS btrfs man page.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
David Disseldorp 2013-11-18 14:54:34 +01:00 committed by Jeremy Allison
parent b24e42a702
commit 423230f473
2 changed files with 20 additions and 0 deletions

View File

@ -45,6 +45,11 @@
Doing so saves storage capacity and greatly reduces disk IO.
</para>
<para>
This module also exposes Btrfs per-file compression support to
SMB clients via the get/set compression fsctls.
</para>
<para>
This module is stackable.
</para>

View File

@ -30,6 +30,20 @@
#include "librpc/gen_ndr/ioctl.h"
#include "lib/util/tevent_ntstatus.h"
static uint32_t btrfs_fs_capabilities(struct vfs_handle_struct *handle,
enum timestamp_set_resolution *_ts_res)
{
uint32_t fs_capabilities;
enum timestamp_set_resolution ts_res;
/* inherit default capabilities, expose compression support */
fs_capabilities = SMB_VFS_NEXT_FS_CAPABILITIES(handle, &ts_res);
fs_capabilities |= FILE_FILE_COMPRESSION;
*_ts_res = ts_res;
return fs_capabilities;
}
struct btrfs_ioctl_clone_range_args {
int64_t src_fd;
uint64_t src_offset;
@ -301,6 +315,7 @@ err_out:
static struct vfs_fn_pointers btrfs_fns = {
.fs_capabilities_fn = btrfs_fs_capabilities,
.copy_chunk_send_fn = btrfs_copy_chunk_send,
.copy_chunk_recv_fn = btrfs_copy_chunk_recv,
.get_compression_fn = btrfs_get_compression,