On 1/9/24 20:54, Ilya Maximets wrote:
>  void ovsdb_datum_diff(struct ovsdb_datum *diff,
> diff --git a/ovsdb/transaction.c b/ovsdb/transaction.c
> index b69d03b5a..e1a87bb74 100644
> --- a/ovsdb/transaction.c
> +++ b/ovsdb/transaction.c
> @@ -347,12 +347,13 @@ update_row_ref_count(struct ovsdb_txn *txn, struct 
> ovsdb_txn_row *r)
>                      return error;
>                  }
>              } else if (r->old && r->new) {
> -                struct ovsdb_datum added, removed;
> +                struct ovsdb_datum added, removed, *diff;
>  
> +                diff = (r->diff) ? &r->diff->fields[column->index] : NULL;

A couple more nits though: we don't need parenthesis around 'r->diff'.

>                  ovsdb_datum_added_removed(&added, &removed,
>                                            &r->old->fields[column->index],
>                                            &r->new->fields[column->index],
> -                                          &column->type);
> +                                          diff, &column->type);
>  
>                  error = ovsdb_txn_adjust_row_refs(
>                              txn, r->old, column, &removed, -1);
> @@ -760,9 +761,13 @@ assess_weak_refs(struct ovsdb_txn *txn, struct 
> ovsdb_txn_row *txn_row)
>          if (datum->n != orig_n
>              || bitmap_is_set(txn_row->changed, column->index)) {
>              if (txn_row->old) {
> +                struct ovsdb_datum *diff;
> +
> +                diff = (txn_row->diff && datum->n == orig_n)

Same nit about parenthesis here too.

> +                       ? &txn_row->diff->fields[column->index] : NULL;
>                  ovsdb_datum_added_removed(&added, &removed,
>                                            
> &txn_row->old->fields[column->index],
> -                                          datum, &column->type);
> +                                          datum, diff, &column->type);
>              } else {
>                  ovsdb_datum_clone(&added, datum);
>              }

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to