1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

vfs_ceph_new: Introduce new parametric option 'proxy'

Provide early support for consuming yet to come libcephfs proxy[1] for
optimized resource utilization. For better control we make use of an
additional module specific option 'proxy' to specify the intent to load
proxy library. With the default value 'no' a regular cephfs connection
is established. There is also an 'auto' mode which can fall back to the
regular connection if proxy requirements are not met.

[1] https://github.com/ceph/ceph/pull/58376

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15703

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
This commit is contained in:
Guenther Deschner 2024-09-05 13:13:38 +05:30 committed by Anoop C S
parent f1d418181d
commit 90464bdcaf

View File

@ -78,12 +78,34 @@ static ssize_t lstatus_code(intmax_t ret)
return (ssize_t)ret;
}
enum vfs_cephfs_proxy_mode {
VFS_CEPHFS_PROXY_NO = 0,
VFS_CEPHFS_PROXY_YES,
VFS_CEPHFS_PROXY_AUTO
};
static const struct enum_list enum_vfs_cephfs_proxy_vals[] = {
{VFS_CEPHFS_PROXY_NO, "No"},
{VFS_CEPHFS_PROXY_NO, "False"},
{VFS_CEPHFS_PROXY_NO, "0"},
{VFS_CEPHFS_PROXY_NO, "Off"},
{VFS_CEPHFS_PROXY_NO, "disable"},
{VFS_CEPHFS_PROXY_YES, "Yes"},
{VFS_CEPHFS_PROXY_YES, "True"},
{VFS_CEPHFS_PROXY_YES, "1"},
{VFS_CEPHFS_PROXY_YES, "On"},
{VFS_CEPHFS_PROXY_YES, "enable"},
{VFS_CEPHFS_PROXY_AUTO, "auto"},
{-1, NULL}
};
struct vfs_ceph_config {
const char *conf_file;
const char *user_id;
const char *fsname;
struct cephmount_cached *mount_entry;
struct ceph_mount_info *mount;
enum vfs_cephfs_proxy_mode proxy;
};
/*
@ -275,6 +297,13 @@ static bool vfs_ceph_load_config(struct vfs_handle_struct *handle,
"user_id", "");
config_tmp->fsname = lp_parm_const_string(snum, module_name,
"filesystem", "");
config_tmp->proxy = lp_parm_enum(snum, module_name, "proxy",
enum_vfs_cephfs_proxy_vals,
VFS_CEPHFS_PROXY_NO);
if (config_tmp->proxy == -1) {
DBG_ERR("value for proxy: mode unknown\n");
return false;
}
SMB_VFS_HANDLE_SET_DATA(handle, config_tmp, NULL,
struct vfs_ceph_config, return false);