Merge lp:~diego-biurrun/hipl/locking into lp:hipl

Proposed by Diego Biurrun
Status: Merged
Approved by: René Hummen
Approved revision: 5962
Merged at revision: 6028
Proposed branch: lp:~diego-biurrun/hipl/locking
Merge into: lp:hipl
Diff against target: 181 lines (+0/-47)
4 files modified
hipd/cookie.c (+0/-2)
hipd/hidb.c (+0/-19)
hipd/hidb.h (+0/-23)
hipd/init.c (+0/-3)
To merge this branch: bzr merge lp:~diego-biurrun/hipl/locking
Reviewer Review Type Date Requested Status
René Hummen Approve
Stefan Götz (community) Needs Information
Miika Komu Approve
Review via email: mp+64096@code.launchpad.net

Description of the change

The vestigial locking macro cruft should go.

To post a comment you must log in.
Revision history for this message
Miika Komu (miika-iki) wrote :

No threads yet, so no need for locking either.

review: Approve
Revision history for this message
Stefan Götz (stefan.goetz-deactivatedaccount) wrote :

This branch/merge proposal is a subset of and redundant with the hidb branch and its merge proposal https://code.launchpad.net/~stefan.goetz/hipl/hidb-db/+merge/61832 - Is there a specific reason to semi-cherry-pick the locking and have it as a separate merge proposal or was this an oversight perhaps?

review: Needs Information
Revision history for this message
Diego Biurrun (diego-biurrun) wrote :

On Fri, Jun 10, 2011 at 06:08:29AM +0000, Stefan Götz wrote:
> Review: Needs Information
> This branch/merge proposal is a subset of and
> redundant with the hidb branch and its merge proposal
> https://code.launchpad.net/~stefan.goetz/hipl/hidb-db/+merge/61832 -
> Is there a specific reason to semi-cherry-pick the locking and have
> it as a separate merge proposal or was this an oversight perhaps?

I looked through the individual commits of that merge proposal on
launchpad, but not at the complete diff. For some reason removing
the locking macros is part of the complete diff, but not present in
any individual commit. What gives?

Upon further investigation I notice that the merge proposal page
truncates the list of commits on the branch and does not give you
a "All revisions" link like the page for the branch itself does.
What a broken &/$%/&%(/&5 ...

I don't care who removes the locking cruft as long as it's done by
someone. So I can merge this right away or I can wait for your
branch to hit trunk, whatever you prefer.

Diego

Revision history for this message
Stefan Götz (stefan.goetz-deactivatedaccount) wrote :

> So I can merge this right away or I can wait for your
> branch to hit trunk, whatever you prefer.

I guess the first merge proposal with two 'accept' votes wins :)

Stefan

Revision history for this message
Diego Biurrun (diego-biurrun) wrote :

On Fri, Jun 10, 2011 at 11:40:07AM +0000, Stefan Götz wrote:
> > So I can merge this right away or I can wait for your
> > branch to hit trunk, whatever you prefer.
>
> I guess the first merge proposal with two 'accept' votes wins :)

Since the hidb-db branch is in a state of limbo I would like to
repropose this branch for merging. Miika already accepted it,
so please somebody give me that second vote :)

Diego

Revision history for this message
René Hummen (rene-hummen) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hipd/cookie.c'
--- hipd/cookie.c 2011-05-18 08:47:20 +0000
+++ hipd/cookie.c 2011-06-09 22:49:37 +0000
@@ -200,7 +200,6 @@
200 int idx, len;200 int idx, len;
201201
202 /* Find the proper R1 table and copy the R1 message from the table */202 /* Find the proper R1 table and copy the R1 message from the table */
203 HIP_READ_LOCK_DB(HIP_DB_LOCAL_HID);
204 HIP_IFEL(!(hid = hip_get_hostid_entry_by_lhi_and_algo(HIP_DB_LOCAL_HID,203 HIP_IFEL(!(hid = hip_get_hostid_entry_by_lhi_and_algo(HIP_DB_LOCAL_HID,
205 our_hit, HIP_ANY_ALGO, -1)),204 our_hit, HIP_ANY_ALGO, -1)),
206 NULL, "Unknown HIT\n");205 NULL, "Unknown HIT\n");
@@ -220,7 +219,6 @@
220 free(r1);219 free(r1);
221 }220 }
222221
223 HIP_READ_UNLOCK_DB(HIP_DB_LOCAL_HID);
224 return err;222 return err;
225}223}
226224
227225
=== modified file 'hipd/hidb.c'
--- hipd/hidb.c 2011-05-04 17:38:59 +0000
+++ hipd/hidb.c 2011-06-09 22:49:37 +0000
@@ -233,7 +233,6 @@
233233
234 id = hip_get_hostid_entry_by_lhi_and_algo(db, &hit, HIP_ANY_ALGO, -1);234 id = hip_get_hostid_entry_by_lhi_and_algo(db, &hit, HIP_ANY_ALGO, -1);
235 if (id == NULL) {235 if (id == NULL) {
236 HIP_WRITE_UNLOCK_DB(db);
237 HIP_ERROR("hit not found\n");236 HIP_ERROR("hit not found\n");
238 err = -ENOENT;237 err = -ENOENT;
239 return err;238 return err;
@@ -276,8 +275,6 @@
276 struct local_host_id *tmp;275 struct local_host_id *tmp;
277 int count;276 int count;
278277
279 HIP_WRITE_LOCK_DB(db);
280
281 list_for_each_safe(curr, iter, db, count) {278 list_for_each_safe(curr, iter, db, count) {
282 hip_hit_t hit;279 hip_hit_t hit;
283280
@@ -288,8 +285,6 @@
288 }285 }
289286
290 hip_ht_uninit(db);287 hip_ht_uninit(db);
291
292 HIP_WRITE_UNLOCK_DB(db);
293}288}
294289
295/**290/**
@@ -450,8 +445,6 @@
450 struct local_host_id *old_entry;445 struct local_host_id *old_entry;
451 int (*signature_func)(void *key, struct hip_common *m);446 int (*signature_func)(void *key, struct hip_common *m);
452447
453 HIP_WRITE_LOCK_DB(db);
454
455 HIP_IFEL(!(id_entry = calloc(1, sizeof(struct local_host_id))),448 HIP_IFEL(!(id_entry = calloc(1, sizeof(struct local_host_id))),
456 -ENOMEM, "No memory available for host id\n");449 -ENOMEM, "No memory available for host id\n");
457450
@@ -462,7 +455,6 @@
462 old_entry = hip_get_hostid_entry_by_lhi_and_algo(db, &hit,455 old_entry = hip_get_hostid_entry_by_lhi_and_algo(db, &hit,
463 HIP_ANY_ALGO, -1);456 HIP_ANY_ALGO, -1);
464 if (old_entry != NULL) {457 if (old_entry != NULL) {
465 HIP_WRITE_UNLOCK_DB(db);
466 HIP_ERROR("Trying to add duplicate local host ID\n");458 HIP_ERROR("Trying to add duplicate local host ID\n");
467 err = -EEXIST;459 err = -EEXIST;
468 goto out_err;460 goto out_err;
@@ -524,7 +516,6 @@
524 free(id_entry);516 free(id_entry);
525 }517 }
526518
527 HIP_WRITE_UNLOCK_DB(db);
528 return err;519 return err;
529}520}
530521
@@ -649,8 +640,6 @@
649 struct local_host_id *entry;640 struct local_host_id *entry;
650 int err = 0;641 int err = 0;
651642
652 HIP_READ_LOCK_DB(hip_local_hostid_db);
653
654 entry = hip_get_hostid_entry_by_lhi_and_algo(hip_local_hostid_db,643 entry = hip_get_hostid_entry_by_lhi_and_algo(hip_local_hostid_db,
655 NULL, algo, anon);644 NULL, algo, anon);
656 if (!entry) {645 if (!entry) {
@@ -662,7 +651,6 @@
662 err = 0;651 err = 0;
663652
664out:653out:
665 HIP_READ_UNLOCK_DB(hip_local_hostid_db);
666 return err;654 return err;
667}655}
668656
@@ -702,8 +690,6 @@
702 struct local_host_id *tmp;690 struct local_host_id *tmp;
703 int err = 0, c;691 int err = 0, c;
704692
705 HIP_READ_LOCK_DB(hip_local_hostid_db);
706
707 list_for_each_safe(curr, iter, hip_local_hostid_db, c)693 list_for_each_safe(curr, iter, hip_local_hostid_db, c)
708 {694 {
709 tmp = list_entry(curr);695 tmp = list_entry(curr);
@@ -716,8 +702,6 @@
716 }702 }
717703
718out_err:704out_err:
719 HIP_READ_UNLOCK_DB(hip_local_hostid_db);
720
721 return err;705 return err;
722}706}
723707
@@ -796,8 +780,6 @@
796 int err = 0, host_id_len;780 int err = 0, host_id_len;
797 struct local_host_id *entry = NULL;781 struct local_host_id *entry = NULL;
798782
799 HIP_READ_LOCK_DB(db);
800
801 entry = hip_get_hostid_entry_by_lhi_and_algo(db, hit, algo, -1);783 entry = hip_get_hostid_entry_by_lhi_and_algo(db, hit, algo, -1);
802 HIP_IFE(!entry, -1);784 HIP_IFE(!entry, -1);
803785
@@ -812,7 +794,6 @@
812 HIP_IFE(!*key, -1);794 HIP_IFE(!*key, -1);
813795
814out_err:796out_err:
815 HIP_READ_UNLOCK_DB(db);
816 return err;797 return err;
817}798}
818799
819800
=== modified file 'hipd/hidb.h'
--- hipd/hidb.h 2011-05-04 16:20:00 +0000
+++ hipd/hidb.h 2011-06-09 22:49:37 +0000
@@ -36,29 +36,6 @@
36#include "cookie.h"36#include "cookie.h"
3737
3838
39#if 0
40#define HIP_READ_LOCK_DB(db) do { \
41 read_lock_irqsave(&(db)->db_lock, lf); \
42} while (0)
43
44#define HIP_WRITE_LOCK_DB(db) do { \
45 write_lock_irqsave(&(db)->db_lock, lf); \
46} while (0)
47
48#define HIP_READ_UNLOCK_DB(db) do { \
49 read_unlock_irqrestore(&(db)->db_lock, lf); \
50} while (0)
51
52#define HIP_WRITE_UNLOCK_DB(db) do { \
53 write_unlock_irqrestore(&(db)->db_lock, lf); \
54} while (0)
55#else
56#define HIP_READ_LOCK_DB(db)
57#define HIP_WRITE_LOCK_DB(db)
58#define HIP_READ_UNLOCK_DB(db)
59#define HIP_WRITE_UNLOCK_DB(db)
60#endif
61
62struct local_host_id {39struct local_host_id {
63 hip_hit_t hit;40 hip_hit_t hit;
64 bool anonymous; /**< Is this an anonymous HI */41 bool anonymous; /**< Is this an anonymous HI */
6542
=== modified file 'hipd/init.c'
--- hipd/init.c 2011-05-04 16:20:00 +0000
+++ hipd/init.c 2011-06-09 22:49:37 +0000
@@ -497,8 +497,6 @@
497 int c;497 int c;
498 uint16_t algo = 0;498 uint16_t algo = 0;
499499
500 HIP_READ_LOCK_DB(hip_local_hostid_db);
501
502 list_for_each_safe(curr, iter, hip_local_hostid_db, c) {500 list_for_each_safe(curr, iter, hip_local_hostid_db, c) {
503 tmp = list_entry(curr);501 tmp = list_entry(curr);
504 HIP_DEBUG_HIT("Found HIT", &tmp->hit);502 HIP_DEBUG_HIT("Found HIT", &tmp->hit);
@@ -511,7 +509,6 @@
511 }509 }
512510
513out_err:511out_err:
514 HIP_READ_UNLOCK_DB(hip_local_hostid_db);
515 if (algo == HIP_HI_RSA) {512 if (algo == HIP_HI_RSA) {
516 return tmp;513 return tmp;
517 }514 }

Subscribers

People subscribed via source and target branches

to all changes: