From b8378ecb80fa0c4052e5452a61c17cc68255a446 Mon Sep 17 00:00:00 2001 From: adilger Date: Tue, 21 Mar 2006 12:13:35 +0000 Subject: [PATCH] Branch b1_5 Don't divide obd_timeout before converting it to HZ. [from compat change] Don't depend on LASSERT to perform an operation as a side effect. [existing] --- lustre/ldlm/ldlm_lockd.c | 15 +++++++++------ lustre/llite/super.c | 13 ++++++++----- lustre/llite/super25.c | 19 ++++++++++++------- lustre/lvfs/fsfilt_ext3.c | 5 ++++- lustre/obdclass/genops.c | 10 ++++++---- lustre/quota/quota_context.c | 2 +- lustre/quota/quota_interface.c | 2 +- lustre/quota/quota_master.c | 2 +- 8 files changed, 42 insertions(+), 26 deletions(-) diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index f23f530..42ccef5 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -277,7 +277,8 @@ static int ldlm_add_waiting_lock(struct ldlm_lock *lock) return 0; } - lock->l_callback_timeout = cfs_time_shift(obd_timeout / 2); + lock->l_callback_timeout =cfs_time_add(cfs_time_current(), + cfs_time_seconds(obd_timeout)/2); timeout_rounded = round_timeout(lock->l_callback_timeout); @@ -1682,12 +1683,14 @@ int __init ldlm_init(void) void __exit ldlm_exit(void) { - if ( ldlm_refcount ) + int rc; + + if (ldlm_refcount) CERROR("ldlm_refcount is %d in ldlm_exit!\n", ldlm_refcount); - LASSERTF(cfs_mem_cache_destroy(ldlm_resource_slab) == 0, - "couldn't free ldlm resource slab\n"); - LASSERTF(cfs_mem_cache_destroy(ldlm_lock_slab) == 0, - "couldn't free ldlm lock slab\n"); + rc = cfs_mem_cache_destroy(ldlm_resource_slab); + LASSERTF(rc == 0, "couldn't free ldlm resource slab\n"); + rc = cfs_mem_cache_destroy(ldlm_lock_slab); + LASSERTF(rc == 0, "couldn't free ldlm lock slab\n"); } /* ldlm_extent.c */ diff --git a/lustre/llite/super.c b/lustre/llite/super.c index 610c215..e2f60fb 100644 --- a/lustre/llite/super.c +++ b/lustre/llite/super.c @@ -124,16 +124,19 @@ static int __init init_lustre_lite(void) static void __exit exit_lustre_lite(void) { + int rc; + unregister_filesystem(&lustre_lite_fs_type); unregister_filesystem(&lustre_fs_type); ll_unregister_cache(&ll_cache_definition); - LASSERTF(kmem_cache_destroy(ll_file_data_slab) == 0, - "couldn't destroy ll_file_data slab\n"); - if (ll_async_page_slab) - LASSERTF(kmem_cache_destroy(ll_async_page_slab) == 0, - "couldn't destroy ll_async_page slab\n"); + rc = kmem_cache_destroy(ll_file_data_slab); + LASSERTF(rc == 0, "couldn't destroy ll_file_data slab\n"); + if (ll_async_page_slab) { + rc = kmem_cache_destroy(ll_async_page_slab); + LASSERTF(rc == 0, "couldn't destroy ll_async_page slab\n"); + } if (proc_lustre_fs_root) { lprocfs_remove(proc_lustre_fs_root); diff --git a/lustre/llite/super25.c b/lustre/llite/super25.c index e2b9bb0..1e02b8ac 100644 --- a/lustre/llite/super25.c +++ b/lustre/llite/super25.c @@ -93,8 +93,10 @@ int ll_init_inodecache(void) void ll_destroy_inodecache(void) { - LASSERTF(kmem_cache_destroy(ll_inode_cachep) == 0, - "ll_inode_cache: not all structures were freed\n"); + int rc; + + rc = kmem_cache_destroy(ll_inode_cachep); + LASSERTF(rc == 0, "ll_inode_cache: not all structures were freed\n"); } /* exported operations */ @@ -164,17 +166,20 @@ static int __init init_lustre_lite(void) static void __exit exit_lustre_lite(void) { + int rc; + unregister_filesystem(&lustre_fs_type); unregister_filesystem(&lustre_lite_fs_type); ll_unregister_cache(&ll_cache_definition); ll_destroy_inodecache(); - LASSERTF(kmem_cache_destroy(ll_file_data_slab) == 0, - "couldn't destroy ll_file_data slab\n"); - if (ll_async_page_slab) - LASSERTF(kmem_cache_destroy(ll_async_page_slab) == 0, - "couldn't destroy ll_async_page slab\n"); + rc = kmem_cache_destroy(ll_file_data_slab): + LASSERTF(rc == 0, "couldn't destroy ll_file_data slab\n"); + if (ll_async_page_slab) { + rc = kmem_cache_destroy(ll_async_page_slab); + LASSERTF(rc == 0, "couldn't destroy ll_async_page slab\n"); + } if (proc_lustre_fs_root) { lprocfs_remove(proc_lustre_fs_root); diff --git a/lustre/lvfs/fsfilt_ext3.c b/lustre/lvfs/fsfilt_ext3.c index 869accf..c144cb1 100644 --- a/lustre/lvfs/fsfilt_ext3.c +++ b/lustre/lvfs/fsfilt_ext3.c @@ -1981,8 +1981,11 @@ out: static void __exit fsfilt_ext3_exit(void) { + int rc; + fsfilt_unregister_ops(&fsfilt_ext3_ops); - LASSERT(kmem_cache_destroy(fcb_cache) == 0); + rc = kmem_cache_destroy(fcb_cache); + LASSERTF(rc == 0, "couldn't destroy fcb_cache slab\n"); } module_init(fsfilt_ext3_init); diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index c261dc3..0141aaa 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -353,15 +353,17 @@ struct obd_device * class_devices_in_group(struct obd_uuid *grp_uuid, int *next) void obd_cleanup_caches(void) { + int rc; + ENTRY; if (obdo_cachep) { - LASSERTF(cfs_mem_cache_destroy(obdo_cachep) == 0, - "Cannot destory ll_obdo_cache\n"); + rc = cfs_mem_cache_destroy(obdo_cachep); + LASSERTF(rc == 0, "Cannot destory ll_obdo_cache\n"); obdo_cachep = NULL; } if (import_cachep) { - LASSERTF(cfs_mem_cache_destroy(import_cachep) == 0, - "Cannot destory ll_import_cache\n"); + rc = cfs_mem_cache_destroy(import_cachep); + LASSERTF(rc == 0, "Cannot destory ll_import_cache\n"); import_cachep = NULL; } EXIT; diff --git a/lustre/quota/quota_context.c b/lustre/quota/quota_context.c index 20bbb04..8d8a4c5 100644 --- a/lustre/quota/quota_context.c +++ b/lustre/quota/quota_context.c @@ -62,7 +62,7 @@ void qunit_cache_cleanup(void) if (qunit_cachep) { int rc; rc = kmem_cache_destroy(qunit_cachep); - LASSERT(rc == 0); + LASSERTF(rc == 0, "couldn't destory qunit_cache slab\n"); qunit_cachep = NULL; } EXIT; diff --git a/lustre/quota/quota_interface.c b/lustre/quota/quota_interface.c index 4b3d5f3f..92f39b3 100644 --- a/lustre/quota/quota_interface.c +++ b/lustre/quota/quota_interface.c @@ -602,7 +602,7 @@ int osc_quota_exit(void) spin_unlock(&qinfo_list_lock); rc = cfs_mem_cache_destroy(qinfo_cachep); - LASSERT(rc == 0); + LASSERTF(rc == 0, "couldn't destory qinfo_cachep slab\n"); RETURN(0); } diff --git a/lustre/quota/quota_master.c b/lustre/quota/quota_master.c index ed6606a..4d50dc3 100644 --- a/lustre/quota/quota_master.c +++ b/lustre/quota/quota_master.c @@ -71,7 +71,7 @@ void lustre_dquot_exit(void) if (lustre_dquot_cachep) { int rc; rc = kmem_cache_destroy(lustre_dquot_cachep); - LASSERT(rc == 0); + LASSERTF(rc == 0,"couldn't destroy lustre_dquot_cachep slab\n"); lustre_dquot_cachep = NULL; } EXIT; -- 1.8.3.1