* this to whatever you like, and change it once the file is opened (the next
* file opened will not see this change).
*
- * Returns a handle which may later be used in a call to devfs_unregister().
* On failure %NULL is returned.
*/
/* we don't accept any flags anymore. prototype will change soon. */
WARN_ON(flags);
+ WARN_ON(dir);
if (name == NULL)
{
}
} /* End Function _devfs_unregister */
-
-/**
- * devfs_unregister - Unregister a device entry.
- * @de: A handle previously created by devfs_register() or returned from
- * devfs_get_handle(). If this is %NULL the routine does nothing.
- */
-
-void devfs_unregister (devfs_handle_t de)
-{
- VERIFY_ENTRY (de);
- if ( (de == NULL) || (de->parent == NULL) ) return;
- DPRINTK (DEBUG_UNREGISTER, "(%s): de: %p refcount: %d\n",
- de->name, de, atomic_read (&de->refcount) );
- write_lock (&de->parent->u.dir.lock);
- _devfs_unregister (de->parent, de);
- devfs_put (de);
-} /* End Function devfs_unregister */
-
static int devfs_do_symlink (devfs_handle_t dir, const char *name,
const char *link, devfs_handle_t *handle)
{
* Use of this function is optional. The devfs_register() function
* will automatically create intermediate directories as needed. This function
* is provided for efficiency reasons, as it provides a handle to a directory.
- * Returns a handle which may later be used in a call to devfs_unregister().
* On failure %NULL is returned.
*/
n = vsnprintf(buf, 64, fmt, args);
if (n < 64 && buf[0]) {
devfs_handle_t de = _devfs_find_entry(NULL, buf, 0);
- devfs_unregister(de);
+
+ write_lock(&de->parent->u.dir.lock);
+ _devfs_unregister(de->parent, de);
+ devfs_put(de);
devfs_put(de);
}
}
EXPORT_SYMBOL(devfs_put);
EXPORT_SYMBOL(devfs_register);
-EXPORT_SYMBOL(devfs_unregister);
EXPORT_SYMBOL(devfs_mk_symlink);
EXPORT_SYMBOL(devfs_mk_dir);
EXPORT_SYMBOL(devfs_remove);
unsigned int flags,
unsigned int major, unsigned int minor,
umode_t mode, void *ops, void *info);
-extern void devfs_unregister (devfs_handle_t de);
extern int devfs_mk_symlink (const char *name, const char *link);
extern devfs_handle_t devfs_mk_dir(const char *fmt, ...)
__attribute__((format (printf, 1, 2)));
{
return NULL;
}
-static inline void devfs_unregister (devfs_handle_t de)
-{
- return;
-}
static inline int devfs_mk_symlink (const char *name, const char *link)
{
return 0;