aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/paride/pg.c
Commit message (Expand)AuthorAge
* Merge branch 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bklLinus Torvalds2010-10-22
|\
| * llseek: automatically add .llseek fopArnd Bergmann2010-10-15
* | drivers: autoconvert trivial BKL users to private mutexArnd Bergmann2010-10-05
|/
* paride/pg.c: xs(): &&/|| confusionRoel Kluin2009-02-18
* device create: block: convert device_create_drvdata to device_createGreg Kroah-Hartman2008-10-16
* device create: block: convert device_create to device_create_drvdataGreg Kroah-Hartman2008-07-22
* paride: cdev lock_kernel() pushdownJonathan Corbet2008-06-20
* paride: Convert from class_device to device for block/parideTony Jones2008-01-24
* [PATCH] mark struct file_operations const 3Arjan van de Ven2007-02-12
* [PATCH] paride: return proper error codeAkinobu Mita2006-12-07
* [PATCH] devfs: Remove the devfs_fs_kernel.h file from the treeGreg Kroah-Hartman2006-06-26
* [PATCH] devfs: Remove devfs_remove() function from the kernel treeGreg Kroah-Hartman2006-06-26
* [PATCH] devfs: Remove devfs_mk_cdev() function from the kernel treeGreg Kroah-Hartman2006-06-26
* [PATCH] devfs: Remove devfs_mk_dir() function from the kernel treeGreg Kroah-Hartman2006-06-26
* [PATCH] paride: register_chrdev fixAndrew Morton2006-03-28
* [PATCH] fix missing includesTim Schmielau2005-10-30
* [PATCH] Driver Core: fix up all callers of class_device_create()Greg Kroah-Hartman2005-10-28
* [PATCH] drivers/block: fix-up schedule_timeout() usageNishanth Aravamudan2005-09-10
* [PATCH] class: convert drivers/block/* to use the new class api instead of cl...gregkh@suse.de2005-06-20
* Linux-2.6.12-rc2v2.6.12-rc2Linus Torvalds2005-04-16
class="hl opt">->ipcs_idr, next_id); if (perm == NULL) continue; ipc_lock_by_ptr(perm); free(ns, perm); total++; } up_write(&ids->rw_mutex); } static void free_ipc_ns(struct ipc_namespace *ns) { /* * Unregistering the hotplug notifier at the beginning guarantees * that the ipc namespace won't be freed while we are inside the * callback routine. Since the blocking_notifier_chain_XXX routines * hold a rw lock on the notifier list, unregister_ipcns_notifier() * won't take the rw lock before blocking_notifier_call_chain() has * released the rd lock. */ unregister_ipcns_notifier(ns); sem_exit_ns(ns); msg_exit_ns(ns); shm_exit_ns(ns); atomic_dec(&nr_ipc_ns); /* * Do the ipcns removal notification after decrementing nr_ipc_ns in * order to have a correct value when recomputing msgmni. */ ipcns_notify(IPCNS_REMOVED); put_user_ns(ns->user_ns); kfree(ns); } /* * put_ipc_ns - drop a reference to an ipc namespace. * @ns: the namespace to put * * If this is the last task in the namespace exiting, and * it is dropping the refcount to 0, then it can race with * a task in another ipc namespace but in a mounts namespace * which has this ipcns's mqueuefs mounted, doing some action * with one of the mqueuefs files. That can raise the refcount. * So dropping the refcount, and raising the refcount when * accessing it through the VFS, are protected with mq_lock. * * (Clearly, a task raising the refcount on its own ipc_ns * needn't take mq_lock since it can't race with the last task * in the ipcns exiting). */ void put_ipc_ns(struct ipc_namespace *ns) { if (atomic_dec_and_lock(&ns->count, &mq_lock)) { mq_clear_sbinfo(ns); spin_unlock(&mq_lock); mq_put_mnt(ns); free_ipc_ns(ns); } } static void *ipcns_get(struct task_struct *task) { struct ipc_namespace *ns = NULL; struct nsproxy *nsproxy; rcu_read_lock(); nsproxy = task_nsproxy(task); if (nsproxy) ns = get_ipc_ns(nsproxy->ipc_ns); rcu_read_unlock(); return ns; } static void ipcns_put(void *ns) { return put_ipc_ns(ns); } static int ipcns_install(struct nsproxy *nsproxy, void *ns) { /* Ditch state from the old ipc namespace */ exit_sem(current); put_ipc_ns(nsproxy->ipc_ns); nsproxy->ipc_ns = get_ipc_ns(ns); return 0; } const struct proc_ns_operations ipcns_operations = { .name = "ipc", .type = CLONE_NEWIPC, .get = ipcns_get, .put = ipcns_put, .install = ipcns_install, };