Messages in this thread | | | Date | Mon, 15 Oct 2001 21:29:45 -0700 (PDT) | From | Linus Torvalds <> | Subject | Re: [CFT][PATCH] large /proc/mounts and friends |
| |
On Tue, 16 Oct 2001, Alexander Viro wrote: > > > > Al, do you see any problems in this? I bet a lot of /proc files will fit > > this model, and need only a fairly simple "fillme()" function.. > > It's _very_ close to what I've done.
Ok, now that I read it right, I agree. And not wasting the low bits of the position should allows some sparse indexing..
One comment: I really think your "lseek()+read()" interaction is fairly disgusting, though. the
for (p=m->op->start(m), i=0; i<pos; p=m->op->next(m, p), i++) { ...
thing makes it impossible to "jump" to the right location directly, which might be perfectly sane and easy for many uses. Maybe simply through a simple "seek()" interface (that could have a fall-back with the "one entry at a time" loop using the "next" interface if you think that's going to be common), and a flag that says "lseek has happened".
So you'd have the start be something like
p = m->op->start(m); if (m->did_lseek) { m->did_lseek = 0; p = m->op->seek(m, pos); } p = m->op->next(m, p);
instead of that for-loop..
Linus
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |