From: Stephen Hemminger <shemminger@osdl.org>
To: zanussi@us.ibm.com
Cc: linux-kernel@vger.kernel.org, karim@opersys.com, bob@watson.ibm.com
Subject: Re: [PATCH] relay_open const filename
Date: Wed, 16 Jul 2003 15:27:33 -0700 [thread overview]
Message-ID: <20030716152733.3a9a1d02.shemminger@osdl.org> (raw)
In-Reply-To: <20030716145508.1742d722.shemminger@osdl.org>
Since relay_open takes a pathname, it should be "const char *".
diff -Nru a/fs/relayfs/relay.c b/fs/relayfs/relay.c
--- a/fs/relayfs/relay.c Wed Jul 16 15:23:36 2003
+++ b/fs/relayfs/relay.c Wed Jul 16 15:23:36 2003
@@ -660,7 +660,7 @@
* locking scheme can use buffers of any size, but is hardcoded at 2.
*/
static struct rchan *
-rchan_create(char *chanpath,
+rchan_create(const char *chanpath,
int bufsize_lockless,
int nbufs_lockless,
int bufsize_locking,
@@ -829,11 +829,11 @@
* to create the file.
*/
static int
-rchan_create_dir(char * chanpath,
- char **residual,
+rchan_create_dir(const char * chanpath,
+ const char **residual,
struct dentry **topdir)
{
- char *cp = chanpath, *next;
+ const char *cp = chanpath, *next;
struct dentry *parent = NULL;
int len, err = 0;
@@ -867,12 +867,12 @@
* Returns 0 if successful, negative otherwise.
*/
static int
-rchan_create_file(char * chanpath,
+rchan_create_file(const char * chanpath,
struct dentry **dentry,
struct rchan * data)
{
int err;
- char * fname;
+ const char * fname;
struct dentry *topdir;
err = rchan_create_dir(chanpath, &fname, &topdir);
@@ -1239,7 +1239,7 @@
* cause the channel to wrap around continuously.
*/
int
-relay_open(char *chanpath,
+relay_open(const char *chanpath,
int bufsize_lockless,
int nbufs_lockless,
int bufsize_locking,
@@ -1556,7 +1556,7 @@
int err = 0;
int try_bufcount, cur_bufno = 0, include_nbufs = 1;
u32 cur_idx, buf_size;
- size_t avail_count, avail_in_buf;
+ size_t avail_count = 0, avail_in_buf;
int unused_bytes = 0;
if (rchan->bufs_produced < rchan->n_bufs)
diff -Nru a/include/linux/relayfs_fs.h b/include/linux/relayfs_fs.h
--- a/include/linux/relayfs_fs.h Wed Jul 16 15:23:36 2003
+++ b/include/linux/relayfs_fs.h Wed Jul 16 15:23:36 2003
@@ -531,7 +531,7 @@
* High-level relayfs kernel API, fs/relayfs/relay.c
*/
extern int
-relay_open(char *chanpath,
+relay_open(const char *chanpath,
int bufsize_lockless,
int nbufs_lockless,
int bufsize_locking,
next prev parent reply other threads:[~2003-07-16 22:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-15 15:15 [RFC][PATCH 0/5] relayfs Tom Zanussi
2003-07-15 15:27 ` Gianni Tedesco
2003-07-15 16:01 ` Tom Zanussi
2003-07-15 16:40 ` Gianni Tedesco
2003-07-15 17:01 ` Tom Zanussi
2003-07-15 18:45 ` Tom Zanussi
2003-07-16 21:55 ` [PATCH] relayfs Stephen Hemminger
2003-07-16 22:27 ` Stephen Hemminger [this message]
2003-07-18 21:11 ` Tom Zanussi
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=20030716152733.3a9a1d02.shemminger@osdl.org \
--to=shemminger@osdl.org \
--cc=bob@watson.ibm.com \
--cc=karim@opersys.com \
--cc=linux-kernel@vger.kernel.org \
--cc=zanussi@us.ibm.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).