]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/configfs/file.c
BUG_ON conversion for fs/xfs/
[linux-2.6-omap-h63xx.git] / fs / configfs / file.c
index 3921920d8716a32f3495e8200abad6c0b2d08f2c..e6d5754a715ecde980dd50225495d3628c49e2d8 100644 (file)
@@ -137,8 +137,8 @@ configfs_read_file(struct file *file, char __user *buf, size_t count, loff_t *pp
                if ((retval = fill_read_buffer(file->f_dentry,buffer)))
                        goto out;
        }
-       pr_debug("%s: count = %d, ppos = %lld, buf = %s\n",
-                __FUNCTION__,count,*ppos,buffer->page);
+       pr_debug("%s: count = %zd, ppos = %lld, buf = %s\n",
+                __FUNCTION__, count, *ppos, buffer->page);
        retval = flush_read_buffer(buffer,buf,count,ppos);
 out:
        up(&buffer->sem);
@@ -274,9 +274,8 @@ static int check_perm(struct inode * inode, struct file * file)
        /* No error? Great, allocate a buffer for the file, and store it
         * it in file->private_data for easy access.
         */
-       buffer = kmalloc(sizeof(struct configfs_buffer),GFP_KERNEL);
+       buffer = kzalloc(sizeof(struct configfs_buffer),GFP_KERNEL);
        if (buffer) {
-               memset(buffer,0,sizeof(struct configfs_buffer));
                init_MUTEX(&buffer->sem);
                buffer->needs_read_fill = 1;
                buffer->ops = ops;
@@ -322,7 +321,7 @@ static int configfs_release(struct inode * inode, struct file * filp)
        return 0;
 }
 
-struct file_operations configfs_file_operations = {
+const struct file_operations configfs_file_operations = {
        .read           = configfs_read_file,
        .write          = configfs_write_file,
        .llseek         = generic_file_llseek,