]> Pileus Git - ~andy/linux/blobdiff - drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml
[~andy/linux] / drivers / staging / lustre / lustre / ptlrpc / ptlrpcd.c
index 89c9be96f454a57c4dd0839cf92f378883dce91e..2d26fd543d46a0c10811c1fee57fafe657b078a7 100644 (file)
@@ -77,12 +77,12 @@ struct ptlrpcd {
 };
 
 static int max_ptlrpcds;
-CFS_MODULE_PARM(max_ptlrpcds, "i", int, 0644,
-               "Max ptlrpcd thread count to be started.");
+module_param(max_ptlrpcds, int, 0644);
+MODULE_PARM_DESC(max_ptlrpcds, "Max ptlrpcd thread count to be started.");
 
 static int ptlrpcd_bind_policy = PDB_POLICY_PAIR;
-CFS_MODULE_PARM(ptlrpcd_bind_policy, "i", int, 0644,
-               "Ptlrpcd threads binding mode.");
+module_param(ptlrpcd_bind_policy, int, 0644);
+MODULE_PARM_DESC(ptlrpcd_bind_policy, "Ptlrpcd threads binding mode.");
 static struct ptlrpcd *ptlrpcds;
 
 struct mutex ptlrpcd_mutex;
@@ -600,7 +600,6 @@ static int ptlrpcd_bind(int index, int max)
 int ptlrpcd_start(int index, int max, const char *name, struct ptlrpcd_ctl *pc)
 {
        int rc;
-       int env = 0;
 
        /*
         * Do not allow start second thread for one pc.
@@ -619,6 +618,7 @@ int ptlrpcd_start(int index, int max, const char *name, struct ptlrpcd_ctl *pc)
        pc->pc_set = ptlrpc_prep_set();
        if (pc->pc_set == NULL)
                GOTO(out, rc = -ENOMEM);
+
        /*
         * So far only "client" ptlrpcd uses an environment. In the future,
         * ptlrpcd thread (or a thread-set) has to be given an argument,
@@ -626,40 +626,40 @@ int ptlrpcd_start(int index, int max, const char *name, struct ptlrpcd_ctl *pc)
         */
        rc = lu_context_init(&pc->pc_env.le_ctx, LCT_CL_THREAD|LCT_REMEMBER);
        if (rc != 0)
-               GOTO(out, rc);
+               GOTO(out_set, rc);
 
-       env = 1;
        {
                struct task_struct *task;
-
                if (index >= 0) {
                        rc = ptlrpcd_bind(index, max);
                        if (rc < 0)
-                               GOTO(out, rc);
+                               GOTO(out_env, rc);
                }
 
                task = kthread_run(ptlrpcd, pc, "%s", pc->pc_name);
                if (IS_ERR(task))
-                       GOTO(out, rc = PTR_ERR(task));
+                       GOTO(out_env, rc = PTR_ERR(task));
 
-               rc = 0;
                wait_for_completion(&pc->pc_starting);
        }
-out:
-       if (rc) {
-               if (pc->pc_set != NULL) {
-                       struct ptlrpc_request_set *set = pc->pc_set;
-
-                       spin_lock(&pc->pc_lock);
-                       pc->pc_set = NULL;
-                       spin_unlock(&pc->pc_lock);
-                       ptlrpc_set_destroy(set);
-               }
-               if (env != 0)
-                       lu_context_fini(&pc->pc_env.le_ctx);
-               clear_bit(LIOD_BIND, &pc->pc_flags);
-               clear_bit(LIOD_START, &pc->pc_flags);
+       return 0;
+
+out_env:
+       lu_context_fini(&pc->pc_env.le_ctx);
+
+out_set:
+       if (pc->pc_set != NULL) {
+               struct ptlrpc_request_set *set = pc->pc_set;
+
+               spin_lock(&pc->pc_lock);
+               pc->pc_set = NULL;
+               spin_unlock(&pc->pc_lock);
+               ptlrpc_set_destroy(set);
        }
+       clear_bit(LIOD_BIND, &pc->pc_flags);
+
+out:
+       clear_bit(LIOD_START, &pc->pc_flags);
        return rc;
 }