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
1=== modified file 'hipd/cookie.c'
2--- hipd/cookie.c 2011-05-18 08:47:20 +0000
3+++ hipd/cookie.c 2011-06-09 22:49:37 +0000
4@@ -200,7 +200,6 @@
5 int idx, len;
6
7 /* Find the proper R1 table and copy the R1 message from the table */
8- HIP_READ_LOCK_DB(HIP_DB_LOCAL_HID);
9 HIP_IFEL(!(hid = hip_get_hostid_entry_by_lhi_and_algo(HIP_DB_LOCAL_HID,
10 our_hit, HIP_ANY_ALGO, -1)),
11 NULL, "Unknown HIT\n");
12@@ -220,7 +219,6 @@
13 free(r1);
14 }
15
16- HIP_READ_UNLOCK_DB(HIP_DB_LOCAL_HID);
17 return err;
18 }
19
20
21=== modified file 'hipd/hidb.c'
22--- hipd/hidb.c 2011-05-04 17:38:59 +0000
23+++ hipd/hidb.c 2011-06-09 22:49:37 +0000
24@@ -233,7 +233,6 @@
25
26 id = hip_get_hostid_entry_by_lhi_and_algo(db, &hit, HIP_ANY_ALGO, -1);
27 if (id == NULL) {
28- HIP_WRITE_UNLOCK_DB(db);
29 HIP_ERROR("hit not found\n");
30 err = -ENOENT;
31 return err;
32@@ -276,8 +275,6 @@
33 struct local_host_id *tmp;
34 int count;
35
36- HIP_WRITE_LOCK_DB(db);
37-
38 list_for_each_safe(curr, iter, db, count) {
39 hip_hit_t hit;
40
41@@ -288,8 +285,6 @@
42 }
43
44 hip_ht_uninit(db);
45-
46- HIP_WRITE_UNLOCK_DB(db);
47 }
48
49 /**
50@@ -450,8 +445,6 @@
51 struct local_host_id *old_entry;
52 int (*signature_func)(void *key, struct hip_common *m);
53
54- HIP_WRITE_LOCK_DB(db);
55-
56 HIP_IFEL(!(id_entry = calloc(1, sizeof(struct local_host_id))),
57 -ENOMEM, "No memory available for host id\n");
58
59@@ -462,7 +455,6 @@
60 old_entry = hip_get_hostid_entry_by_lhi_and_algo(db, &hit,
61 HIP_ANY_ALGO, -1);
62 if (old_entry != NULL) {
63- HIP_WRITE_UNLOCK_DB(db);
64 HIP_ERROR("Trying to add duplicate local host ID\n");
65 err = -EEXIST;
66 goto out_err;
67@@ -524,7 +516,6 @@
68 free(id_entry);
69 }
70
71- HIP_WRITE_UNLOCK_DB(db);
72 return err;
73 }
74
75@@ -649,8 +640,6 @@
76 struct local_host_id *entry;
77 int err = 0;
78
79- HIP_READ_LOCK_DB(hip_local_hostid_db);
80-
81 entry = hip_get_hostid_entry_by_lhi_and_algo(hip_local_hostid_db,
82 NULL, algo, anon);
83 if (!entry) {
84@@ -662,7 +651,6 @@
85 err = 0;
86
87 out:
88- HIP_READ_UNLOCK_DB(hip_local_hostid_db);
89 return err;
90 }
91
92@@ -702,8 +690,6 @@
93 struct local_host_id *tmp;
94 int err = 0, c;
95
96- HIP_READ_LOCK_DB(hip_local_hostid_db);
97-
98 list_for_each_safe(curr, iter, hip_local_hostid_db, c)
99 {
100 tmp = list_entry(curr);
101@@ -716,8 +702,6 @@
102 }
103
104 out_err:
105- HIP_READ_UNLOCK_DB(hip_local_hostid_db);
106-
107 return err;
108 }
109
110@@ -796,8 +780,6 @@
111 int err = 0, host_id_len;
112 struct local_host_id *entry = NULL;
113
114- HIP_READ_LOCK_DB(db);
115-
116 entry = hip_get_hostid_entry_by_lhi_and_algo(db, hit, algo, -1);
117 HIP_IFE(!entry, -1);
118
119@@ -812,7 +794,6 @@
120 HIP_IFE(!*key, -1);
121
122 out_err:
123- HIP_READ_UNLOCK_DB(db);
124 return err;
125 }
126
127
128=== modified file 'hipd/hidb.h'
129--- hipd/hidb.h 2011-05-04 16:20:00 +0000
130+++ hipd/hidb.h 2011-06-09 22:49:37 +0000
131@@ -36,29 +36,6 @@
132 #include "cookie.h"
133
134
135-#if 0
136-#define HIP_READ_LOCK_DB(db) do { \
137- read_lock_irqsave(&(db)->db_lock, lf); \
138-} while (0)
139-
140-#define HIP_WRITE_LOCK_DB(db) do { \
141- write_lock_irqsave(&(db)->db_lock, lf); \
142-} while (0)
143-
144-#define HIP_READ_UNLOCK_DB(db) do { \
145- read_unlock_irqrestore(&(db)->db_lock, lf); \
146-} while (0)
147-
148-#define HIP_WRITE_UNLOCK_DB(db) do { \
149- write_unlock_irqrestore(&(db)->db_lock, lf); \
150-} while (0)
151-#else
152-#define HIP_READ_LOCK_DB(db)
153-#define HIP_WRITE_LOCK_DB(db)
154-#define HIP_READ_UNLOCK_DB(db)
155-#define HIP_WRITE_UNLOCK_DB(db)
156-#endif
157-
158 struct local_host_id {
159 hip_hit_t hit;
160 bool anonymous; /**< Is this an anonymous HI */
161
162=== modified file 'hipd/init.c'
163--- hipd/init.c 2011-05-04 16:20:00 +0000
164+++ hipd/init.c 2011-06-09 22:49:37 +0000
165@@ -497,8 +497,6 @@
166 int c;
167 uint16_t algo = 0;
168
169- HIP_READ_LOCK_DB(hip_local_hostid_db);
170-
171 list_for_each_safe(curr, iter, hip_local_hostid_db, c) {
172 tmp = list_entry(curr);
173 HIP_DEBUG_HIT("Found HIT", &tmp->hit);
174@@ -511,7 +509,6 @@
175 }
176
177 out_err:
178- HIP_READ_UNLOCK_DB(hip_local_hostid_db);
179 if (algo == HIP_HI_RSA) {
180 return tmp;
181 }

Subscribers

People subscribed via source and target branches

to all changes: