Re: [PATCH linux-2.6.1-rc1-mm1] aiodio_fallback_bio_count.patch

From: Andrew Morton
Date: Mon Jan 05 2004 - 00:31:22 EST


Suparna Bhattacharya <suparna@xxxxxxxxxx> wrote:
>
> > Sure. But the generic_file_aio_write_nolock() code is doing this:
> >
> > if (written >= count && !is_sync_kiocb(iocb))
> > written = -EIOCBQUEUED;
> > if (written < 0 || written >= count)
> > goto out_status;
> >
> >
> > Under what circumstances can `written' (the amount which was written) be
> > greater than `count' (the amount to write)?
>
> None. The '>' situation should never occur.
>
> This is just being explicit about covering the "not less than" case
> as a whole, and making sure we do not fall through to buffered i/o in
> that case, i.e its the same as:
> if (!(written < count) && !is_sync_kiocb(iocb))
>
> Is that any less confusing ? Or would you rather just replace the '>=" by
> "=='.

Well the original confused the heck out of me! yes, `if (written == count)'
should be fine: it says exactly what we want it to say.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/