aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-07-22 19:44:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-22 19:44:08 -0400
commit0342cbcfced2ee937d7c8e1c63f3d3082da7c7dc (patch)
treefb98291d321a50de2dfd99f9bcaa33274f0c3952 /ipc
parent391d6276db9fbdedfbc30e1b56390414f0e55988 (diff)
parent7f70893173b056df691b2ee7546bb44fd9abae6a (diff)
Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: rcu: Fix wrong check in list_splice_init_rcu() net,rcu: Convert call_rcu(xt_rateest_free_rcu) to kfree_rcu() sysctl,rcu: Convert call_rcu(free_head) to kfree vmalloc,rcu: Convert call_rcu(rcu_free_vb) to kfree_rcu() vmalloc,rcu: Convert call_rcu(rcu_free_va) to kfree_rcu() ipc,rcu: Convert call_rcu(ipc_immediate_free) to kfree_rcu() ipc,rcu: Convert call_rcu(free_un) to kfree_rcu() security,rcu: Convert call_rcu(sel_netport_free) to kfree_rcu() security,rcu: Convert call_rcu(sel_netnode_free) to kfree_rcu() ia64,rcu: Convert call_rcu(sn_irq_info_free) to kfree_rcu() block,rcu: Convert call_rcu(disk_free_ptbl_rcu_cb) to kfree_rcu() scsi,rcu: Convert call_rcu(fc_rport_free_rcu) to kfree_rcu() audit_tree,rcu: Convert call_rcu(__put_tree) to kfree_rcu() security,rcu: Convert call_rcu(whitelist_item_free) to kfree_rcu() md,rcu: Convert call_rcu(free_conf) to kfree_rcu()
Diffstat (limited to 'ipc')
-rw-r--r--ipc/sem.c10
-rw-r--r--ipc/util.c16
2 files changed, 3 insertions, 23 deletions
diff --git a/ipc/sem.c b/ipc/sem.c
index 34193ed69fbe..8b929e6a6eda 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -689,12 +689,6 @@ static int count_semzcnt (struct sem_array * sma, ushort semnum)
689 return semzcnt; 689 return semzcnt;
690} 690}
691 691
692static void free_un(struct rcu_head *head)
693{
694 struct sem_undo *un = container_of(head, struct sem_undo, rcu);
695 kfree(un);
696}
697
698/* Free a semaphore set. freeary() is called with sem_ids.rw_mutex locked 692/* Free a semaphore set. freeary() is called with sem_ids.rw_mutex locked
699 * as a writer and the spinlock for this semaphore set hold. sem_ids.rw_mutex 693 * as a writer and the spinlock for this semaphore set hold. sem_ids.rw_mutex
700 * remains locked on exit. 694 * remains locked on exit.
@@ -714,7 +708,7 @@ static void freeary(struct ipc_namespace *ns, struct kern_ipc_perm *ipcp)
714 un->semid = -1; 708 un->semid = -1;
715 list_del_rcu(&un->list_proc); 709 list_del_rcu(&un->list_proc);
716 spin_unlock(&un->ulp->lock); 710 spin_unlock(&un->ulp->lock);
717 call_rcu(&un->rcu, free_un); 711 kfree_rcu(un, rcu);
718 } 712 }
719 713
720 /* Wake up all pending processes and let them fail with EIDRM. */ 714 /* Wake up all pending processes and let them fail with EIDRM. */
@@ -1612,7 +1606,7 @@ void exit_sem(struct task_struct *tsk)
1612 sem_unlock(sma); 1606 sem_unlock(sma);
1613 wake_up_sem_queue_do(&tasks); 1607 wake_up_sem_queue_do(&tasks);
1614 1608
1615 call_rcu(&un->rcu, free_un); 1609 kfree_rcu(un, rcu);
1616 } 1610 }
1617 kfree(ulp); 1611 kfree(ulp);
1618} 1612}
diff --git a/ipc/util.c b/ipc/util.c
index 5c0d28921ba8..75261a31d48d 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -579,19 +579,6 @@ static void ipc_schedule_free(struct rcu_head *head)
579 schedule_work(&sched->work); 579 schedule_work(&sched->work);
580} 580}
581 581
582/**
583 * ipc_immediate_free - free ipc + rcu space
584 * @head: RCU callback structure that contains pointer to be freed
585 *
586 * Free from the RCU callback context.
587 */
588static void ipc_immediate_free(struct rcu_head *head)
589{
590 struct ipc_rcu_grace *free =
591 container_of(head, struct ipc_rcu_grace, rcu);
592 kfree(free);
593}
594
595void ipc_rcu_putref(void *ptr) 582void ipc_rcu_putref(void *ptr)
596{ 583{
597 if (--container_of(ptr, struct ipc_rcu_hdr, data)->refcount > 0) 584 if (--container_of(ptr, struct ipc_rcu_hdr, data)->refcount > 0)
@@ -601,8 +588,7 @@ void ipc_rcu_putref(void *ptr)
601 call_rcu(&container_of(ptr, struct ipc_rcu_grace, data)->rcu, 588 call_rcu(&container_of(ptr, struct ipc_rcu_grace, data)->rcu,
602 ipc_schedule_free); 589 ipc_schedule_free);
603 } else { 590 } else {
604 call_rcu(&container_of(ptr, struct ipc_rcu_grace, data)->rcu, 591 kfree_rcu(container_of(ptr, struct ipc_rcu_grace, data), rcu);
605 ipc_immediate_free);
606 } 592 }
607} 593}
608 594