]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_gpfs: Move call to load GPFS library
authorChristof Schmitt <cs@samba.org>
Wed, 31 May 2023 18:29:49 +0000 (11:29 -0700)
committerStefan Metzmacher <metze@samba.org>
Sun, 25 Jun 2023 16:06:37 +0000 (16:06 +0000)
Load the GPFS library from the connect function and leave the module
init for only the module registration.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sun Jun 25 16:06:37 UTC 2023 on atb-devel-224

source3/modules/vfs_gpfs.c

index c4402146bccc9d5c7af0b2465c8e4683e97d429e..3398879c900c290a317d9476f195c732915db8f9 100644 (file)
@@ -2041,6 +2041,12 @@ static int vfs_gpfs_connect(struct vfs_handle_struct *handle,
                return 0;
        }
 
+       ret = gpfswrap_init();
+       if (ret < 0) {
+               DBG_ERR("Could not load GPFS library.\n");
+               return ret;
+       }
+
        ret = gpfswrap_lib_init(0);
        if (ret < 0) {
                DBG_ERR("Could not open GPFS device file: %s\n",
@@ -2616,13 +2622,6 @@ static struct vfs_fn_pointers vfs_gpfs_fns = {
 static_decl_vfs;
 NTSTATUS vfs_gpfs_init(TALLOC_CTX *ctx)
 {
-       int ret;
-
-       ret = gpfswrap_init();
-       if (ret != 0) {
-               DEBUG(1, ("Could not initialize GPFS library wrapper\n"));
-       }
-
        return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "gpfs",
                                &vfs_gpfs_fns);
 }