]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
libcephfs_proxy: move function location
authorXavi Hernandez <xhernandez@gmail.com>
Tue, 13 Jan 2026 12:48:25 +0000 (13:48 +0100)
committerXavi Hernandez <xhernandez@gmail.com>
Tue, 10 Feb 2026 07:20:27 +0000 (08:20 +0100)
No changes, just relacation of some functions so that they can be used
from proxy_instance_config() in following commits.

Signed-off-by: Xavi Hernandez <xhernandez@gmail.com>
src/libcephfs_proxy/proxy_mount.c

index c4e40959fe6f212505c950df59102f1d3421a6eb..f7386c08bdccf6ceeb44d02c66b5512f6d5ae7cb 100644 (file)
@@ -850,42 +850,6 @@ static int32_t proxy_instance_release(proxy_instance_t *instance)
        return 0;
 }
 
-/* Assign a configuration file to the instance. */
-static int32_t proxy_instance_config(proxy_instance_t *instance,
-                                    const char *config)
-{
-       char path[strlen(instance->settings->work_dir) + strlen(config) + 80];
-       char *ppath;
-       int32_t err;
-
-       if (instance->mounted) {
-               return proxy_log(LOG_ERR, EISCONN,
-                                "Cannot configure a mounted instance");
-       }
-
-       ppath = NULL;
-       if (config != NULL) {
-               err = proxy_config_prepare(instance->settings, config, path,
-                                          sizeof(path));
-               if (err < 0) {
-                       return err;
-               }
-               ppath = path;
-       }
-
-       err = proxy_instance_change_add(instance, "conf", ppath, NULL);
-       if (err < 0) {
-               return err;
-       }
-
-       err = ceph_conf_read_file(instance->cmount, ppath);
-       if (err < 0) {
-               proxy_instance_change_del(instance);
-       }
-
-       return err;
-}
-
 static int32_t proxy_instance_option_get(proxy_instance_t *instance,
                                         const char *name, char *value,
                                         size_t size)
@@ -940,6 +904,42 @@ static int32_t proxy_instance_option_set(proxy_instance_t *instance,
        return err;
 }
 
+/* Assign a configuration file to the instance. */
+static int32_t proxy_instance_config(proxy_instance_t *instance,
+                                    const char *config)
+{
+       char path[strlen(instance->settings->work_dir) + strlen(config) + 80];
+       char *ppath;
+       int32_t err;
+
+       if (instance->mounted) {
+               return proxy_log(LOG_ERR, EISCONN,
+                                "Cannot configure a mounted instance");
+       }
+
+       ppath = NULL;
+       if (config != NULL) {
+               err = proxy_config_prepare(instance->settings, config, path,
+                                          sizeof(path));
+               if (err < 0) {
+                       return err;
+               }
+               ppath = path;
+       }
+
+       err = proxy_instance_change_add(instance, "conf", ppath, NULL);
+       if (err < 0) {
+               return err;
+       }
+
+       err = ceph_conf_read_file(instance->cmount, ppath);
+       if (err < 0) {
+               proxy_instance_change_del(instance);
+       }
+
+       return err;
+}
+
 static int32_t proxy_instance_select(proxy_instance_t *instance, const char *fs)
 {
        int32_t err;