From: Chandra Seetharaman <sekharan@us.ibm.com>
To: akpm@osdl.org, Joel.Becker@oracle.com
Cc: linux-kernel@vger.kernel.org,
Chandra Seetharaman <sekharan@us.ibm.com>,
ckrm-tech@lists.sourceforge.net
Subject: [PATCH 5/5] Change the existing code to use the new interface
Date: Tue, 10 Oct 2006 11:21:13 -0700 [thread overview]
Message-ID: <20061010182113.20990.7216.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20061010182043.20990.83892.sendpatchset@localhost.localdomain>
Changes to the current user of configfs, OCFS2, to use the new
interface of show_attribute().
Signed-Off-By: Chandra Seetharaman <sekharan@us.ibm.com>
--
fs/ocfs2/cluster/heartbeat.c | 32 ++++++++++++++++----------------
fs/ocfs2/cluster/nodemanager.c | 25 ++++++++++++++-----------
2 files changed, 30 insertions(+), 27 deletions(-)
Index: linux-2.6.18/fs/ocfs2/cluster/heartbeat.c
===================================================================
--- linux-2.6.18.orig/fs/ocfs2/cluster/heartbeat.c
+++ linux-2.6.18/fs/ocfs2/cluster/heartbeat.c
@@ -1111,9 +1111,9 @@ static int o2hb_read_block_input(struct
}
static ssize_t o2hb_region_block_bytes_read(struct o2hb_region *reg,
- char *page)
+ struct seq_file *s)
{
- return sprintf(page, "%u\n", reg->hr_block_bytes);
+ return seq_printf(s, "%u\n", reg->hr_block_bytes);
}
static ssize_t o2hb_region_block_bytes_write(struct o2hb_region *reg,
@@ -1139,9 +1139,9 @@ static ssize_t o2hb_region_block_bytes_w
}
static ssize_t o2hb_region_start_block_read(struct o2hb_region *reg,
- char *page)
+ struct seq_file *s)
{
- return sprintf(page, "%llu\n", reg->hr_start_block);
+ return seq_printf(s, "%llu\n", reg->hr_start_block);
}
static ssize_t o2hb_region_start_block_write(struct o2hb_region *reg,
@@ -1164,9 +1164,9 @@ static ssize_t o2hb_region_start_block_w
}
static ssize_t o2hb_region_blocks_read(struct o2hb_region *reg,
- char *page)
+ struct seq_file *s)
{
- return sprintf(page, "%d\n", reg->hr_blocks);
+ return seq_printf(s, "%d\n", reg->hr_blocks);
}
static ssize_t o2hb_region_blocks_write(struct o2hb_region *reg,
@@ -1192,12 +1192,12 @@ static ssize_t o2hb_region_blocks_write(
}
static ssize_t o2hb_region_dev_read(struct o2hb_region *reg,
- char *page)
+ struct seq_file *s)
{
unsigned int ret = 0;
if (reg->hr_bdev)
- ret = sprintf(page, "%s\n", reg->hr_dev_name);
+ ret = seq_printf(s, "%s\n", reg->hr_dev_name);
return ret;
}
@@ -1443,7 +1443,7 @@ out:
struct o2hb_region_attribute {
struct configfs_attribute attr;
- ssize_t (*show)(struct o2hb_region *, char *);
+ ssize_t (*show)(struct o2hb_region *, struct seq_file *);
ssize_t (*store)(struct o2hb_region *, const char *, size_t);
};
@@ -1489,7 +1489,7 @@ static struct configfs_attribute *o2hb_r
static ssize_t o2hb_region_show(struct config_item *item,
struct configfs_attribute *attr,
- char *page)
+ struct seq_file *s)
{
struct o2hb_region *reg = to_o2hb_region(item);
struct o2hb_region_attribute *o2hb_region_attr =
@@ -1497,7 +1497,7 @@ static ssize_t o2hb_region_show(struct c
ssize_t ret = 0;
if (o2hb_region_attr->show)
- ret = o2hb_region_attr->show(reg, page);
+ ret = o2hb_region_attr->show(reg, s);
return ret;
}
@@ -1581,13 +1581,13 @@ static void o2hb_heartbeat_group_drop_it
struct o2hb_heartbeat_group_attribute {
struct configfs_attribute attr;
- ssize_t (*show)(struct o2hb_heartbeat_group *, char *);
+ ssize_t (*show)(struct o2hb_heartbeat_group *, struct seq_file *);
ssize_t (*store)(struct o2hb_heartbeat_group *, const char *, size_t);
};
static ssize_t o2hb_heartbeat_group_show(struct config_item *item,
struct configfs_attribute *attr,
- char *page)
+ struct seq_file *s)
{
struct o2hb_heartbeat_group *reg = to_o2hb_heartbeat_group(to_config_group(item));
struct o2hb_heartbeat_group_attribute *o2hb_heartbeat_group_attr =
@@ -1595,7 +1595,7 @@ static ssize_t o2hb_heartbeat_group_show
ssize_t ret = 0;
if (o2hb_heartbeat_group_attr->show)
- ret = o2hb_heartbeat_group_attr->show(reg, page);
+ ret = o2hb_heartbeat_group_attr->show(reg, s);
return ret;
}
@@ -1614,9 +1614,9 @@ static ssize_t o2hb_heartbeat_group_stor
}
static ssize_t o2hb_heartbeat_group_threshold_show(struct o2hb_heartbeat_group *group,
- char *page)
+ struct seq_file *s)
{
- return sprintf(page, "%u\n", o2hb_dead_threshold);
+ return seq_printf(s, "%u\n", o2hb_dead_threshold);
}
static ssize_t o2hb_heartbeat_group_threshold_store(struct o2hb_heartbeat_group *group,
Index: linux-2.6.18/fs/ocfs2/cluster/nodemanager.c
===================================================================
--- linux-2.6.18.orig/fs/ocfs2/cluster/nodemanager.c
+++ linux-2.6.18/fs/ocfs2/cluster/nodemanager.c
@@ -238,9 +238,9 @@ static void o2nm_node_release(struct con
kfree(node);
}
-static ssize_t o2nm_node_num_read(struct o2nm_node *node, char *page)
+static ssize_t o2nm_node_num_read(struct o2nm_node *node, struct seq_file *s)
{
- return sprintf(page, "%d\n", node->nd_num);
+ return seq_printf(s, "%d\n", node->nd_num);
}
static struct o2nm_cluster *to_o2nm_cluster_from_node(struct o2nm_node *node)
@@ -293,9 +293,10 @@ static ssize_t o2nm_node_num_write(struc
return count;
}
-static ssize_t o2nm_node_ipv4_port_read(struct o2nm_node *node, char *page)
+static ssize_t o2nm_node_ipv4_port_read(struct o2nm_node *node,
+ struct seq_file *s)
{
- return sprintf(page, "%u\n", ntohs(node->nd_ipv4_port));
+ return seq_printf(s, "%u\n", ntohs(node->nd_ipv4_port));
}
static ssize_t o2nm_node_ipv4_port_write(struct o2nm_node *node,
@@ -318,9 +319,10 @@ static ssize_t o2nm_node_ipv4_port_write
return count;
}
-static ssize_t o2nm_node_ipv4_address_read(struct o2nm_node *node, char *page)
+static ssize_t o2nm_node_ipv4_address_read(struct o2nm_node *node,
+ struct seq_file *s)
{
- return sprintf(page, "%u.%u.%u.%u\n", NIPQUAD(node->nd_ipv4_address));
+ return seq_printf(s, "%u.%u.%u.%u\n", NIPQUAD(node->nd_ipv4_address));
}
static ssize_t o2nm_node_ipv4_address_write(struct o2nm_node *node,
@@ -361,9 +363,10 @@ static ssize_t o2nm_node_ipv4_address_wr
return count;
}
-static ssize_t o2nm_node_local_read(struct o2nm_node *node, char *page)
+static ssize_t o2nm_node_local_read(struct o2nm_node *node,
+ struct seq_file *s)
{
- return sprintf(page, "%d\n", node->nd_local);
+ return seq_printf(s, "%d\n", node->nd_local);
}
static ssize_t o2nm_node_local_write(struct o2nm_node *node, const char *page,
@@ -417,7 +420,7 @@ static ssize_t o2nm_node_local_write(str
struct o2nm_node_attribute {
struct configfs_attribute attr;
- ssize_t (*show)(struct o2nm_node *, char *);
+ ssize_t (*show)(struct o2nm_node *, struct seq_file *);
ssize_t (*store)(struct o2nm_node *, const char *, size_t);
};
@@ -474,7 +477,7 @@ static int o2nm_attr_index(struct config
static ssize_t o2nm_node_show(struct config_item *item,
struct configfs_attribute *attr,
- char *page)
+ struct seq_file *s)
{
struct o2nm_node *node = to_o2nm_node(item);
struct o2nm_node_attribute *o2nm_node_attr =
@@ -482,7 +485,7 @@ static ssize_t o2nm_node_show(struct con
ssize_t ret = 0;
if (o2nm_node_attr->show)
- ret = o2nm_node_attr->show(node, page);
+ ret = o2nm_node_attr->show(node, s);
return ret;
}
--
----------------------------------------------------------------------
Chandra Seetharaman | Be careful what you choose....
- sekharan@us.ibm.com | .......you may get it.
----------------------------------------------------------------------
next prev parent reply other threads:[~2006-10-10 18:21 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-10 18:20 [PATCH 0/5] Allow more than PAGESIZE data read in configfs Chandra Seetharaman
2006-10-10 18:20 ` [PATCH 1/5] Fix a module count leak Chandra Seetharaman
2006-10-10 22:17 ` Joel Becker
2006-10-10 18:20 ` [PATCH 2/5] Use seq_file for read side of operations Chandra Seetharaman
2006-10-11 9:12 ` Joel Becker
2006-10-10 18:21 ` [PATCH 3/5] Change configfs_example.c to use the new interface Chandra Seetharaman
2006-10-10 18:21 ` [PATCH 4/5] Change Documentation to reflect " Chandra Seetharaman
2006-10-10 18:21 ` Chandra Seetharaman [this message]
2006-10-10 20:35 ` [PATCH 0/5] Allow more than PAGESIZE data read in configfs Joel Becker
2006-10-10 21:31 ` [ckrm-tech] " Paul Menage
2006-10-10 21:58 ` Joel Becker
2006-10-10 23:13 ` Chandra Seetharaman
2006-10-11 0:15 ` Joel Becker
2006-10-11 0:49 ` Matt Helsley
2006-10-11 1:28 ` Joel Becker
2006-10-11 22:39 ` Greg KH
2006-10-11 23:26 ` Chandra Seetharaman
2006-10-12 4:17 ` Paul Jackson
2006-10-12 23:51 ` Greg KH
2006-10-13 0:16 ` Paul Jackson
2006-10-13 23:38 ` Matt Helsley
2006-10-13 23:40 ` Matt Helsley
2006-10-13 23:47 ` Paul Menage
2006-10-14 6:17 ` Greg KH
2006-10-14 23:14 ` Matt Helsley
2006-10-16 19:10 ` Chandra Seetharaman
2006-10-16 20:32 ` Paul Jackson
2006-10-16 22:29 ` Chandra Seetharaman
2006-10-17 2:59 ` Paul Jackson
2006-10-12 2:17 ` Matt Helsley
2006-10-12 23:54 ` Greg KH
2006-10-13 3:22 ` Matt Helsley
[not found] ` <20061011220619.GB7911@ca-server1.us.oracle.com>
[not found] ` <1160619516.18766.209.camel@localhost.localdomain>
2006-10-12 7:08 ` Joel Becker
2006-10-12 21:44 ` Paul Jackson
2006-10-12 22:51 ` Joel Becker
2006-10-13 0:01 ` Paul Jackson
2006-10-14 4:40 ` Greg KH
2006-10-13 23:37 ` Matt Helsley
2006-10-14 0:09 ` Joel Becker
2006-10-15 1:06 ` Matt Helsley
2006-10-15 19:07 ` Paul Jackson
2006-10-16 19:33 ` Chandra Seetharaman
2006-10-16 23:07 ` Joel Becker
2006-10-11 20:19 ` Andrew Morton
2006-10-11 21:41 ` Joel Becker
2006-10-11 22:18 ` Joel Becker
2006-10-11 22:48 ` Andrew Morton
2006-10-11 23:27 ` Chandra Seetharaman
2006-10-14 8:01 ` Greg KH
2006-10-14 19:43 ` Andrew Morton
2006-10-14 20:10 ` Joel Becker
2006-10-16 19:24 ` Chandra Seetharaman
2006-10-16 23:09 ` Joel Becker
2006-10-18 0:55 ` Chandra Seetharaman
2006-10-19 18:42 ` Joel Becker
2006-10-16 19:16 ` Chandra Seetharaman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061010182113.20990.7216.sendpatchset@localhost.localdomain \
--to=sekharan@us.ibm.com \
--cc=Joel.Becker@oracle.com \
--cc=akpm@osdl.org \
--cc=ckrm-tech@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.