2 * This file is part of OMAP DSP driver (DSP Gateway version 3.3.1)
4 * Copyright (C) 2004-2006 Nokia Corporation. All rights reserved.
6 * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.com>
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * version 2 as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25 struct list_head list_head;
30 static __inline__ void proc_list_add(spinlock_t *lock, struct list_head *list,
31 struct task_struct *tsk, struct file *file)
33 struct proc_list *new;
35 new = kmalloc(sizeof(struct proc_list), GFP_KERNEL);
39 list_add_tail(&new->list_head, list);
43 static __inline__ void proc_list_del(spinlock_t *lock, struct list_head *list,
44 struct task_struct *tsk, struct file *file)
49 list_for_each_entry(pl, list, list_head) {
50 if (pl->file == file) {
51 list_del(&pl->list_head);
58 /* correspinding file struct isn't found in the list ??? */
59 printk(KERN_ERR "proc_list_del(): proc_list is inconsistent!\n"
60 "struct file (%p) not found\n", file);
61 printk(KERN_ERR "listing proc_list...\n");
62 list_for_each_entry(pl, list, list_head)
63 printk(KERN_ERR " pid:%d file:%p\n", pl->pid, pl->file);
67 static __inline__ void proc_list_flush(spinlock_t *lock, struct list_head *list)
72 while (!list_empty(list)) {
73 pl = list_entry(list->next, struct proc_list, list_head);
74 list_del(&pl->list_head);