Merge branch 'master' into gfs2
[pandora-kernel.git] / fs / hppfs / hppfs_kern.c
index 5293091..dcb6d2e 100644 (file)
@@ -152,7 +152,6 @@ static void hppfs_read_inode(struct inode *ino)
        ino->i_mode = proc_ino->i_mode;
        ino->i_nlink = proc_ino->i_nlink;
        ino->i_size = proc_ino->i_size;
-       ino->i_blksize = proc_ino->i_blksize;
        ino->i_blocks = proc_ino->i_blocks;
 }
 
@@ -171,12 +170,12 @@ static struct dentry *hppfs_lookup(struct inode *ino, struct dentry *dentry,
 
        err = -ENOMEM;
        parent = HPPFS_I(ino)->proc_dentry;
-       down(&parent->d_inode->i_sem);
+       mutex_lock(&parent->d_inode->i_mutex);
        proc_dentry = d_lookup(parent, &dentry->d_name);
        if(proc_dentry == NULL){
                proc_dentry = d_alloc(parent, &dentry->d_name);
                if(proc_dentry == NULL){
-                       up(&parent->d_inode->i_sem);
+                       mutex_unlock(&parent->d_inode->i_mutex);
                        goto out;
                }
                new = (*parent->d_inode->i_op->lookup)(parent->d_inode,
@@ -186,7 +185,7 @@ static struct dentry *hppfs_lookup(struct inode *ino, struct dentry *dentry,
                        proc_dentry = new;
                }
        }
-       up(&parent->d_inode->i_sem);
+       mutex_unlock(&parent->d_inode->i_mutex);
 
        if(IS_ERR(proc_dentry))
                return(proc_dentry);
@@ -216,10 +215,10 @@ static struct dentry *hppfs_lookup(struct inode *ino, struct dentry *dentry,
 static struct inode_operations hppfs_file_iops = {
 };
 
-static ssize_t read_proc(struct file *file, char *buf, ssize_t count,
+static ssize_t read_proc(struct file *file, char __user *buf, ssize_t count,
                         loff_t *ppos, int is_user)
 {
-       ssize_t (*read)(struct file *, char *, size_t, loff_t *);
+       ssize_t (*read)(struct file *, char __user *, size_t, loff_t *);
        ssize_t n;
 
        read = file->f_dentry->d_inode->i_fop->read;
@@ -236,7 +235,7 @@ static ssize_t read_proc(struct file *file, char *buf, ssize_t count,
        return n;
 }
 
-static ssize_t hppfs_read_file(int fd, char *buf, ssize_t count)
+static ssize_t hppfs_read_file(int fd, char __user *buf, ssize_t count)
 {
        ssize_t n;
        int cur, err;
@@ -274,7 +273,7 @@ static ssize_t hppfs_read_file(int fd, char *buf, ssize_t count)
        return n;
 }
 
-static ssize_t hppfs_read(struct file *file, char *buf, size_t count,
+static ssize_t hppfs_read(struct file *file, char __user *buf, size_t count,
                          loff_t *ppos)
 {
        struct hppfs_private *hppfs = file->private_data;
@@ -313,12 +312,12 @@ static ssize_t hppfs_read(struct file *file, char *buf, size_t count,
        return(count);
 }
 
-static ssize_t hppfs_write(struct file *file, const char *buf, size_t len,
+static ssize_t hppfs_write(struct file *file, const char __user *buf, size_t len,
                           loff_t *ppos)
 {
        struct hppfs_private *data = file->private_data;
        struct file *proc_file = data->proc_file;
-       ssize_t (*write)(struct file *, const char *, size_t, loff_t *);
+       ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *);
        int err;
 
        write = proc_file->f_dentry->d_inode->i_fop->write;
@@ -558,7 +557,7 @@ static loff_t hppfs_llseek(struct file *file, loff_t off, int where)
        return(default_llseek(file, off, where));
 }
 
-static struct file_operations hppfs_file_fops = {
+static const struct file_operations hppfs_file_fops = {
        .owner          = NULL,
        .llseek         = hppfs_llseek,
        .read           = hppfs_read,
@@ -609,14 +608,14 @@ static int hppfs_fsync(struct file *file, struct dentry *dentry, int datasync)
        return(0);
 }
 
-static struct file_operations hppfs_dir_fops = {
+static const struct file_operations hppfs_dir_fops = {
        .owner          = NULL,
        .readdir        = hppfs_readdir,
        .open           = hppfs_dir_open,
        .fsync          = hppfs_fsync,
 };
 
-static int hppfs_statfs(struct super_block *sb, struct kstatfs *sf)
+static int hppfs_statfs(struct dentry *dentry, struct kstatfs *sf)
 {
        sf->f_blocks = 0;
        sf->f_bfree = 0;
@@ -658,7 +657,7 @@ static struct super_operations hppfs_sbops = {
        .statfs         = hppfs_statfs,
 };
 
-static int hppfs_readlink(struct dentry *dentry, char *buffer, int buflen)
+static int hppfs_readlink(struct dentry *dentry, char __user *buffer, int buflen)
 {
        struct file *proc_file;
        struct dentry *proc_dentry;
@@ -769,11 +768,11 @@ static int hppfs_fill_super(struct super_block *sb, void *d, int silent)
        return(err);
 }
 
-static struct super_block *hppfs_read_super(struct file_system_type *type,
-                                            int flags, const char *dev_name,
-                                            void *data)
+static int hppfs_read_super(struct file_system_type *type,
+                           int flags, const char *dev_name,
+                           void *data, struct vfsmount *mnt)
 {
-       return(get_sb_nodev(type, flags, data, hppfs_fill_super));
+       return get_sb_nodev(type, flags, data, hppfs_fill_super, mnt);
 }
 
 static struct file_system_type hppfs_type = {