From ad90f7701f3834070e37d0d203a1a846eb42d28a Mon Sep 17 00:00:00 2001 From: Zhen Wei Date: Fri, 8 Dec 2006 00:48:17 -0700 Subject: [PATCH] --- yaml --- r: 45151 b: refs/heads/master c: 92efc15241ceebc23451691971897020e8563a70 h: refs/heads/master i: 45149: ea193f0e396c0bef6511083defafb230a9ac362e 45147: ccbf2d944a47612a5d277ae7fc45123531eda872 45143: 5b476d591299fb6a7c95373e4377894e949548e0 45135: c08d8ec334363c045e00ad0690c1dc3ea133adc2 45119: 4568485caa4800b80df391661da289dc6fad23ea v: v3 --- [refs] | 2 +- trunk/fs/ocfs2/cluster/heartbeat.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 593842055b2d..8035b0d42046 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7f4a2a97e324e8c826d1d983bc8efb5c59194f02 +refs/heads/master: 92efc15241ceebc23451691971897020e8563a70 diff --git a/trunk/fs/ocfs2/cluster/heartbeat.c b/trunk/fs/ocfs2/cluster/heartbeat.c index a25ef5a50386..277ca67a2ad6 100644 --- a/trunk/fs/ocfs2/cluster/heartbeat.c +++ b/trunk/fs/ocfs2/cluster/heartbeat.c @@ -1447,6 +1447,15 @@ static ssize_t o2hb_region_dev_write(struct o2hb_region *reg, 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, };