diff options
| author | Stephen Rothwell <sfr@canb.auug.org.au> | 2011-07-25 13:59:46 -0400 |
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-07-25 14:53:52 -0400 |
| commit | 5f00bcb38ef9a980a33c6dbdc0044964b05f22dd (patch) | |
| tree | 3175fb9375aecb50bde1be0bf4fa8aa8155131d6 /ipc | |
| parent | 34006cee28f7344f9557a4be3816c7891b1bbab1 (diff) | |
| parent | b6844e8f64920cdee620157252169ba63afb0c89 (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.c | 10 | ||||
| -rw-r--r-- | ipc/shm.c | 4 | ||||
| -rw-r--r-- | ipc/util.c | 16 |
3 files changed, 5 insertions, 25 deletions
| @@ -689,12 +689,6 @@ static int count_semzcnt (struct sem_array * sma, ushort semnum) | |||
| 689 | return semzcnt; | 689 | return semzcnt; |
| 690 | } | 690 | } |
| 691 | 691 | ||
| 692 | static 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 | } |
| @@ -277,13 +277,13 @@ static int shm_release(struct inode *ino, struct file *file) | |||
| 277 | return 0; | 277 | return 0; |
| 278 | } | 278 | } |
| 279 | 279 | ||
| 280 | static int shm_fsync(struct file *file, int datasync) | 280 | static 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 | ||
| 289 | static unsigned long shm_get_unmapped_area(struct file *file, | 289 | static 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 | */ | ||
| 588 | static 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 | |||
| 595 | void ipc_rcu_putref(void *ptr) | 582 | void 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 | ||
