Merge remote-tracking branch 'staging/staging-next'
[deliverable/linux.git] / drivers / staging / lustre / lustre / mdc / lproc_mdc.c
index 98d15fb247bc48748d3391aa2b0da8dba696a1a2..fca9450de57c2a8db61520b463374d621aab3633 100644 (file)
@@ -43,11 +43,10 @@ static ssize_t max_rpcs_in_flight_show(struct kobject *kobj,
        int len;
        struct obd_device *dev = container_of(kobj, struct obd_device,
                                              obd_kobj);
-       struct client_obd *cli = &dev->u.cli;
+       __u32 max;
 
-       spin_lock(&cli->cl_loi_list_lock);
-       len = sprintf(buf, "%u\n", cli->cl_max_rpcs_in_flight);
-       spin_unlock(&cli->cl_loi_list_lock);
+       max = obd_get_max_rpcs_in_flight(&dev->u.cli);
+       len = sprintf(buf, "%u\n", max);
 
        return len;
 }
@@ -59,7 +58,6 @@ static ssize_t max_rpcs_in_flight_store(struct kobject *kobj,
 {
        struct obd_device *dev = container_of(kobj, struct obd_device,
                                              obd_kobj);
-       struct client_obd *cli = &dev->u.cli;
        int rc;
        unsigned long val;
 
@@ -67,12 +65,9 @@ static ssize_t max_rpcs_in_flight_store(struct kobject *kobj,
        if (rc)
                return rc;
 
-       if (val < 1 || val > MDC_MAX_RIF_MAX)
-               return -ERANGE;
-
-       spin_lock(&cli->cl_loi_list_lock);
-       cli->cl_max_rpcs_in_flight = val;
-       spin_unlock(&cli->cl_loi_list_lock);
+       rc = obd_set_max_rpcs_in_flight(&dev->u.cli, val);
+       if (rc)
+               count = rc;
 
        return count;
 }
This page took 0.027336 seconds and 5 git commands to generate.