From 3e85caa7937ad6b56022442283dc7326c3e05a70 Mon Sep 17 00:00:00 2001 From: zam Date: Tue, 2 Jun 2009 07:49:33 +0000 Subject: [PATCH] Branch b_release_1_8_1 b=19580 i=johann i=tappro convert lco_lock to a semaphore. --- lustre/include/lustre_lite.h | 6 +++--- lustre/llite/llite_lib.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lustre/include/lustre_lite.h b/lustre/include/lustre_lite.h index 6543cba..5c6c6d4 100644 --- a/lustre/include/lustre_lite.h +++ b/lustre/include/lustre_lite.h @@ -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 { diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index d56a998..88c2c1c 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -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; @@ -430,11 +430,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) { -- 1.8.3.1