aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ceph/dir.c')
-rw-r--r--fs/ceph/dir.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index e8477dc51b45..0972b457a03f 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -446,14 +446,19 @@ static loff_t ceph_dir_llseek(struct file *file, loff_t offset, int origin)
446 loff_t retval; 446 loff_t retval;
447 447
448 mutex_lock(&inode->i_mutex); 448 mutex_lock(&inode->i_mutex);
449 retval = -EINVAL;
449 switch (origin) { 450 switch (origin) {
450 case SEEK_END: 451 case SEEK_END:
451 offset += inode->i_size + 2; /* FIXME */ 452 offset += inode->i_size + 2; /* FIXME */
452 break; 453 break;
453 case SEEK_CUR: 454 case SEEK_CUR:
454 offset += file->f_pos; 455 offset += file->f_pos;
456 case SEEK_SET:
457 break;
458 default:
459 goto out;
455 } 460 }
456 retval = -EINVAL; 461
457 if (offset >= 0 && offset <= inode->i_sb->s_maxbytes) { 462 if (offset >= 0 && offset <= inode->i_sb->s_maxbytes) {
458 if (offset != file->f_pos) { 463 if (offset != file->f_pos) {
459 file->f_pos = offset; 464 file->f_pos = offset;
@@ -477,6 +482,7 @@ static loff_t ceph_dir_llseek(struct file *file, loff_t offset, int origin)
477 if (offset > old_offset) 482 if (offset > old_offset)
478 fi->dir_release_count--; 483 fi->dir_release_count--;
479 } 484 }
485out:
480 mutex_unlock(&inode->i_mutex); 486 mutex_unlock(&inode->i_mutex);
481 return retval; 487 return retval;
482} 488}