vserver 1.9.5.x5
[linux-2.6.git] / drivers / misc / ibmasm / ibmasmfs.c
index a01fe08..866e867 100644 (file)
@@ -131,6 +131,7 @@ static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent)
        sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
        sb->s_magic = IBMASMFS_MAGIC;
        sb->s_op = &ibmasmfs_s_ops;
+       sb->s_time_gran = 1;
 
        root = ibmasmfs_make_inode (sb, S_IFDIR | 0500);
        if (!root)
@@ -173,13 +174,8 @@ static struct dentry *ibmasmfs_create_file (struct super_block *sb,
 {
        struct dentry *dentry;
        struct inode *inode;
-       struct qstr qname;
 
-       qname.name = name;
-       qname.len = strlen (name);
-       qname.hash = full_name_hash(name, qname.len);
-
-       dentry = d_alloc(parent, &qname);
+       dentry = d_alloc_name(parent, name);
        if (!dentry)
                return NULL;
 
@@ -202,12 +198,8 @@ static struct dentry *ibmasmfs_create_dir (struct super_block *sb,
 {
        struct dentry *dentry;
        struct inode *inode;
-       struct qstr qname;
 
-       qname.name = name;
-       qname.len = strlen (name);
-       qname.hash = full_name_hash(name, qname.len);
-       dentry = d_alloc(parent, &qname);
+       dentry = d_alloc_name(parent, name);
        if (!dentry)
                return NULL;
 
@@ -224,12 +216,12 @@ static struct dentry *ibmasmfs_create_dir (struct super_block *sb,
        return dentry;
 }
 
-int ibmasmfs_register()
+int ibmasmfs_register(void)
 {
        return register_filesystem(&ibmasmfs_type);
 }
 
-void ibmasmfs_unregister()
+void ibmasmfs_unregister(void)
 {
        unregister_filesystem(&ibmasmfs_type);
 }
@@ -287,7 +279,7 @@ static int command_file_close(struct inode *inode, struct file *file)
        return 0;
 }
 
-static ssize_t command_file_read(struct file *file, char *buf, size_t count, loff_t *offset)
+static ssize_t command_file_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
 {
        struct ibmasmfs_command_data *command_data = file->private_data;
        struct command *cmd;
@@ -324,7 +316,7 @@ static ssize_t command_file_read(struct file *file, char *buf, size_t count, lof
        return len;
 }
 
-static ssize_t command_file_write(struct file *file, const char *ubuff, size_t count, loff_t *offset)
+static ssize_t command_file_write(struct file *file, const char __user *ubuff, size_t count, loff_t *offset)
 {
        struct ibmasmfs_command_data *command_data = file->private_data;
        struct command *cmd;
@@ -345,7 +337,7 @@ static ssize_t command_file_write(struct file *file, const char *ubuff, size_t c
        if (!cmd)
                return -ENOMEM;
 
-       if (copy_from_user((void *)cmd->buffer, (void *)ubuff, count)) {
+       if (copy_from_user(cmd->buffer, ubuff, count)) {
                command_put(cmd);
                return -EFAULT;
        }
@@ -395,7 +387,7 @@ static int event_file_close(struct inode *inode, struct file *file)
        return 0;
 }
 
-static ssize_t event_file_read(struct file *file, char *buf, size_t count, loff_t *offset)
+static ssize_t event_file_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
 {
        struct ibmasmfs_event_data *event_data = file->private_data;
        struct event_reader *reader = &event_data->reader;
@@ -421,7 +413,7 @@ static ssize_t event_file_read(struct file *file, char *buf, size_t count, loff_
        return reader->data_size;
 }
 
-static ssize_t event_file_write(struct file *file, const char *buf, size_t count, loff_t *offset)
+static ssize_t event_file_write(struct file *file, const char __user *buf, size_t count, loff_t *offset)
 {
        struct ibmasmfs_event_data *event_data = file->private_data;
 
@@ -462,7 +454,7 @@ static int r_heartbeat_file_close(struct inode *inode, struct file *file)
        return 0;
 }
 
-static ssize_t r_heartbeat_file_read(struct file *file, char *buf, size_t count, loff_t *offset)
+static ssize_t r_heartbeat_file_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
 {
        struct ibmasmfs_heartbeat_data *rhbeat = file->private_data;
        unsigned long flags;
@@ -490,7 +482,7 @@ static ssize_t r_heartbeat_file_read(struct file *file, char *buf, size_t count,
        return result;
 }
 
-static ssize_t r_heartbeat_file_write(struct file *file, const char *buf, size_t count, loff_t *offset)
+static ssize_t r_heartbeat_file_write(struct file *file, const char __user *buf, size_t count, loff_t *offset)
 {
        struct ibmasmfs_heartbeat_data *rhbeat = file->private_data;
 
@@ -518,9 +510,9 @@ static int remote_settings_file_close(struct inode *inode, struct file *file)
        return 0;
 }
 
-static ssize_t remote_settings_file_read(struct file *file, char *buf, size_t count, loff_t *offset)
+static ssize_t remote_settings_file_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
 {
-       unsigned long address = (unsigned long)file->private_data;
+       void __iomem *address = (void __iomem *)file->private_data;
        unsigned char *page;
        int retval;
        int len = 0;
@@ -552,9 +544,9 @@ exit:
        return retval;
 }
 
-static ssize_t remote_settings_file_write(struct file *file, const char *ubuff, size_t count, loff_t *offset)
+static ssize_t remote_settings_file_write(struct file *file, const char __user *ubuff, size_t count, loff_t *offset)
 {
-       unsigned long address = (unsigned long)file->private_data;
+       void __iomem *address = (void __iomem *)file->private_data;
        char *buff;
        unsigned int value;
 
@@ -571,7 +563,7 @@ static ssize_t remote_settings_file_write(struct file *file, const char *ubuff,
 
        memset(buff, 0x0, count + 1);
 
-       if (copy_from_user((void *)buff, (void *)ubuff, count)) {
+       if (copy_from_user(buff, ubuff, count)) {
                kfree(buff);
                return -EFAULT;
        }
@@ -618,7 +610,7 @@ static int remote_event_file_close(struct inode *inode, struct file *file)
        return 0;
 }
 
-static ssize_t remote_event_file_read(struct file *file, char *buf, size_t count, loff_t *offset)
+static ssize_t remote_event_file_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
 {
        struct service_processor *sp = file->private_data;
        struct remote_queue *q = &sp->remote_queue;
@@ -663,7 +655,7 @@ static struct file_operations event_fops = {
        .open =         event_file_open,
        .release =      event_file_close,
        .read =         event_file_read,
-       .write          event_file_write,
+       .write =        event_file_write,
 };
 
 static struct file_operations r_heartbeat_fops = {