vfs_gpfs: Move call to load GPFS library
[samba.git] / 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);
 }