aboutsummaryrefslogtreecommitdiff
path: root/fs/seq_file.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2008-08-28 02:47:00 +0000
committerSteve French <sfrench@us.ibm.com>2008-08-28 02:47:00 +0000
commit6405c9cd9bf7b1c35ed76ef8ee3e217056285702 (patch)
tree0659c9ae17d1375f185f88f4f7fef1a667f375d8 /fs/seq_file.c
parentbcc55c6664a90146149ba0fd93052adc94287b9f (diff)
parent4c246edd2550304df5b766cc841584b2bb058843 (diff)
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'fs/seq_file.c')
-rw-r--r--fs/seq_file.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/seq_file.c b/fs/seq_file.c
index 5d54205e486..bd20f7f5a93 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -108,9 +108,9 @@ ssize_t seq_read(struct file *file, char __user *buf, size_t size, loff_t *ppos)
goto Done;
}
/* we need at least one record in buffer */
+ pos = m->index;
+ p = m->op->start(m, &pos);
while (1) {
- pos = m->index;
- p = m->op->start(m, &pos);
err = PTR_ERR(p);
if (!p || IS_ERR(p))
break;
@@ -119,6 +119,11 @@ ssize_t seq_read(struct file *file, char __user *buf, size_t size, loff_t *ppos)
break;
if (unlikely(err))
m->count = 0;
+ if (unlikely(!m->count)) {
+ p = m->op->next(m, p, &pos);
+ m->index = pos;
+ continue;
+ }
if (m->count < m->size)
goto Fill;
m->op->stop(m, p);
@@ -128,6 +133,8 @@ ssize_t seq_read(struct file *file, char __user *buf, size_t size, loff_t *ppos)
goto Enomem;
m->count = 0;
m->version = 0;
+ pos = m->index;
+ p = m->op->start(m, &pos);
}
m->op->stop(m, p);
m->count = 0;