Whamcloud - gitweb
Branch b1_5
authoradilger <adilger>
Tue, 21 Mar 2006 12:13:35 +0000 (12:13 +0000)
committeradilger <adilger>
Tue, 21 Mar 2006 12:13:35 +0000 (12:13 +0000)
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
lustre/llite/super.c
lustre/llite/super25.c
lustre/lvfs/fsfilt_ext3.c
lustre/obdclass/genops.c
lustre/quota/quota_context.c
lustre/quota/quota_interface.c
lustre/quota/quota_master.c

index f23f530..42ccef5 100644 (file)
@@ -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 */
index 610c215..e2f60fb 100644 (file)
@@ -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);
index e2b9bb0..1e02b8a 100644 (file)
@@ -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);
index 869accf..c144cb1 100644 (file)
@@ -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);
index c261dc3..0141aaa 100644 (file)
@@ -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;
index 20bbb04..8d8a4c5 100644 (file)
@@ -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;
index 4b3d5f3..92f39b3 100644 (file)
@@ -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);
 }
 
index ed6606a..4d50dc3 100644 (file)
@@ -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;