lkml.org 
[lkml]   [2003]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] relay_open const filename
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,
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:46    [W:0.093 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site