Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[~shefty/rdma-dev.git] / fs / seq_file.c
index f9538ea..38bb59f 100644 (file)
@@ -308,27 +308,27 @@ loff_t seq_lseek(struct file *file, loff_t offset, int whence)
        mutex_lock(&m->lock);
        m->version = file->f_version;
        switch (whence) {
-               case 1:
-                       offset += file->f_pos;
-               case 0:
-                       if (offset < 0)
-                               break;
-                       retval = offset;
-                       if (offset != m->read_pos) {
-                               while ((retval=traverse(m, offset)) == -EAGAIN)
-                                       ;
-                               if (retval) {
-                                       /* with extreme prejudice... */
-                                       file->f_pos = 0;
-                                       m->read_pos = 0;
-                                       m->version = 0;
-                                       m->index = 0;
-                                       m->count = 0;
-                               } else {
-                                       m->read_pos = offset;
-                                       retval = file->f_pos = offset;
-                               }
+       case SEEK_CUR:
+               offset += file->f_pos;
+       case SEEK_SET:
+               if (offset < 0)
+                       break;
+               retval = offset;
+               if (offset != m->read_pos) {
+                       while ((retval = traverse(m, offset)) == -EAGAIN)
+                               ;
+                       if (retval) {
+                               /* with extreme prejudice... */
+                               file->f_pos = 0;
+                               m->read_pos = 0;
+                               m->version = 0;
+                               m->index = 0;
+                               m->count = 0;
+                       } else {
+                               m->read_pos = offset;
+                               retval = file->f_pos = offset;
                        }
+               }
        }
        file->f_version = m->version;
        mutex_unlock(&m->lock);