libjio.h | libjio.h | |||
---|---|---|---|---|
skipping to change at line 156 | skipping to change at line 156 | |||
jtrans_t *jtrans_new(jfs_t *fs, unsigned int flags); | jtrans_t *jtrans_new(jfs_t *fs, unsigned int flags); | |||
/** Add a write operation to a transaction. | /** Add a write operation to a transaction. | |||
* | * | |||
* A write operation consists of a buffer, its length, and the offset to wr ite | * A write operation consists of a buffer, its length, and the offset to wr ite | |||
* it to. | * it to. | |||
* | * | |||
* The file will not be touched (not even locked) until commit time, where the | * The file will not be touched (not even locked) until commit time, where the | |||
* first count bytes of buf will be written at offset. | * first count bytes of buf will be written at offset. | |||
* | * | |||
* Transactions will be applied in order, and overlapping operations are | * Operations will be applied in order, and overlapping operations are | |||
* permitted, in which case the latest one will prevail. | * permitted, in which case the latest one will prevail. | |||
* | * | |||
* The buffer will be copied internally and can be free()d right after this | * The buffer will be copied internally and can be free()d right after this | |||
* function returns. | * function returns. | |||
* | * | |||
* @param ts transaction | * @param ts transaction | |||
* @param buf buffer to write | * @param buf buffer to write | |||
* @param count how many bytes from the buffer to write | * @param count how many bytes from the buffer to write | |||
* @param offset offset to write at | * @param offset offset to write at | |||
* @returns 0 on success, -1 on error | * @returns 0 on success, -1 on error | |||
skipping to change at line 183 | skipping to change at line 183 | |||
* An operation consists of a buffer, its length, and the offset to read it | * An operation consists of a buffer, its length, and the offset to read it | |||
* from. | * from. | |||
* | * | |||
* The file will not be touched (not even locked) until commit time, where the | * The file will not be touched (not even locked) until commit time, where the | |||
* first count bytes at offset will be read into buf. | * first count bytes at offset will be read into buf. | |||
* | * | |||
* Note that if there is not enough data in the file to read the specified | * Note that if there is not enough data in the file to read the specified | |||
* amount of bytes, the commit will fail, so do not attempt to read beyond EOF | * amount of bytes, the commit will fail, so do not attempt to read beyond EOF | |||
* (you can use jread() for that purpose). | * (you can use jread() for that purpose). | |||
* | * | |||
* Transactions will be applied in order, and overlapping operations are | * Operations will be applied in order, and overlapping operations are | |||
* permitted, in which case the latest one will prevail. | * permitted, in which case the latest one will prevail. | |||
* | * | |||
* In case of an error in jtrans_commit(), the contents of the buffer are | * In case of an error in jtrans_commit(), the contents of the buffer are | |||
* undefined. | * undefined. | |||
* | * | |||
* @param ts transaction | * @param ts transaction | |||
* @param buf buffer to read to | * @param buf buffer to read to | |||
* @param count how many bytes to read | * @param count how many bytes to read | |||
* @param offset offset to read at | * @param offset offset to read at | |||
* @returns 0 on success, -1 on error | * @returns 0 on success, -1 on error | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||