Lines Matching defs:el
1345 struct tdb_transaction_el *el;
1348 for (el=tdb->transaction->elements_last;el;el=el->prev) {
1351 if (off+len <= el->offset) {
1354 if (off >= el->offset + el->length) {
1360 if (off < el->offset) {
1361 partial = el->offset - off;
1369 if (off + len <= el->offset + el->length) {
1372 partial = el->offset + el->length - off;
1374 memcpy(buf, el->data + (off - el->offset), partial);
1406 struct tdb_transaction_el *el, *best_el=NULL;
1421 for (el=tdb->transaction->elements_last;el;el=el->prev) {
1424 if (best_el == NULL && off == el->offset+el->length) {
1425 best_el = el;
1428 if (off+len <= el->offset) {
1431 if (off >= el->offset + el->length) {
1437 if (off < el->offset) {
1438 partial = el->offset - off;
1446 if (off + len <= el->offset + el->length) {
1449 partial = el->offset + el->length - off;
1451 memcpy(el->data + (off - el->offset), buf, partial);
1468 el = best_el;
1469 el->data = (unsigned char *)realloc(el->data,
1470 el->length + len);
1471 if (el->data == NULL) {
1474 el->data = data;
1478 memcpy(el->data + el->length, buf, len);
1480 memset(el->data + el->length, TDB_PAD_BYTE, len);
1482 el->length += len;
1487 el = (struct tdb_transaction_el *)malloc(sizeof(*el));
1488 if (el == NULL) {
1493 el->next = NULL;
1494 el->prev = tdb->transaction->elements_last;
1495 el->offset = off;
1496 el->length = len;
1497 el->data = (unsigned char *)malloc(len);
1498 if (el->data == NULL) {
1499 free(el);
1505 memcpy(el->data, buf, len);
1507 memset(el->data, TDB_PAD_BYTE, len);
1509 if (el->prev) {
1510 el->prev->next = el;
1512 tdb->transaction->elements = el;
1514 tdb->transaction->elements_last = el;
1712 struct tdb_transaction_el *el = tdb->transaction->elements;
1713 tdb->transaction->elements = el->next;
1714 free(el->data);
1715 free(el);
1778 struct tdb_transaction_el *el;
1782 for (el=tdb->transaction->elements;el;el=el->next) {
1783 if (el->offset >= tdb->transaction->old_map_size) {
1786 recovery_size += 2*sizeof(tdb_off_t) + el->length;
1880 struct tdb_transaction_el *el;
1915 for (el=tdb->transaction->elements;el;el=el->next) {
1916 if (el->offset >= old_map_size) {
1919 if (el->offset + el->length > tdb->transaction->old_map_size) {
1925 memcpy(p, &el->offset, 4);
1926 memcpy(p+4, &el->length, 4);
1933 if (methods->tdb_read(tdb, el->offset, p + 8, el->length, 0) != 0) {
1938 p += 8 + el->length;
2070 struct tdb_transaction_el *el = tdb->transaction->elements;
2072 if (methods->tdb_write(tdb, el->offset, el->data, el->length) == -1) {
2087 tdb->transaction->elements = el->next;
2088 free(el->data);
2089 free(el);