diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-06-23 13:34:45 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-06-29 04:57:52 -0400 |
commit | 5d48f3a2de568ba2c9d06ecbdf995e0702748f22 (patch) | |
tree | 1ce9dc573a60f063ff5661a0eb5641e68ba95081 /fs | |
parent | d2c40f789f6c98c50bf01cf84ef46415fb7a2776 (diff) |
block_dev: switch to fixed_size_llseek()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/block_dev.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index 2091db8cdd78..431b6a04ebfd 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -325,31 +325,10 @@ static int blkdev_write_end(struct file *file, struct address_space *mapping, | |||
325 | static loff_t block_llseek(struct file *file, loff_t offset, int whence) | 325 | static loff_t block_llseek(struct file *file, loff_t offset, int whence) |
326 | { | 326 | { |
327 | struct inode *bd_inode = file->f_mapping->host; | 327 | struct inode *bd_inode = file->f_mapping->host; |
328 | loff_t size; | ||
329 | loff_t retval; | 328 | loff_t retval; |
330 | 329 | ||
331 | mutex_lock(&bd_inode->i_mutex); | 330 | mutex_lock(&bd_inode->i_mutex); |
332 | size = i_size_read(bd_inode); | 331 | retval = fixed_size_llseek(file, offset, whence, i_size_read(bd_inode)); |
333 | |||
334 | retval = -EINVAL; | ||
335 | switch (whence) { | ||
336 | case SEEK_END: | ||
337 | offset += size; | ||
338 | break; | ||
339 | case SEEK_CUR: | ||
340 | offset += file->f_pos; | ||
341 | case SEEK_SET: | ||
342 | break; | ||
343 | default: | ||
344 | goto out; | ||
345 | } | ||
346 | if (offset >= 0 && offset <= size) { | ||
347 | if (offset != file->f_pos) { | ||
348 | file->f_pos = offset; | ||
349 | } | ||
350 | retval = offset; | ||
351 | } | ||
352 | out: | ||
353 | mutex_unlock(&bd_inode->i_mutex); | 332 | mutex_unlock(&bd_inode->i_mutex); |
354 | return retval; | 333 | return retval; |
355 | } | 334 | } |