Whamcloud - gitweb
Branch b1_8
authorzam <zam>
Tue, 2 Jun 2009 08:08:20 +0000 (08:08 +0000)
committerzam <zam>
Tue, 2 Jun 2009 08:08:20 +0000 (08:08 +0000)
b=19580
i=johann
i=tappro

convert lco_lock to a semaphore.

lustre/include/lustre_lite.h
lustre/llite/llite_lib.c

index 6543cba..5c6c6d4 100644 (file)
@@ -129,7 +129,7 @@ struct lustre_client_ocd {
          * under ->lco_lock.
          */
         __u64      lco_flags;
-        spinlock_t lco_lock;
+        struct semaphore   lco_lock;
         struct obd_export *lco_mdc_exp;
         struct obd_export *lco_osc_exp;
 };
@@ -158,12 +158,12 @@ static inline int ll_ocd_update(struct obd_device *host,
                 flags = cli->cl_import->imp_connect_data.ocd_connect_flags;
                 CDEBUG(D_SUPER, "Changing connect_flags: "LPX64" -> "LPX64"\n",
                        lco->lco_flags, flags);
-                spin_lock(&lco->lco_lock);
+                mutex_down(&lco->lco_lock);
                 lco->lco_flags &= flags;
                 /* for each osc event update ea size */
                 if (lco->lco_osc_exp)
                         mdc_init_ea_size(lco->lco_mdc_exp, lco->lco_osc_exp);
-                spin_unlock(&lco->lco_lock);
+                mutex_up(&lco->lco_lock);
 
                 result = 0;
         } else {
index c0a377a..66b2461 100644 (file)
@@ -144,7 +144,7 @@ static struct ll_sb_info *ll_init_sbi(void)
                 GOTO(out, 0);
 
         spin_lock_init(&sbi->ll_lock);
-        spin_lock_init(&sbi->ll_lco.lco_lock);
+        init_mutex(&sbi->ll_lco.lco_lock);
         spin_lock_init(&sbi->ll_pp_extent_lock);
         spin_lock_init(&sbi->ll_process_lock);
         sbi->ll_rw_stats_on = 0;
@@ -431,11 +431,11 @@ static int client_common_fill_super(struct super_block *sb,
                 GOTO(out_cb, err);
         }
 
-        spin_lock(&sbi->ll_lco.lco_lock);
+        mutex_down(&sbi->ll_lco.lco_lock);
         sbi->ll_lco.lco_flags = data->ocd_connect_flags;
         sbi->ll_lco.lco_mdc_exp = sbi->ll_mdc_exp;
         sbi->ll_lco.lco_osc_exp = sbi->ll_osc_exp;
-        spin_unlock(&sbi->ll_lco.lco_lock);
+        mutex_up(&sbi->ll_lco.lco_lock);
 
         err = mdc_init_ea_size(sbi->ll_mdc_exp, sbi->ll_osc_exp);
         if (err) {