aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2011-07-25 13:59:46 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-07-25 14:53:52 -0400
commit5f00bcb38ef9a980a33c6dbdc0044964b05f22dd (patch)
tree3175fb9375aecb50bde1be0bf4fa8aa8155131d6 /ipc
parent34006cee28f7344f9557a4be3816c7891b1bbab1 (diff)
parentb6844e8f64920cdee620157252169ba63afb0c89 (diff)
Merge branch 'master' into devel and apply fixup from Stephen Rothwell:
vfs/nfs: fixup for nfs_open_context change Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'ipc')
-rw-r--r--ipc/sem.c10
-rw-r--r--ipc/shm.c4
-rw-r--r--ipc/util.c16
3 files changed, 5 insertions, 25 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/shm.c b/ipc/shm.c
index ab3385a21b27..27884adb1a90 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -277,13 +277,13 @@ static int shm_release(struct inode *ino, struct file *file)
277 return 0; 277 return 0;
278} 278}
279 279
280static int shm_fsync(struct file *file, int datasync) 280static int shm_fsync(struct file *file, loff_t start, loff_t end, int datasync)
281{ 281{
282 struct shm_file_data *sfd = shm_file_data(file); 282 struct shm_file_data *sfd = shm_file_data(file);
283 283
284 if (!sfd->file->f_op->fsync) 284 if (!sfd->file->f_op->fsync)
285 return -EINVAL; 285 return -EINVAL;
286 return sfd->file->f_op->fsync(sfd->file, datasync); 286 return sfd->file->f_op->fsync(sfd->file, start, end, datasync);
287} 287}
288 288
289static unsigned long shm_get_unmapped_area(struct file *file, 289static unsigned long shm_get_unmapped_area(struct file *file,
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