diff options
| author | Alexander Viro <viro@www.linux.org.uk> | 2004-06-03 17:22:50 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-06-03 17:22:50 -0700 |
| commit | c6d32902cb31212e0fc467a314b94a2aaf414fb3 (patch) | |
| tree | 57d950d20f31dbd971456018449208ba4b84f2c4 /fs | |
| parent | 4bb07ce359a1d2bc9cdc260f2c800958f3b78416 (diff) | |
[PATCH] sparse: trivial fs annotations
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/afs/file.c | 8 | ||||
| -rw-r--r-- | fs/afs/proc.c | 14 | ||||
| -rw-r--r-- | fs/binfmt_misc.c | 14 | ||||
| -rw-r--r-- | fs/devfs/base.c | 12 | ||||
| -rw-r--r-- | fs/ext3/ioctl.c | 8 | ||||
| -rw-r--r-- | fs/hfsplus/ioctl.c | 4 | ||||
| -rw-r--r-- | fs/jffs/inode-v23.c | 4 | ||||
| -rw-r--r-- | fs/ncpfs/file.c | 4 | ||||
| -rw-r--r-- | fs/ncpfs/ncplib_kernel.c | 2 | ||||
| -rw-r--r-- | fs/ncpfs/ncplib_kernel.h | 2 | ||||
| -rw-r--r-- | fs/nfs/direct.c | 4 | ||||
| -rw-r--r-- | fs/proc/base.c | 4 | ||||
| -rw-r--r-- | fs/smbfs/file.c | 4 | ||||
| -rw-r--r-- | fs/smbfs/ioctl.c | 6 | ||||
| -rw-r--r-- | fs/smbfs/smbiod.c | 2 | ||||
| -rw-r--r-- | fs/udf/file.c | 12 |
16 files changed, 53 insertions, 51 deletions
diff --git a/fs/afs/file.c b/fs/afs/file.c index 928e3b1d679d..6b6bb7c8abf6 100644 --- a/fs/afs/file.c +++ b/fs/afs/file.c @@ -31,8 +31,8 @@ static int afs_file_readpage(struct file *file, struct page *page); 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, @@ -61,8 +61,8 @@ struct address_space_operations afs_fs_aops = { /* * 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; diff --git a/fs/afs/proc.c b/fs/afs/proc.c index 465994066fda..9c81b8f7eef0 100644 --- a/fs/afs/proc.c +++ b/fs/afs/proc.c @@ -27,7 +27,7 @@ static void *afs_proc_cells_start(struct seq_file *p, loff_t *pos); 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 = { @@ -47,9 +47,10 @@ static struct file_operations afs_proc_cells_fops = { 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 = { @@ -278,7 +279,7 @@ static int afs_proc_cells_show(struct seq_file *m, void *v) * 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; @@ -363,7 +364,7 @@ static int afs_proc_rootcell_release(struct inode *inode, struct file *file) 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; @@ -374,7 +375,8 @@ static ssize_t afs_proc_rootcell_read(struct file *file, char *buf, * 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; diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index 6ba6a2f88e11..9f2c43abaf8c 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c @@ -196,7 +196,7 @@ static int unquote(char *from) * ':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; @@ -319,7 +319,7 @@ Einval: * 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]; @@ -424,7 +424,7 @@ static void kill_node(Node *e) /* /<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; @@ -456,7 +456,7 @@ out: 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; @@ -488,7 +488,7 @@ static struct file_operations bm_entry_operations = { /* /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; @@ -556,7 +556,7 @@ static struct file_operations bm_register_operations = { /* /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); @@ -574,7 +574,7 @@ bm_status_read(struct file * file, char * buf, size_t nbytes, loff_t *ppos) 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); diff --git a/fs/devfs/base.c b/fs/devfs/base.c index c7ea29114c4f..5e66bc917c28 100644 --- a/fs/devfs/base.c +++ b/fs/devfs/base.c @@ -848,13 +848,13 @@ static unsigned int boot_options = OPTION_NONE; 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, @@ -2579,7 +2579,7 @@ static struct file_system_type devfs_fs_type = { /* 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; @@ -2693,7 +2693,7 @@ static int devfsd_ioctl(struct inode *inode, struct file *file, 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: @@ -2732,7 +2732,7 @@ static int devfsd_ioctl(struct inode *inode, struct file *file, /*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; @@ -2772,7 +2772,7 @@ static int devfsd_close(struct inode *inode, struct file *file) } /* 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; diff --git a/fs/ext3/ioctl.c b/fs/ext3/ioctl.c index 3681474e57d9..0d5003913b52 100644 --- a/fs/ext3/ioctl.c +++ b/fs/ext3/ioctl.c @@ -26,7 +26,7 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, 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; @@ -40,7 +40,7 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, 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)) @@ -100,7 +100,7 @@ flags_err: } 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; @@ -112,7 +112,7 @@ flags_err: 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); diff --git a/fs/hfsplus/ioctl.c b/fs/hfsplus/ioctl.c index 440e0dacf627..bd05477cdfae 100644 --- a/fs/hfsplus/ioctl.c +++ b/fs/hfsplus/ioctl.c @@ -31,7 +31,7 @@ int hfsplus_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, 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; @@ -39,7 +39,7 @@ int hfsplus_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, 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) || diff --git a/fs/jffs/inode-v23.c b/fs/jffs/inode-v23.c index fe30a98f443a..4d34ba69c306 100644 --- a/fs/jffs/inode-v23.c +++ b/fs/jffs/inode-v23.c @@ -1582,7 +1582,7 @@ jffs_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, 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")); @@ -1598,7 +1598,7 @@ jffs_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, "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; diff --git a/fs/ncpfs/file.c b/fs/ncpfs/file.c index e4406a583805..c1745b6f1a3e 100644 --- a/fs/ncpfs/file.c +++ b/fs/ncpfs/file.c @@ -99,7 +99,7 @@ out: } 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; @@ -187,7 +187,7 @@ outrel: } 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; diff --git a/fs/ncpfs/ncplib_kernel.c b/fs/ncpfs/ncplib_kernel.c index 345270647f73..107c0b393eb2 100644 --- a/fs/ncpfs/ncplib_kernel.c +++ b/fs/ncpfs/ncplib_kernel.c @@ -1002,7 +1002,7 @@ out: */ 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; diff --git a/fs/ncpfs/ncplib_kernel.h b/fs/ncpfs/ncplib_kernel.h index c702f3bc4184..6c0af0198d0d 100644 --- a/fs/ncpfs/ncplib_kernel.h +++ b/fs/ncpfs/ncplib_kernel.h @@ -56,7 +56,7 @@ static inline int ncp_read_bounce_size(__u32 size) { 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, diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index b8018d5ae14b..e4e228ea968a 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c @@ -466,7 +466,7 @@ nfs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, * 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; @@ -546,7 +546,7 @@ nfs_file_direct_write(struct kiocb *iocb, const char __user *buf, size_t count, 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, }; diff --git a/fs/proc/base.c b/fs/proc/base.c index 79866fc0dffc..5d62232721e6 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -1162,7 +1162,7 @@ static struct inode_operations proc_task_inode_operations = { }; #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; @@ -1199,7 +1199,7 @@ static ssize_t proc_pid_attr_read(struct file * file, char * buf, 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; diff --git a/fs/smbfs/file.c b/fs/smbfs/file.c index f1b17acb8c0c..12fc56cac3a9 100644 --- a/fs/smbfs/file.c +++ b/fs/smbfs/file.c @@ -215,7 +215,7 @@ smb_updatepage(struct file *file, struct page *page, unsigned long offset, } 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; @@ -318,7 +318,7 @@ struct address_space_operations smb_file_aops = { * 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; diff --git a/fs/smbfs/ioctl.c b/fs/smbfs/ioctl.c index 912c0460bfc4..dbae1f8ea26f 100644 --- a/fs/smbfs/ioctl.c +++ b/fs/smbfs/ioctl.c @@ -35,11 +35,11 @@ smb_ioctl(struct inode *inode, struct file *filp, 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: @@ -56,7 +56,7 @@ smb_ioctl(struct inode *inode, struct file *filp, } 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: diff --git a/fs/smbfs/smbiod.c b/fs/smbfs/smbiod.c index 2eefecb4b68b..6d8b28756ee9 100644 --- a/fs/smbfs/smbiod.c +++ b/fs/smbfs/smbiod.c @@ -54,7 +54,7 @@ static int smbiod_start(void); /* * called when there's work for us to do */ -void smbiod_wake_up() +void smbiod_wake_up(void) { if (smbiod_state == SMBIOD_DEAD) return; diff --git a/fs/udf/file.c b/fs/udf/file.c index 76ef18bb6bef..33640a971645 100644 --- a/fs/udf/file.c +++ b/fs/udf/file.c @@ -109,7 +109,7 @@ struct address_space_operations udf_adinicb_aops = { .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; @@ -204,26 +204,26 @@ int udf_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, 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; } |
