diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-12-06 04:04:48 +0100 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-12-23 16:41:31 +0100 |
commit | b25472f9b96159cc0b9b7ed449448805973cd789 (patch) | |
tree | 7963f6d5adc2a82f6f10b4f9cf427ce931f67c76 /arch/sparc/kernel/mdesc.c | |
parent | don't open-code generic_file_llseek_size() (diff) | |
download | linux-b25472f9b96159cc0b9b7ed449448805973cd789.tar.xz linux-b25472f9b96159cc0b9b7ed449448805973cd789.zip |
new helpers: no_seek_end_llseek{,_size}()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/sparc/kernel/mdesc.c')
-rw-r--r-- | arch/sparc/kernel/mdesc.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/arch/sparc/kernel/mdesc.c b/arch/sparc/kernel/mdesc.c index 6f80936e0eea..11228861d9b4 100644 --- a/arch/sparc/kernel/mdesc.c +++ b/arch/sparc/kernel/mdesc.c @@ -1033,25 +1033,9 @@ static ssize_t mdesc_read(struct file *file, char __user *buf, static loff_t mdesc_llseek(struct file *file, loff_t offset, int whence) { - struct mdesc_handle *hp; - - switch (whence) { - case SEEK_CUR: - offset += file->f_pos; - break; - case SEEK_SET: - break; - default: - return -EINVAL; - } - - hp = file->private_data; - if (offset > hp->handle_size) - return -EINVAL; - else - file->f_pos = offset; + struct mdesc_handle *hp = file->private_data; - return offset; + return no_seek_end_llseek_size(file, offset, whence, hp->handle_size); } /* mdesc_close() - /dev/mdesc is being closed, release the reference to |