util.c (2fc2991175bf77395e6b15fe6b2304d3bf72da40) util.c (1e5d533142c1c178a31d4cc81837eb078f9269bc)
1/*
2 * linux/ipc/util.c
3 * Copyright (C) 1992 Krishna Balasubramanian
4 *
5 * Sep 1997 - Call suser() last after "normal" permission checks so we
6 * get BSD style process accounting right.
7 * Occurs in several places in the IPC code.
8 * Chris Evans, <chris@ferret.lmh.ox.ac.uk>

--- 396 unchanged lines hidden (view full) ---

405}
406
407void ipc_rcu_getref(void *ptr)
408{
409 container_of(ptr, struct ipc_rcu_hdr, data)->refcount++;
410}
411
412/**
1/*
2 * linux/ipc/util.c
3 * Copyright (C) 1992 Krishna Balasubramanian
4 *
5 * Sep 1997 - Call suser() last after "normal" permission checks so we
6 * get BSD style process accounting right.
7 * Occurs in several places in the IPC code.
8 * Chris Evans, <chris@ferret.lmh.ox.ac.uk>

--- 396 unchanged lines hidden (view full) ---

405}
406
407void ipc_rcu_getref(void *ptr)
408{
409 container_of(ptr, struct ipc_rcu_hdr, data)->refcount++;
410}
411
412/**
413 * ipc_schedule_free - free ipc + rcu space
413 * ipc_schedule_free - free ipc + rcu space
414 * @head: RCU callback structure for queued work
414 *
415 * Since RCU callback function is called in bh,
416 * we need to defer the vfree to schedule_work
417 */
418static void ipc_schedule_free(struct rcu_head *head)
419{
420 struct ipc_rcu_grace *grace =
421 container_of(head, struct ipc_rcu_grace, rcu);
422 struct ipc_rcu_sched *sched =
423 container_of(&(grace->data[0]), struct ipc_rcu_sched, data[0]);
424
425 INIT_WORK(&sched->work, vfree, sched);
426 schedule_work(&sched->work);
427}
428
429/**
415 *
416 * Since RCU callback function is called in bh,
417 * we need to defer the vfree to schedule_work
418 */
419static void ipc_schedule_free(struct rcu_head *head)
420{
421 struct ipc_rcu_grace *grace =
422 container_of(head, struct ipc_rcu_grace, rcu);
423 struct ipc_rcu_sched *sched =
424 container_of(&(grace->data[0]), struct ipc_rcu_sched, data[0]);
425
426 INIT_WORK(&sched->work, vfree, sched);
427 schedule_work(&sched->work);
428}
429
430/**
430 * ipc_immediate_free - free ipc + rcu space
431 * ipc_immediate_free - free ipc + rcu space
432 * @head: RCU callback structure that contains pointer to be freed
431 *
433 *
432 * Free from the RCU callback context
433 *
434 * Free from the RCU callback context
434 */
435static void ipc_immediate_free(struct rcu_head *head)
436{
437 struct ipc_rcu_grace *free =
438 container_of(head, struct ipc_rcu_grace, rcu);
439 kfree(free);
440}
441

--- 295 unchanged lines hidden ---
435 */
436static void ipc_immediate_free(struct rcu_head *head)
437{
438 struct ipc_rcu_grace *free =
439 container_of(head, struct ipc_rcu_grace, rcu);
440 kfree(free);
441}
442

--- 295 unchanged lines hidden ---