[Ocfs2-commits] zab commits r2040 - in trunk/fs: ocfs2/cluster
usysfs
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Tue Mar 22 19:47:01 CST 2005
Author: zab
Signed-off-by: mfasheh
Date: 2005-03-22 19:46:59 -0600 (Tue, 22 Mar 2005)
New Revision: 2040
Modified:
trunk/fs/ocfs2/cluster/heartbeat.c
trunk/fs/usysfs/dir.c
Log:
o be sure to drop buffer_head references when tearing down hb regions
Signed-off-by: mfasheh
Modified: trunk/fs/ocfs2/cluster/heartbeat.c
===================================================================
--- trunk/fs/ocfs2/cluster/heartbeat.c 2005-03-23 01:31:33 UTC (rev 2039)
+++ trunk/fs/ocfs2/cluster/heartbeat.c 2005-03-23 01:46:59 UTC (rev 2040)
@@ -448,10 +448,20 @@
static void hb_region_release(struct kobject *kobj)
{
struct hb_region *reg = to_hb_region(kobj);
- printk("releasing reg %p\n", reg);
+ struct hb_disk_slot *slot;
+ int i;
+
+ /* with the thread down these bhs should be update/idle */
+ for(i = 0; reg->hr_slots && i < reg->hr_blocks; i++) {
+ slot = ®->hr_slots[i];
+ if (slot->ds_bh)
+ brelse(slot->ds_bh);
+ }
+
if (reg->hr_bdev)
blkdev_put(reg->hr_bdev);
+
kfree(reg->hr_slots); /* might be null if never activated */
kfree(reg);
}
@@ -480,7 +490,6 @@
/* XXX compare blocks against dev later on commit? */
reg->hr_block_bytes = tmp;
- /* XXX is this right? */
reg->hr_block_bits = ffs(reg->hr_block_bytes) - 1;
return count;
@@ -713,8 +722,6 @@
struct hb_region *reg = NULL;
struct kobject *ret = NULL;
- printk("trying to make a heartbeat object\n");
-
reg = kcalloc(1, sizeof(struct hb_region), GFP_KERNEL);
if (reg == NULL)
goto out; /* ENOMEM */
@@ -728,7 +735,6 @@
kobject_init(®->hr_kobj);
ret = ®->hr_kobj;
-
out:
if (ret == NULL)
kfree(reg);
@@ -741,8 +747,6 @@
{
struct hb_region *reg = to_hb_region(kobj);
- printk("dropping hr_region %p\n", reg);
-
down_read(&hb_callback_sem);
if (!list_empty(®->hr_active_item))
list_del_init(®->hr_active_item);
Modified: trunk/fs/usysfs/dir.c
===================================================================
--- trunk/fs/usysfs/dir.c 2005-03-23 01:31:33 UTC (rev 2039)
+++ trunk/fs/usysfs/dir.c 2005-03-23 01:46:59 UTC (rev 2040)
@@ -718,11 +718,13 @@
else
usysfs_drop_object(kobj);
+ /* drop the ref that the type initialized in make_object */
if (uktype->drop_object)
uktype->drop_object(to_kset(parent_kobj), kobj);
else
kobject_put(kobj);
+ kobject_put(kobj); /* match our get_kobject above */
module_put(owner);
return 0;
More information about the Ocfs2-commits
mailing list