static int afs_file_invalidatepage(struct page *page, unsigned long offset);
static int afs_file_releasepage(struct page *page, int gfp_flags);
-static ssize_t afs_file_write(struct file *file, const char *buf, size_t size,
- loff_t *off);
+static ssize_t afs_file_write(struct file *file, const char __user *buf,
+ size_t size, loff_t *off);
struct inode_operations afs_file_inode_operations = {
.getattr = afs_inode_getattr,
/*
* AFS file write
*/
-static ssize_t afs_file_write(struct file *file, const char *buf, size_t size,
- loff_t *off)
+static ssize_t afs_file_write(struct file *file, const char __user *buf,
+ size_t size, loff_t *off)
{
struct afs_vnode *vnode;
static void *afs_proc_cells_next(struct seq_file *p, void *v, loff_t *pos);
static void afs_proc_cells_stop(struct seq_file *p, void *v);
static int afs_proc_cells_show(struct seq_file *m, void *v);
-static ssize_t afs_proc_cells_write(struct file *file, const char *buf,
+static ssize_t afs_proc_cells_write(struct file *file, const char __user *buf,
size_t size, loff_t *_pos);
static struct seq_operations afs_proc_cells_ops = {
static int afs_proc_rootcell_open(struct inode *inode, struct file *file);
static int afs_proc_rootcell_release(struct inode *inode, struct file *file);
-static ssize_t afs_proc_rootcell_read(struct file *file, char *buf,
+static ssize_t afs_proc_rootcell_read(struct file *file, char __user *buf,
size_t size, loff_t *_pos);
-static ssize_t afs_proc_rootcell_write(struct file *file, const char *buf,
+static ssize_t afs_proc_rootcell_write(struct file *file,
+ const char __user *buf,
size_t size, loff_t *_pos);
static struct file_operations afs_proc_rootcell_fops = {
* handle writes to /proc/fs/afs/cells
* - to add cells: echo "add <cellname> <IP>[:<IP>][:<IP>]"
*/
-static ssize_t afs_proc_cells_write(struct file *file, const char *buf,
+static ssize_t afs_proc_cells_write(struct file *file, const char __user *buf,
size_t size, loff_t *_pos)
{
char *kbuf, *name, *args;
return 0;
}
-static ssize_t afs_proc_rootcell_read(struct file *file, char *buf,
+static ssize_t afs_proc_rootcell_read(struct file *file, char __user *buf,
size_t size, loff_t *_pos)
{
return 0;
* handle writes to /proc/fs/afs/rootcell
* - to initialize rootcell: echo "cell.name:192.168.231.14"
*/
-static ssize_t afs_proc_rootcell_write(struct file *file, const char *buf,
+static ssize_t afs_proc_rootcell_write(struct file *file,
+ const char __user *buf,
size_t size, loff_t *_pos)
{
char *kbuf, *s;
* ':name:type:offset:magic:mask:interpreter:'
* where the ':' is the IFS, that can be chosen with the first char
*/
-static Node *create_entry(const char *buffer, size_t count)
+static Node *create_entry(const char __user *buffer, size_t count)
{
Node *e;
int memsize, err;
* Set status of entry/binfmt_misc:
* '1' enables, '0' disables and '-1' clears entry/binfmt_misc
*/
-static int parse_command(const char *buffer, size_t count)
+static int parse_command(const char __user *buffer, size_t count)
{
char s[4];
/* /<entry> */
static ssize_t
-bm_entry_read(struct file * file, char * buf, size_t nbytes, loff_t *ppos)
+bm_entry_read(struct file * file, char __user * buf, size_t nbytes, loff_t *ppos)
{
Node *e = file->f_dentry->d_inode->u.generic_ip;
loff_t pos = *ppos;
return res;
}
-static ssize_t bm_entry_write(struct file *file, const char *buffer,
+static ssize_t bm_entry_write(struct file *file, const char __user *buffer,
size_t count, loff_t *ppos)
{
struct dentry *root;
/* /register */
-static ssize_t bm_register_write(struct file *file, const char *buffer,
+static ssize_t bm_register_write(struct file *file, const char __user *buffer,
size_t count, loff_t *ppos)
{
Node *e;
/* /status */
static ssize_t
-bm_status_read(struct file * file, char * buf, size_t nbytes, loff_t *ppos)
+bm_status_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
{
char *s = enabled ? "enabled" : "disabled";
int len = strlen(s);
return nbytes;
}
-static ssize_t bm_status_write(struct file * file, const char * buffer,
+static ssize_t bm_status_write(struct file * file, const char __user * buffer,
size_t count, loff_t *ppos)
{
int res = parse_command(buffer, count);
static devfs_handle_t _devfs_walk_path(struct devfs_entry *dir,
const char *name, int namelen,
int traverse_symlink);
-static ssize_t devfsd_read(struct file *file, char *buf, size_t len,
+static ssize_t devfsd_read(struct file *file, char __user *buf, size_t len,
loff_t * ppos);
static int devfsd_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg);
static int devfsd_close(struct inode *inode, struct file *file);
#ifdef CONFIG_DEVFS_DEBUG
-static ssize_t stat_read(struct file *file, char *buf, size_t len,
+static ssize_t stat_read(struct file *file, char __user *buf, size_t len,
loff_t * ppos);
static struct file_operations stat_fops = {
.read = stat_read,
/* File operations for devfsd follow */
-static ssize_t devfsd_read(struct file *file, char *buf, size_t len,
+static ssize_t devfsd_read(struct file *file, char __user *buf, size_t len,
loff_t * ppos)
{
int done = FALSE;
switch (cmd) {
case DEVFSDIOC_GET_PROTO_REV:
ival = DEVFSD_PROTOCOL_REVISION_KERNEL;
- if (copy_to_user((void *)arg, &ival, sizeof ival))
+ if (copy_to_user((void __user *)arg, &ival, sizeof ival))
return -EFAULT;
break;
case DEVFSDIOC_SET_EVENT_MASK:
/*break; */
#ifdef CONFIG_DEVFS_DEBUG
case DEVFSDIOC_SET_DEBUG_MASK:
- if (copy_from_user(&ival, (void *)arg, sizeof ival))
+ if (copy_from_user(&ival, (void __user *)arg, sizeof ival))
return -EFAULT;
devfs_debug = ival;
break;
} /* End Function devfsd_close */
#ifdef CONFIG_DEVFS_DEBUG
-static ssize_t stat_read(struct file *file, char *buf, size_t len,
+static ssize_t stat_read(struct file *file, char __user *buf, size_t len,
loff_t * ppos)
{
ssize_t num;
switch (cmd) {
case EXT3_IOC_GETFLAGS:
flags = ei->i_flags & EXT3_FL_USER_VISIBLE;
- return put_user(flags, (int *) arg);
+ return put_user(flags, (int __user *) arg);
case EXT3_IOC_SETFLAGS: {
handle_t *handle = NULL;
int err;
if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
return -EACCES;
- if (get_user(flags, (int *) arg))
+ if (get_user(flags, (int __user *) arg))
return -EFAULT;
if (!S_ISDIR(inode->i_mode))
}
case EXT3_IOC_GETVERSION:
case EXT3_IOC_GETVERSION_OLD:
- return put_user(inode->i_generation, (int *) arg);
+ return put_user(inode->i_generation, (int __user *) arg);
case EXT3_IOC_SETVERSION:
case EXT3_IOC_SETVERSION_OLD: {
handle_t *handle;
return -EPERM;
if (IS_RDONLY(inode))
return -EROFS;
- if (get_user(generation, (int *) arg))
+ if (get_user(generation, (int __user *) arg))
return -EFAULT;
handle = ext3_journal_start(inode, 1);
flags |= EXT2_FLAG_APPEND; /* EXT2_APPEND_FL */
if (HFSPLUS_I(inode).userflags & HFSPLUS_FLG_NODUMP)
flags |= EXT2_FLAG_NODUMP; /* EXT2_NODUMP_FL */
- return put_user(flags, (int *)arg);
+ return put_user(flags, (int __user *)arg);
case HFSPLUS_IOC_EXT2_SETFLAGS: {
if (IS_RDONLY(inode))
return -EROFS;
if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
return -EACCES;
- if (get_user(flags, (int *)arg))
+ if (get_user(flags, (int __user *)arg))
return -EFAULT;
if (flags & (EXT2_FLAG_IMMUTABLE|EXT2_FLAG_APPEND) ||
struct jffs_fmcontrol *fmc = c->fmc;
printk("Flash status -- ");
if (!access_ok(VERIFY_WRITE,
- (struct jffs_flash_status *)arg,
+ (struct jffs_flash_status __user *)arg,
sizeof(struct jffs_flash_status))) {
D(printk("jffs_ioctl(): Bad arg in "
"JFFS_GET_STATUS ioctl!\n"));
"begin: %d, end: %d\n",
fst.size, fst.used, fst.dirty,
fst.begin, fst.end);
- if (copy_to_user((struct jffs_flash_status *)arg,
+ if (copy_to_user((struct jffs_flash_status __user *)arg,
&fst,
sizeof(struct jffs_flash_status))) {
ret = -EFAULT;
}
static ssize_t
-ncp_file_read(struct file *file, char *buf, size_t count, loff_t *ppos)
+ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
{
struct dentry *dentry = file->f_dentry;
struct inode *inode = dentry->d_inode;
}
static ssize_t
-ncp_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
struct dentry *dentry = file->f_dentry;
struct inode *inode = dentry->d_inode;
*/
int
ncp_read_bounce(struct ncp_server *server, const char *file_id,
- __u32 offset, __u16 to_read, char *target, int *bytes_read,
+ __u32 offset, __u16 to_read, char __user *target, int *bytes_read,
void* bounce, __u32 bufsize)
{
int result;
return sizeof(struct ncp_reply_header) + 2 + 2 + size + 8;
};
int ncp_read_bounce(struct ncp_server *, const char *, __u32, __u16,
- char *, int *, void* bounce, __u32 bouncelen);
+ char __user *, int *, void* bounce, __u32 bouncelen);
int ncp_read_kernel(struct ncp_server *, const char *, __u32, __u16,
char *, int *);
int ncp_write_kernel(struct ncp_server *, const char *, __u32, __u16,
* cache.
*/
ssize_t
-nfs_file_direct_read(struct kiocb *iocb, char *buf, size_t count, loff_t pos)
+nfs_file_direct_read(struct kiocb *iocb, char __user *buf, size_t count, loff_t pos)
{
ssize_t retval = -EINVAL;
loff_t *ppos = &iocb->ki_pos;
struct address_space *mapping = file->f_mapping;
struct inode *inode = mapping->host;
struct iovec iov = {
- .iov_base = buf,
+ .iov_base = (char __user *)buf,
.iov_len = count,
};
};
#ifdef CONFIG_SECURITY
-static ssize_t proc_pid_attr_read(struct file * file, char * buf,
+static ssize_t proc_pid_attr_read(struct file * file, char __user * buf,
size_t count, loff_t *ppos)
{
struct inode * inode = file->f_dentry->d_inode;
return count;
}
-static ssize_t proc_pid_attr_write(struct file * file, const char * buf,
+static ssize_t proc_pid_attr_write(struct file * file, const char __user * buf,
size_t count, loff_t *ppos)
{
struct inode * inode = file->f_dentry->d_inode;
}
static ssize_t
-smb_file_read(struct file * file, char * buf, size_t count, loff_t *ppos)
+smb_file_read(struct file * file, char __user * buf, size_t count, loff_t *ppos)
{
struct dentry * dentry = file->f_dentry;
ssize_t status;
* Write to a file (through the page cache).
*/
static ssize_t
-smb_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+smb_file_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
struct dentry * dentry = file->f_dentry;
ssize_t result;
uid_t uid32;
case SMB_IOC_GETMOUNTUID:
SET_UID(uid16, server->mnt->mounted_uid);
- result = put_user(uid16, (uid16_t *) arg);
+ result = put_user(uid16, (uid16_t __user *) arg);
break;
case SMB_IOC_GETMOUNTUID32:
SET_UID(uid32, server->mnt->mounted_uid);
- result = put_user(uid32, (uid_t *) arg);
+ result = put_user(uid32, (uid_t __user *) arg);
break;
case SMB_IOC_NEWCONN:
}
result = -EFAULT;
- if (!copy_from_user(&opt, (void *)arg, sizeof(opt)))
+ if (!copy_from_user(&opt, (void __user *)arg, sizeof(opt)))
result = smb_newconn(server, &opt);
break;
default:
/*
* called when there's work for us to do
*/
-void smbiod_wake_up()
+void smbiod_wake_up(void)
{
if (smbiod_state == SMBIOD_DEAD)
return;
.commit_write = udf_adinicb_commit_write,
};
-static ssize_t udf_file_write(struct file * file, const char * buf,
+static ssize_t udf_file_write(struct file * file, const char __user * buf,
size_t count, loff_t *ppos)
{
ssize_t retval;
switch (cmd)
{
case UDF_GETVOLIDENT:
- return copy_to_user((char *)arg,
+ return copy_to_user((char __user *)arg,
UDF_SB_VOLIDENT(inode->i_sb), 32) ? -EFAULT : 0;
case UDF_RELOCATE_BLOCKS:
{
long old, new;
if (!capable(CAP_SYS_ADMIN)) return -EACCES;
- if (get_user(old, (long *)arg)) return -EFAULT;
+ if (get_user(old, (long __user *)arg)) return -EFAULT;
if ((result = udf_relocate_blocks(inode->i_sb,
old, &new)) == 0)
- result = put_user(new, (long *)arg);
+ result = put_user(new, (long __user *)arg);
return result;
}
case UDF_GETEASIZE:
- result = put_user(UDF_I_LENEATTR(inode), (int *)arg);
+ result = put_user(UDF_I_LENEATTR(inode), (int __user *)arg);
break;
case UDF_GETEABLOCK:
- result = copy_to_user((char *)arg, UDF_I_DATA(inode),
+ result = copy_to_user((char __user *)arg, UDF_I_DATA(inode),
UDF_I_LENEATTR(inode)) ? -EFAULT : 0;
break;
}
*/
extern ssize_t nfs_direct_IO(int, struct kiocb *, const struct iovec *, loff_t,
unsigned long);
-extern ssize_t nfs_file_direct_read(struct kiocb *iocb, char *buf,
+extern ssize_t nfs_file_direct_read(struct kiocb *iocb, char __user *buf,
size_t count, loff_t pos);
extern ssize_t nfs_file_direct_write(struct kiocb *iocb, const char __user *buf,
size_t count, loff_t pos);