Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=92efc15241ceebc23451691971897020e8563a70
Commit:     92efc15241ceebc23451691971897020e8563a70
Parent:     7f4a2a97e324e8c826d1d983bc8efb5c59194f02
Author:     Zhen Wei <[EMAIL PROTECTED]>
AuthorDate: Fri Dec 8 00:48:17 2006 -0700
Committer:  Mark Fasheh <[EMAIL PROTECTED]>
CommitDate: Thu Dec 28 16:40:32 2006 -0800

    ocfs2: export heartbeat thread pid via configfs
    
    The patch allows the ocfs2 heartbeat thread to prioritize I/O which may
    help cut down on spurious fencing. Most of this will be in the tools -
    we can have a pid configfs attribute and let userspace (ocfs2_hb_ctl)
    calls the ioprio_set syscall after starting heartbeat, but only cfq
    scheduler supports I/O priorities now.
    
    Signed-off-by: Zhen Wei <[EMAIL PROTECTED]>
    Signed-off-by: Mark Fasheh <[EMAIL PROTECTED]>
---
 fs/ocfs2/cluster/heartbeat.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
index a25ef5a..277ca67 100644
--- a/fs/ocfs2/cluster/heartbeat.c
+++ b/fs/ocfs2/cluster/heartbeat.c
@@ -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,
 };
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to