Commit 158f9d76 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: coda annotation

parent a247c9ec
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
int use_coda_close; int use_coda_close;
static ssize_t static ssize_t
coda_file_read(struct file *coda_file, char *buf, size_t count, loff_t *ppos) coda_file_read(struct file *coda_file, char __user *buf, size_t count, loff_t *ppos)
{ {
struct coda_file_info *cfi; struct coda_file_info *cfi;
struct file *host_file; struct file *host_file;
...@@ -45,7 +45,7 @@ coda_file_read(struct file *coda_file, char *buf, size_t count, loff_t *ppos) ...@@ -45,7 +45,7 @@ coda_file_read(struct file *coda_file, char *buf, size_t count, loff_t *ppos)
} }
static ssize_t static ssize_t
coda_file_write(struct file *coda_file, const char *buf, size_t count, loff_t *ppos) coda_file_write(struct file *coda_file, const char __user *buf, size_t count, loff_t *ppos)
{ {
struct inode *host_inode, *coda_inode = coda_file->f_dentry->d_inode; struct inode *host_inode, *coda_inode = coda_file->f_dentry->d_inode;
struct coda_file_info *cfi; struct coda_file_info *cfi;
......
...@@ -58,7 +58,7 @@ static int coda_pioctl(struct inode * inode, struct file * filp, ...@@ -58,7 +58,7 @@ static int coda_pioctl(struct inode * inode, struct file * filp,
struct coda_inode_info *cnp; struct coda_inode_info *cnp;
/* get the Pioctl data arguments from user space */ /* get the Pioctl data arguments from user space */
if (copy_from_user(&data, (int *)user_data, sizeof(data))) { if (copy_from_user(&data, (void __user *)user_data, sizeof(data))) {
return -EINVAL; return -EINVAL;
} }
......
...@@ -88,7 +88,7 @@ static int coda_psdev_ioctl(struct inode * inode, struct file * filp, ...@@ -88,7 +88,7 @@ static int coda_psdev_ioctl(struct inode * inode, struct file * filp,
switch(cmd) { switch(cmd) {
case CIOC_KERNEL_VERSION: case CIOC_KERNEL_VERSION:
data = CODA_KERNEL_VERSION; data = CODA_KERNEL_VERSION;
return put_user(data, (int *) arg); return put_user(data, (int __user *) arg);
default: default:
return -ENOTTY; return -ENOTTY;
} }
...@@ -100,7 +100,7 @@ static int coda_psdev_ioctl(struct inode * inode, struct file * filp, ...@@ -100,7 +100,7 @@ static int coda_psdev_ioctl(struct inode * inode, struct file * filp,
* Receive a message written by Venus to the psdev * Receive a message written by Venus to the psdev
*/ */
static ssize_t coda_psdev_write(struct file *file, const char *buf, static ssize_t coda_psdev_write(struct file *file, const char __user *buf,
size_t nbytes, loff_t *off) size_t nbytes, loff_t *off)
{ {
struct venus_comm *vcp = (struct venus_comm *) file->private_data; struct venus_comm *vcp = (struct venus_comm *) file->private_data;
...@@ -212,7 +212,7 @@ static ssize_t coda_psdev_write(struct file *file, const char *buf, ...@@ -212,7 +212,7 @@ static ssize_t coda_psdev_write(struct file *file, const char *buf,
* Read a message from the kernel to Venus * Read a message from the kernel to Venus
*/ */
static ssize_t coda_psdev_read(struct file * file, char * buf, static ssize_t coda_psdev_read(struct file * file, char __user * buf,
size_t nbytes, loff_t *off) size_t nbytes, loff_t *off)
{ {
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
......
...@@ -69,7 +69,7 @@ void reset_coda_cache_inv_stats( void ) ...@@ -69,7 +69,7 @@ void reset_coda_cache_inv_stats( void )
} }
int do_reset_coda_vfs_stats( ctl_table * table, int write, struct file * filp, int do_reset_coda_vfs_stats( ctl_table * table, int write, struct file * filp,
void * buffer, size_t * lenp ) void __user * buffer, size_t * lenp )
{ {
if ( write ) { if ( write ) {
reset_coda_vfs_stats(); reset_coda_vfs_stats();
...@@ -83,7 +83,7 @@ int do_reset_coda_vfs_stats( ctl_table * table, int write, struct file * filp, ...@@ -83,7 +83,7 @@ int do_reset_coda_vfs_stats( ctl_table * table, int write, struct file * filp,
} }
int do_reset_coda_cache_inv_stats( ctl_table * table, int write, int do_reset_coda_cache_inv_stats( ctl_table * table, int write,
struct file * filp, void * buffer, struct file * filp, void __user * buffer,
size_t * lenp ) size_t * lenp )
{ {
if ( write ) { if ( write ) {
...@@ -214,7 +214,7 @@ struct proc_dir_entry* proc_fs_coda; ...@@ -214,7 +214,7 @@ struct proc_dir_entry* proc_fs_coda;
#define coda_proc_create(name,get_info) \ #define coda_proc_create(name,get_info) \
create_proc_info_entry(name, 0, proc_fs_coda, get_info) create_proc_info_entry(name, 0, proc_fs_coda, get_info)
void coda_sysctl_init() void coda_sysctl_init(void)
{ {
reset_coda_vfs_stats(); reset_coda_vfs_stats();
reset_coda_cache_inv_stats(); reset_coda_cache_inv_stats();
...@@ -234,7 +234,7 @@ void coda_sysctl_init() ...@@ -234,7 +234,7 @@ void coda_sysctl_init()
#endif #endif
} }
void coda_sysctl_clean() void coda_sysctl_clean(void)
{ {
#ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL
......
...@@ -759,13 +759,14 @@ union coda_downcalls { ...@@ -759,13 +759,14 @@ union coda_downcalls {
#define PIOCPARM_MASK 0x0000ffff #define PIOCPARM_MASK 0x0000ffff
struct ViceIoctl { struct ViceIoctl {
caddr_t in, out; /* Data to be transferred in, or out */ void __user *in; /* Data to be transferred in */
void __user *out; /* Data to be transferred out */
short in_size; /* Size of input buffer <= 2K */ short in_size; /* Size of input buffer <= 2K */
short out_size; /* Maximum size of output buffer, <= 2K */ short out_size; /* Maximum size of output buffer, <= 2K */
}; };
struct PioctlData { struct PioctlData {
const char *path; const char __user *path;
int follow; int follow;
struct ViceIoctl vi; struct ViceIoctl vi;
}; };
......
...@@ -82,9 +82,9 @@ void reset_coda_cache_inv_stats( void ); ...@@ -82,9 +82,9 @@ void reset_coda_cache_inv_stats( void );
* data structure for /proc/sys/... files * data structure for /proc/sys/... files
*/ */
int do_reset_coda_vfs_stats( ctl_table * table, int write, struct file * filp, int do_reset_coda_vfs_stats( ctl_table * table, int write, struct file * filp,
void * buffer, size_t * lenp ); void __user * buffer, size_t * lenp );
int do_reset_coda_cache_inv_stats( ctl_table * table, int write, int do_reset_coda_cache_inv_stats( ctl_table * table, int write,
struct file * filp, void * buffer, struct file * filp, void __user * buffer,
size_t * lenp ); size_t * lenp );
/* these functions are called to form the content of /proc/fs/coda/... files */ /* these functions are called to form the content of /proc/fs/coda/... files */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment