staging: lustre: mgc: remove ccflags from Makefile
[firefly-linux-kernel-4.4.55.git] / drivers / staging / lustre / lustre / mgc / mgc_request.c
index de9fb1433eddf7ea7d02e3d33256dd45f2cf18f5..54ea5fd12de044937314c05d9000808be158ba1d 100644 (file)
 #define D_MGC D_CONFIG /*|D_WARNING*/
 
 #include <linux/module.h>
-#include <obd_class.h>
-#include <lustre_dlm.h>
-#include <lprocfs_status.h>
-#include <lustre_log.h>
-#include <lustre_disk.h>
-#include <dt_object.h>
+#include "../include/obd_class.h"
+#include "../include/lustre_dlm.h"
+#include "../include/lprocfs_status.h"
+#include "../include/lustre_log.h"
+#include "../include/lustre_disk.h"
+#include "../include/dt_object.h"
 
 #include "mgc_internal.h"
 
@@ -672,8 +672,8 @@ static int mgc_fs_setup(struct obd_device *obd, struct super_block *sb)
        if (env == NULL)
                return -ENOMEM;
 
-       /* The mgc fs exclusion sem. Only one fs can be setup at a time. */
-       down(&cli->cl_mgc_sem);
+       /* The mgc fs exclusion mutex. Only one fs can be setup at a time. */
+       mutex_lock(&cli->cl_mgc_mutex);
 
        cfs_cleanup_group_info();
 
@@ -727,7 +727,7 @@ out_los:
        if (rc < 0) {
                local_oid_storage_fini(env, cli->cl_mgc_los);
                cli->cl_mgc_los = NULL;
-               up(&cli->cl_mgc_sem);
+               mutex_unlock(&cli->cl_mgc_mutex);
        }
 out_env:
        lu_env_fini(env);
@@ -759,7 +759,7 @@ static int mgc_fs_cleanup(struct obd_device *obd)
 
 unlock:
        class_decref(obd, "mgc_fs", obd);
-       up(&cli->cl_mgc_sem);
+       mutex_unlock(&cli->cl_mgc_mutex);
 
        return 0;
 }
@@ -950,7 +950,10 @@ static int mgc_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
 }
 
 /* Not sure where this should go... */
-#define  MGC_ENQUEUE_LIMIT 50
+/* This is the timeout value for MGS_CONNECT request plus a ping interval, such
+ * that we can have a chance to try the secondary MGS if any. */
+#define  MGC_ENQUEUE_LIMIT (INITIAL_CONNECT_TIMEOUT + (AT_OFF ? 0 : at_min) \
+                               + PING_INTERVAL)
 #define  MGC_TARGET_REG_LIMIT 10
 #define  MGC_SEND_PARAM_LIMIT 10