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/