]> git.hungrycats.org Git - linux/commitdiff
[PATCH] sparse: trivial fs annotations
authorAlexander Viro <viro@www.linux.org.uk>
Fri, 4 Jun 2004 00:22:50 +0000 (17:22 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 4 Jun 2004 00:22:50 +0000 (17:22 -0700)
17 files changed:
fs/afs/file.c
fs/afs/proc.c
fs/binfmt_misc.c
fs/devfs/base.c
fs/ext3/ioctl.c
fs/hfsplus/ioctl.c
fs/jffs/inode-v23.c
fs/ncpfs/file.c
fs/ncpfs/ncplib_kernel.c
fs/ncpfs/ncplib_kernel.h
fs/nfs/direct.c
fs/proc/base.c
fs/smbfs/file.c
fs/smbfs/ioctl.c
fs/smbfs/smbiod.c
fs/udf/file.c
include/linux/nfs_fs.h

index 928e3b1d679d3de0268e548bd0fdbcd3ccd99112..6b6bb7c8abf666d45b1bc3bb54b7ad5938aec97d 100644 (file)
@@ -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;
 
index 465994066fda7f0d6f148571329539c68c48537f..9c81b8f7eef07dfd5e976768f55edf18ea383329 100644 (file)
@@ -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;
index 6ba6a2f88e114be947a7878fc93f8c9600797883..9f2c43abaf8cb85142a99995395101bee548b66c 100644 (file)
@@ -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);
index c7ea29114c4f3d7bf443b3b01c63b8b0f07cbb7c..5e66bc917c28a0738876e7240e9ddb41c975b1a8 100644 (file)
@@ -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;
index 3681474e57d97d664d8537aae0060943b3c38892..0d5003913b52de284bfc3a3fa56d04f908f56870 100644 (file)
@@ -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);
index 440e0dacf62722f6ca90f5d8fa34955905feecdc..bd05477cdfae31e688536f825883b1d1012b2bb2 100644 (file)
@@ -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) ||
index fe30a98f443aa19097208f4a83084e477fd4900d..4d34ba69c3066ad7adcfd6fe3f6a0b1545845e2e 100644 (file)
@@ -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;
index e4406a5838056dac3b430c9450f327c4bf4f89f0..c1745b6f1a3efb3ba53fb28c9900b5dd05804843 100644 (file)
@@ -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;
index 345270647f73d34d2ea03a631e34d5f70e8818bd..107c0b393eb2483d05443155a3e164a17eccc76f 100644 (file)
@@ -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;
index c702f3bc4184efb25a1fa2a029171dfb2fc70d07..6c0af0198d0dc000e48b995141159466c056a34b 100644 (file)
@@ -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,
index b8018d5ae14b49ab23aff7e9d6001da61d80b467..e4e228ea968a2f9720830ab1ca0764ae3a7454e5 100644 (file)
@@ -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,
        };
 
index 79866fc0dffc68a150990f19f143645a684db07a..5d62232721e668cb33d2abb2224aca0ab445de23 100644 (file)
@@ -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;
index f1b17acb8c0cfa76279c46eade262b4d6d8d96de..12fc56cac3a90d38eaf7d59fa57bc1077717f41b 100644 (file)
@@ -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;
index 912c0460bfc4b67b6d96676c9a0f5e4c765d64d0..dbae1f8ea26fad19d288e1093025d7b014cb0417 100644 (file)
@@ -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:
index 2eefecb4b68b37056596157638850e82f7803047..6d8b28756ee955461e50c6c0b335877baa30dad2 100644 (file)
@@ -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;
index 76ef18bb6befafbe0ece4dd1ce6b524e53254f16..33640a9716459c44c48b5633d8ac2bab6e93d24a 100644 (file)
@@ -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;
        }
index 6246101b631dd3451096387ab889575c3eab4e98..0fd3f817831eafeff81c07b6b2e182c2b7d612b7 100644 (file)
@@ -306,7 +306,7 @@ nfs_file_cred(struct file *file)
  */
 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);