Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart
[pandora-kernel.git] / fs / ocfs2 / cluster / heartbeat.c
index 4cd9a95..277ca67 100644 (file)
@@ -1447,6 +1447,15 @@ out:
        return ret;
 }
 
+static ssize_t o2hb_region_pid_read(struct o2hb_region *reg,
+                                      char *page)
+{
+       if (!reg->hr_task)
+               return 0;
+
+       return sprintf(page, "%u\n", reg->hr_task->pid);
+}
+
 struct o2hb_region_attribute {
        struct configfs_attribute attr;
        ssize_t (*show)(struct o2hb_region *, char *);
@@ -1485,11 +1494,19 @@ static struct o2hb_region_attribute o2hb_region_attr_dev = {
        .store  = o2hb_region_dev_write,
 };
 
+static struct o2hb_region_attribute o2hb_region_attr_pid = {
+       .attr   = { .ca_owner = THIS_MODULE,
+                   .ca_name = "pid",
+                   .ca_mode = S_IRUGO | S_IRUSR },
+       .show   = o2hb_region_pid_read,
+};
+
 static struct configfs_attribute *o2hb_region_attrs[] = {
        &o2hb_region_attr_block_bytes.attr,
        &o2hb_region_attr_start_block.attr,
        &o2hb_region_attr_blocks.attr,
        &o2hb_region_attr_dev.attr,
+       &o2hb_region_attr_pid.attr,
        NULL,
 };
 
@@ -1553,7 +1570,7 @@ static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *g
        struct o2hb_region *reg = NULL;
        struct config_item *ret = NULL;
 
-       reg = kcalloc(1, sizeof(struct o2hb_region), GFP_KERNEL);
+       reg = kzalloc(sizeof(struct o2hb_region), GFP_KERNEL);
        if (reg == NULL)
                goto out; /* ENOMEM */
 
@@ -1679,7 +1696,7 @@ struct config_group *o2hb_alloc_hb_set(void)
        struct o2hb_heartbeat_group *hs = NULL;
        struct config_group *ret = NULL;
 
-       hs = kcalloc(1, sizeof(struct o2hb_heartbeat_group), GFP_KERNEL);
+       hs = kzalloc(sizeof(struct o2hb_heartbeat_group), GFP_KERNEL);
        if (hs == NULL)
                goto out;