]> git.hungrycats.org Git - linux/commitdiff
[PATCH] hfs sparse fixes
authorAndries E. Brouwer <andries.brouwer@cwi.nl>
Mon, 29 Sep 2003 02:52:14 +0000 (19:52 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Mon, 29 Sep 2003 02:52:14 +0000 (19:52 -0700)
fs/hfs/file.c
fs/hfs/file_cap.c
fs/hfs/file_hdr.c
include/linux/hfs_fs.h

index 860af82eba56b3aa9081df38e93482a0825191db..3d649c0690e846c290c2221fccf24c067c65dbc7 100644 (file)
 
 /*================ Forward declarations ================*/
 
-static hfs_rwret_t hfs_file_read(struct file *, char *, hfs_rwarg_t,
+static hfs_rwret_t hfs_file_read(struct file *, char __user *, hfs_rwarg_t,
                                 loff_t *);
-static hfs_rwret_t hfs_file_write(struct file *, const char *, hfs_rwarg_t,
-                                 loff_t *);
+static hfs_rwret_t hfs_file_write(struct file *, const char __user *,
+                                 hfs_rwarg_t, loff_t *);
 static void hfs_file_truncate(struct inode *);
 
 /*================ Global variables ================*/
@@ -139,7 +139,7 @@ int hfs_get_block(struct inode *inode, sector_t iblock, struct buffer_head *bh_r
  * user-space at the address 'buf'.  Returns the number of bytes
  * successfully transferred.  This function checks the arguments, does
  * some setup and then calls hfs_do_read() to do the actual transfer.  */
-static hfs_rwret_t hfs_file_read(struct file * filp, char * buf, 
+static hfs_rwret_t hfs_file_read(struct file *filp, char __user *buf, 
                                 hfs_rwarg_t count, loff_t *ppos)
 {
         struct inode *inode = filp->f_dentry->d_inode;
@@ -181,7 +181,7 @@ static hfs_rwret_t hfs_file_read(struct file * filp, char * buf,
  * 'file->f_pos' from user-space at the address 'buf'.  The return
  * value is the number of bytes actually transferred.
  */
-static hfs_rwret_t hfs_file_write(struct file * filp, const char * buf,
+static hfs_rwret_t hfs_file_write(struct file *filp, const char __user *buf,
                                  hfs_rwarg_t count, loff_t *ppos)
 {
         struct inode    *inode = filp->f_dentry->d_inode;
@@ -242,7 +242,7 @@ static void hfs_file_truncate(struct inode * inode)
  *
  * Like copy_to_user() while translating CR->NL.
  */
-static inline void xlate_to_user(char *buf, const char *data, int count)
+static inline void xlate_to_user(char __user *buf, const char *data, int count)
 {
        char ch;
 
@@ -257,7 +257,8 @@ static inline void xlate_to_user(char *buf, const char *data, int count)
  *
  * Like copy_from_user() while translating NL->CR;
  */
-static inline int xlate_from_user(char *data, const char *buf, int count)
+static inline
+int xlate_from_user(char *data, const char __user *buf, int count)
 {
        int i;
 
@@ -290,8 +291,8 @@ static inline int xlate_from_user(char *data, const char *buf, int count)
  * This is based on Linus's minix_file_read().
  * It has been changed to take into account that HFS files have no holes.
  */
-hfs_s32 hfs_do_read(struct inode *inode, struct hfs_fork * fork, hfs_u32 pos,
-                   char * buf, hfs_u32 count)
+hfs_s32 hfs_do_read(struct inode *inode, struct hfs_fork *fork, hfs_u32 pos,
+                   char __user *buf, hfs_u32 count)
 {
        hfs_s32 size, chars, offset, block, blocks, read = 0;
        int bhrequest, uptodate;
@@ -436,8 +437,8 @@ hfs_s32 hfs_do_read(struct inode *inode, struct hfs_fork * fork, hfs_u32 pos,
  * 
  * This is just a minor edit of Linus's minix_file_write().
  */
-hfs_s32 hfs_do_write(struct inode *inode, struct hfs_fork * fork, hfs_u32 pos,
-                    const char * buf, hfs_u32 count)
+hfs_s32 hfs_do_write(struct inode *inode, struct hfs_fork *fork, hfs_u32 pos,
+                    const char __user *buf, hfs_u32 count)
 {
        hfs_s32 written, c;
        struct buffer_head * bh;
index 2e5e8a16c3825dd5866d3657c211a7c08608f94b..500a016e0df8819086057049acad3f6978caf634 100644 (file)
@@ -29,9 +29,9 @@
 /*================ Forward declarations ================*/
 static loff_t      cap_info_llseek(struct file *, loff_t,
                                    int);
-static hfs_rwret_t cap_info_read(struct file *, char *,
+static hfs_rwret_t cap_info_read(struct file *, char __user *,
                                 hfs_rwarg_t, loff_t *);
-static hfs_rwret_t cap_info_write(struct file *, const char *,
+static hfs_rwret_t cap_info_write(struct file *, const char __user *,
                                  hfs_rwarg_t, loff_t *);
 /*================ Function-like macros ================*/
 
@@ -121,7 +121,7 @@ static loff_t cap_info_llseek(struct file *file, loff_t offset, int origin)
  * 'file->f_pos' to user-space at the address 'buf'.  The return value
  * is the number of bytes actually transferred.
  */
-static hfs_rwret_t cap_info_read(struct file *filp, char *buf,
+static hfs_rwret_t cap_info_read(struct file *filp, char __user *buf,
                                 hfs_rwarg_t count, loff_t *ppos)
 {
        struct inode *inode = filp->f_dentry->d_inode;
@@ -189,7 +189,7 @@ static hfs_rwret_t cap_info_read(struct file *filp, char *buf,
  * '*ppos' from user-space at the address 'buf'.
  * The return value is the number of bytes actually transferred.
  */
-static hfs_rwret_t cap_info_write(struct file *filp, const char *buf, 
+static hfs_rwret_t cap_info_write(struct file *filp, const char __user *buf, 
                                  hfs_rwarg_t count, loff_t *ppos)
 {
         struct inode *inode = filp->f_dentry->d_inode;
index 331a8fb05367833ca14e87fe0d0d4bc0410a247d..e154dcfea1d1e15a09e3787baa62f09d4e805cfb 100644 (file)
@@ -41,8 +41,9 @@
 
 /*================ Forward declarations ================*/
 static loff_t      hdr_llseek(struct file *, loff_t, int);
-static hfs_rwret_t hdr_read(struct file *, char *, hfs_rwarg_t, loff_t *);
-static hfs_rwret_t hdr_write(struct file *, const char *,
+static hfs_rwret_t hdr_read(struct file *, char __user *,
+                           hfs_rwarg_t, loff_t *);
+static hfs_rwret_t hdr_write(struct file *, const char __user *,
                             hfs_rwarg_t, loff_t *);
 /*================ Global variables ================*/
 
@@ -382,7 +383,7 @@ loff_t hdr_llseek(struct file *file, loff_t offset, int origin)
  * successfully transferred.
  */
 /* XXX: what about the entry count changing on us? */
-static hfs_rwret_t hdr_read(struct file * filp, char * buf, 
+static hfs_rwret_t hdr_read(struct file *filp, char __user *buf, 
                            hfs_rwarg_t count, loff_t *ppos)
 {
        struct inode *inode = filp->f_dentry->d_inode;
@@ -633,7 +634,7 @@ done:
  * '*ppos' from user-space at the address 'buf'.
  * The return value is the number of bytes actually transferred.
  */
-static hfs_rwret_t hdr_write(struct file *filp, const char *buf,
+static hfs_rwret_t hdr_write(struct file *filp, const char __user *buf,
                             hfs_rwarg_t count, loff_t *ppos)
 {
        struct inode *inode = filp->f_dentry->d_inode;
index 7bebd13150dde82d3109e7ded36dd1b23a57251e..6cddc472d859b140033ce5dcecd925a89d2135a0 100644 (file)
@@ -267,9 +267,9 @@ extern void hfs_nat_drop_dentry(struct dentry *, const ino_t);
 
 /* file.c */
 extern hfs_s32 hfs_do_read(struct inode *, struct hfs_fork *, hfs_u32,
-                          char *, hfs_u32);
+                          char __user *, hfs_u32);
 extern hfs_s32 hfs_do_write(struct inode *, struct hfs_fork *, hfs_u32,
-                           const char *, hfs_u32);
+                           const char __user *, hfs_u32);
 extern void hfs_file_fix_mode(struct hfs_cat_entry *entry);
 extern struct inode_operations hfs_file_inode_operations;
 extern struct file_operations hfs_file_operations;