aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/util.c
diff options
context:
space:
mode:
authorRafael Aquini <aquini@redhat.com>2014-01-27 20:07:02 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-28 00:02:39 -0500
commit72a8ff2f9245128c254387c58f948f1f0152ea46 (patch)
tree176eec6a1d264e9e679d7bd73eb3f5b77975e4a3 /ipc/util.c
parent0f3d2b0135f4bdbfe47a99753923a64efd373d11 (diff)
ipc: change kern_ipc_perm.deleted type to bool
struct kern_ipc_perm.deleted is meant to be used as a boolean toggle, and the changes introduced by this patch are just to make the case explicit. Signed-off-by: Rafael Aquini <aquini@redhat.com> Reviewed-by: Rik van Riel <riel@redhat.com> Cc: Greg Thelen <gthelen@google.com> Acked-by: Davidlohr Bueso <davidlohr@hp.com> Cc: Manfred Spraul <manfred@colorfullife.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'ipc/util.c')
-rw-r--r--ipc/util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ipc/util.c b/ipc/util.c
index 3ae17a4ace5b..9dc67fa4308c 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -286,7 +286,7 @@ int ipc_addid(struct ipc_ids* ids, struct kern_ipc_perm* new, int size)
286 idr_preload(GFP_KERNEL); 286 idr_preload(GFP_KERNEL);
287 287
288 spin_lock_init(&new->lock); 288 spin_lock_init(&new->lock);
289 new->deleted = 0; 289 new->deleted = false;
290 rcu_read_lock(); 290 rcu_read_lock();
291 spin_lock(&new->lock); 291 spin_lock(&new->lock);
292 292
@@ -447,7 +447,7 @@ void ipc_rmid(struct ipc_ids *ids, struct kern_ipc_perm *ipcp)
447 447
448 ids->in_use--; 448 ids->in_use--;
449 449
450 ipcp->deleted = 1; 450 ipcp->deleted = true;
451 451
452 return; 452 return;
453} 453}
@@ -657,7 +657,7 @@ struct kern_ipc_perm *ipc_lock(struct ipc_ids *ids, int id)
657 /* ipc_rmid() may have already freed the ID while ipc_lock 657 /* ipc_rmid() may have already freed the ID while ipc_lock
658 * was spinning: here verify that the structure is still valid 658 * was spinning: here verify that the structure is still valid
659 */ 659 */
660 if (!out->deleted) 660 if (ipc_valid_object(out))
661 return out; 661 return out;
662 662
663 spin_unlock(&out->lock); 663 spin_unlock(&out->lock);