diff options
author | Paul Mackerras <paulus@samba.org> | 2006-02-08 09:43:08 +1100 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-02-08 09:43:08 +1100 |
commit | 8f75015f33c3005e0bbf83ffc0d5e0b4262cc03d (patch) | |
tree | a3c34ad86ccdc904bb43af6cd1cb163231c29276 /fs/configfs/file.c | |
parent | 076d022c566fddde41fd4a858dd24bacad8304d7 (diff) | |
parent | e060e084e7d9e1c62d02cb6b8d3fe07db5317eaa (diff) | |
download | kernel-crypto-8f75015f33c3005e0bbf83ffc0d5e0b4262cc03d.tar.gz kernel-crypto-8f75015f33c3005e0bbf83ffc0d5e0b4262cc03d.tar.xz kernel-crypto-8f75015f33c3005e0bbf83ffc0d5e0b4262cc03d.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
Diffstat (limited to 'fs/configfs/file.c')
-rw-r--r-- | fs/configfs/file.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/fs/configfs/file.c b/fs/configfs/file.c index c26cd61f13a..3921920d871 100644 --- a/fs/configfs/file.c +++ b/fs/configfs/file.c @@ -26,7 +26,6 @@ #include <linux/fs.h> #include <linux/module.h> -#include <linux/dnotify.h> #include <linux/slab.h> #include <asm/uaccess.h> #include <asm/semaphore.h> @@ -150,7 +149,7 @@ out: /** * fill_write_buffer - copy buffer from userspace. * @buffer: data buffer for file. - * @userbuf: data from user. + * @buf: data from user. * @count: number of bytes in @userbuf. * * Allocate @buffer->page if it hasn't been already, then @@ -177,8 +176,9 @@ fill_write_buffer(struct configfs_buffer * buffer, const char __user * buf, size /** * flush_write_buffer - push buffer to config_item. - * @file: file pointer. + * @dentry: dentry to the attribute * @buffer: data buffer for file. + * @count: number of bytes * * Get the correct pointers for the config_item and the attribute we're * dealing with, then call the store() method for the attribute, @@ -217,15 +217,16 @@ static ssize_t configfs_write_file(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { struct configfs_buffer * buffer = file->private_data; + ssize_t len; down(&buffer->sem); - count = fill_write_buffer(buffer,buf,count); - if (count > 0) - count = flush_write_buffer(file->f_dentry,buffer,count); - if (count > 0) - *ppos += count; + len = fill_write_buffer(buffer, buf, count); + if (len > 0) + len = flush_write_buffer(file->f_dentry, buffer, count); + if (len > 0) + *ppos += len; up(&buffer->sem); - return count; + return len; } static int check_perm(struct inode * inode, struct file * file) |