lib/ovsdb-idl.c
/* Inserts a new Set Operation into current transaction. */
Inserts a new Set Operation into current transaction.
Inserts a new Set Operation into current transaction .
static void
ovsdb_idl_txn_add_set_op(struct ovsdb_idl_row *row,
                         const struct ovsdb_idl_column *column,
                         struct ovsdb_datum *datum,
                         enum set_op_type op_type)
{
    const struct ovsdb_idl_table_class *class;
    size_t column_idx;
    struct set_op *set_op;
    class = row->table->class_;
    column_idx = column - class->columns;
    if (!row->set_op_written) {
        row->set_op_written = bitmap_allocate(class->n_columns);
        row->set_op_lists = xzalloc(class->n_columns *
                                    sizeof *row->set_op_lists);
    }
    if (!row->set_op_lists[column_idx]) {
        row->set_op_lists[column_idx] = set_op_list_create();
    }
    set_op = set_op_create(datum, op_type);
    bitmap_set1(row->set_op_written, column_idx);
    set_op_list_add(row->set_op_lists[column_idx], set_op, &column->type);
    if (hmap_node_is_null(&row->txn_node)) {
        hmap_insert(&row->table->db->txn->txn_rows, &row->txn_node,
                    uuid_hash(&row->uuid));
    }
}
static void ovsdb_idl_txn_add_set_op ( struct ovsdb_idl_row * row , const struct ovsdb_idl_column * column , struct ovsdb_datum * datum , enum set_op_type op_type ) { const struct ovsdb_idl_table_class * class ; size_t column_idx ; struct set_op * set_op ; class = row -> table -> class_ ; column_idx = column - class -> columns ; if ( ! row -> set_op_written ) { row -> set_op_written = bitmap_allocate ( class -> n_columns ) ; row -> set_op_lists = xzalloc ( class -> n_columns * sizeof * row -> set_op_lists ) ; } if ( ! row -> set_op_lists [ column_idx ] ) { row -> set_op_lists [ column_idx ] = set_op_list_create ( ) ; } set_op = set_op_create ( datum , op_type ) ; bitmap_set1 ( row -> set_op_written , column_idx ) ; set_op_list_add ( row -> set_op_lists [ column_idx ] , set_op , & column -> type ) ; if ( hmap_node_is_null ( & row -> txn_node ) ) { hmap_insert ( & row -> table -> db -> txn -> txn_rows , & row -> txn_node , uuid_hash ( & row -> uuid ) ) ; } }
Inserts a new Set Operation into current transaction.
Inserts a new Set Operation into current transaction .
/* Check if a set operation list exists for this column. */ /* Add a set operation to the corresponding list. */ /* Add this row to the transactions's list of rows. */