• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asus-wl-520gu-7.0.1.45/src/router/e2fsprogs-1.40.8/lib/ext2fs/

Lines Matching defs:transaction

196 	tdb_off_t recovery_start; /* offset of transaction recovery region */
246 struct tdb_transaction *transaction;
582 get the transaction lock
591 TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_transaction_lock: failed to get transaction lock\n"));
600 release the transaction lock
1171 if ((tdb->transaction == NULL) && (tdb->map_ptr != NULL)) {
1229 /* file: transaction.c */
1232 transaction design:
1234 - only allow a single transaction at a time per database. This makes
1235 using the transaction API simpler, as otherwise the caller would
1239 - keep the transaction recovery information in the same file as the
1240 database, using a special 'transaction recovery' record pointed at
1244 - dynamically allocated the transaction recover record, re-using it
1251 transaction versions of tdb_read() and tdb_write() check this
1255 - don't allow any locks to be held when a transaction starts,
1259 - if the caller gains a lock during the transaction but doesn't
1263 existing transaction record. If the inner transaction is cancelled
1268 the transaction version of tdb_write
1270 - allow callers to mix transaction and non-transaction use of tdb,
1271 although once a transaction is started then an exclusive lock is
1272 gained until the transaction is committed or cancelled
1275 into a linearised buffer in the transaction recovery area, then
1276 marking the transaction recovery area with a magic value to
1282 global lock is held. Automatically recover from the transaction
1288 still available, but no transaction recovery area is used and no
1301 hold the context of any current transaction
1311 /* the list of transaction elements. We use a doubly linked
1318 /* non-zero when an internal transaction error has
1320 transaction is ended */
1323 /* when inside a transaction we need to keep track of any
1325 but don't create a new transaction */
1328 /* old file size before transaction */
1334 read while in a transaction. We need to check first if the data is in our list
1335 of transaction elements, then if not do a real read
1343 for (el=tdb->transaction->elements_last;el;el=el->prev) {
1384 /* its not in the transaction elements - do a real read */
1385 return tdb->transaction->io_methods->tdb_read(tdb, off, buf, len, cv);
1390 tdb->transaction->transaction_error = 1;
1396 write while in a transaction
1407 /* if the write is to a hash head, then update the transaction
1412 memcpy(&tdb->transaction->hash_heads[chain], buf, len);
1416 for (el=tdb->transaction->elements_last;el;el=el->prev) {
1460 (off+len < tdb->transaction->old_map_size ||
1461 off > tdb->transaction->old_map_size)) {
1468 tdb->transaction->transaction_error = 1;
1485 tdb->transaction->transaction_error = 1;
1489 el->prev = tdb->transaction->elements_last;
1496 tdb->transaction->transaction_error = 1;
1507 tdb->transaction->elements = el;
1509 tdb->transaction->elements_last = el;
1515 tdb->transaction->transaction_error = 1;
1527 if (0 != tdb->transaction->hash_heads[h+1]) {
1535 out of bounds check during a transaction
1546 transaction version of tdb_expand().
1551 /* add a write to the transaction elements, so subsequent
1561 brlock during a transaction - ignore them
1580 start a tdb transaction. No token is returned, as only a single
1581 transaction is allowed to be pending per tdb_context
1587 TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_transaction_start: cannot start a transaction on a read-only or internal db\n"));
1593 if (tdb->transaction != NULL) {
1594 tdb->transaction->nesting++;
1596 tdb->transaction->nesting));
1602 transaction as otherwise we'll be screwed by lack
1604 TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_transaction_start: cannot start a transaction with locks held\n"));
1611 traverse inside a transaction) as otherwise you can end up with
1613 TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_transaction_start: cannot start a transaction within a traverse\n"));
1618 tdb->transaction = (struct tdb_transaction *)
1620 if (tdb->transaction == NULL) {
1625 /* get the transaction write lock. This is a blocking lock. As
1629 SAFE_FREE(tdb->transaction);
1643 tdb->transaction->hash_heads = (u32 *)
1645 if (tdb->transaction->hash_heads == NULL) {
1649 if (tdb->methods->tdb_read(tdb, FREELIST_TOP, tdb->transaction->hash_heads,
1659 tdb->transaction->old_map_size = tdb->map_size;
1662 transaction specific methods */
1663 tdb->transaction->io_methods = tdb->methods;
1666 /* by calling this transaction write here, we ensure that we don't grow the
1667 transaction linked list due to hash table updates */
1668 if (transaction_write(tdb, FREELIST_TOP, tdb->transaction->hash_heads,
1672 tdb->methods = tdb->transaction->io_methods;
1681 SAFE_FREE(tdb->transaction->hash_heads);
1682 SAFE_FREE(tdb->transaction);
1688 cancel the current transaction
1692 if (tdb->transaction == NULL) {
1693 TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_transaction_cancel: no transaction\n"));
1697 if (tdb->transaction->nesting != 0) {
1698 tdb->transaction->transaction_error = 1;
1699 tdb->transaction->nesting--;
1703 tdb->map_size = tdb->transaction->old_map_size;
1705 /* free all the transaction elements */
1706 while (tdb->transaction->elements) {
1707 struct tdb_transaction_el *el = tdb->transaction->elements;
1708 tdb->transaction->elements = el->next;
1713 /* remove any global lock created during the transaction */
1719 /* remove any locks created during the transaction */
1732 tdb->methods = tdb->transaction->io_methods;
1736 SAFE_FREE(tdb->transaction->hash_heads);
1737 SAFE_FREE(tdb->transaction);
1777 for (el=tdb->transaction->elements;el;el=el->next) {
1778 if (el->offset >= tdb->transaction->old_map_size) {
1797 const struct tdb_methods *methods = tdb->transaction->io_methods;
1826 the transaction) */
1842 if (methods->tdb_expand_file(tdb, tdb->transaction->old_map_size,
1843 (tdb->map_size - tdb->transaction->old_map_size) +
1853 again in the transaction commit, which would destroy the recovery area */
1854 tdb->transaction->old_map_size = tdb->map_size;
1878 const struct tdb_methods *methods = tdb->transaction->io_methods;
1881 tdb_off_t old_map_size = tdb->transaction->old_map_size;
1910 for (el=tdb->transaction->elements;el;el=el->next) {
1914 if (el->offset + el->length > tdb->transaction->old_map_size) {
1915 TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_setup_recovery: transaction data over new region boundary\n"));
1979 commit the current transaction
1987 if (tdb->transaction == NULL) {
1988 TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_transaction_commit: no transaction\n"));
1992 if (tdb->transaction->transaction_error) {
1995 TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_transaction_commit: transaction error pending\n"));
1999 if (tdb->transaction->nesting != 0) {
2000 tdb->transaction->nesting--;
2004 /* check for a null transaction */
2005 if (tdb->transaction->elements == NULL) {
2010 methods = tdb->transaction->io_methods;
2013 nested their locks properly, so fail the transaction */
2021 /* upgrade the main transaction lock region to a write lock */
2049 if (tdb->map_size != tdb->transaction->old_map_size) {
2050 if (methods->tdb_expand_file(tdb, tdb->transaction->old_map_size,
2052 tdb->transaction->old_map_size) == -1) {
2059 tdb->map_size = tdb->transaction->old_map_size;
2064 while (tdb->transaction->elements) {
2065 struct tdb_transaction_el *el = tdb->transaction->elements;
2082 tdb->transaction->elements = el->next;
2117 mtime changes when a transaction completes */
2122 /* use a transaction cancel to free memory and remove the
2123 transaction locks */
2130 recover from an aborted transaction. Must be called with exclusive
2822 /* we need to get a read lock on the transaction lock here to
2838 a write style traverse - needs to get the transaction lock to
3212 * For mmapped tdb's that do not have a transaction open it points the parsing
3214 * case. If a transaction is open or no mmap is available, it has to do
4022 if (tdb->transaction) {
4078 if (tdb->transaction != 0) {
4079 TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_reopen: reopen not allowed inside a transaction\n"));