![]() | |||||||||||||
Messages in this thread |
Suparna Bhattacharya <suparna@in.ibm.com> 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ | ||||||||||||
| Last update: 2005-03-22 12:59 [from the cache] ©2003-2008 | |||||||||||||