Don't remove_proc_entry under nklock
PATCH 1/2 Don't remove_proc_entry under nklock
--- ChangeLog | 3 +++ ksrc/nucleus/module.c | 5 ++--- ksrc/nucleus/shadow.c | 14 +++++++++++--- 3 files changed, 16 insertions(+), 6 deletions(-)
ksrc/nucleus/shadow.c +11 -3
@@ -115,7 +115,7 @@ static int nucleus_muxid = -1;void xnpod_declare_iface_proc (struct xnskentry *iface); -void xnpod_discard_iface_proc (struct xnskentry *iface); +void xnpod_discard_iface_proc (const char *iface);#ifdef CONFIG_XENO_OPT_PRIOCPL
@@ -2266,7 +2266,7 @@ int xnshadow_register_interface(const ch }/* -* xnshadow_unregister_interface() -- Unregister a new skin/interface. +* xnshadow_unregister_interface() -- Unregister a skin/interface. * NOTE: an interface can be unregistered without its pod being * necessarily active. */
@@ -2287,7 +2287,15 @@ int xnshadow_unregister_interface(int mu muxtable[muxid].magic =0 ;xnarch_atomic_set (&muxtable[muxid].refcnt,-1 );#ifdef CONFIG_PROC_FS -xnpod_discard_iface_proc (muxtable + muxid); + { +const char *name = muxtable[muxid].name; + muxtable[muxid].proc =NULL ; +xnlock_put_irqrestore (&nklock, s); + +xnpod_discard_iface_proc (name); + +return 0 ; + }#endif /* CONFIG_PROC_FS */ }else err = -EBUSY ;
ksrc/nucleus/module.c +2 -3
@@ -939,10 +939,9 @@ void xnpod_declare_iface_proc(struct xns iface_proc_root); } -void xnpod_discard_iface_proc (struct xnskentry *iface) +void xnpod_discard_iface_proc (const char *iface_name) { -remove_proc_entry (iface->name, iface_proc_root); - iface->proc =NULL ; +remove_proc_entry (iface_name, iface_proc_root); }#endif /* CONFIG_XENO_OPT_PERVASIVE */
ChangeLog +3 -0
@@ -3,6 +3,9 @@ * ksrc/skins/rtdm/device.c (rtdm_dev_register): Unconditinally check if mandatory close_nrt is provided. + * ksrc/nucleus/{module.c, shadow.c}: Move remove_proc_entry out of + nklock. + 2007-06-02 Philippe Gerum <[email protected]> * ksrc/skins/psos+, src/skins/psos+, include/psos+/psos.h: Add