NODEVFS cleanup:

Replace devfs_{create,destroy} hooks with direct function calls.
This commit is contained in:
Poul-Henning Kamp 2003-03-02 13:35:30 +00:00
parent 0e0def197a
commit 9285a87efd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=111730
4 changed files with 10 additions and 25 deletions

View File

@ -377,7 +377,7 @@ devfs_populate(struct devfs_mount *dm)
return (0);
}
static void
void
devfs_create(dev_t dev)
{
int ino, i, *ip;
@ -426,7 +426,7 @@ devfs_create(dev_t dev)
devfs_attemptoverflow(0);
}
static void
void
devfs_destroy(dev_t dev)
{
int ino, i;
@ -447,8 +447,7 @@ devfs_destroy(dev_t dev)
static void
devfs_init(void *junk)
{
devfs_create_hook = devfs_create;
devfs_destroy_hook = devfs_destroy;
devfs_rules_init();
}

View File

@ -62,9 +62,6 @@ static LIST_HEAD(, cdev) dev_hash[DEVT_HASH];
static LIST_HEAD(, cdev) dev_free;
devfs_create_t *devfs_create_hook;
devfs_destroy_t *devfs_destroy_hook;
static int ready_for_devs;
static int free_devt;
@ -332,8 +329,7 @@ make_dev(struct cdevsw *devsw, int minor, uid_t uid, gid_t gid, int perms, const
dev->si_mode = perms;
dev->si_flags |= SI_NAMED;
if (devfs_create_hook)
devfs_create_hook(dev);
devfs_create(dev);
return (dev);
}
@ -378,8 +374,7 @@ make_dev_alias(dev_t pdev, const char *fmt, ...)
}
va_end(ap);
if (devfs_create_hook)
devfs_create_hook(dev);
devfs_create(dev);
return (dev);
}
@ -407,8 +402,7 @@ destroy_dev(dev_t dev)
return;
}
if (devfs_destroy_hook)
devfs_destroy_hook(dev);
devfs_destroy(dev);
if (dev->si_flags & SI_CHILD) {
LIST_REMOVE(dev, si_siblings);
dev->si_flags &= ~SI_CHILD;

View File

@ -324,12 +324,8 @@ int unit2minor(int _unit);
void setconf(void);
dev_t getdiskbyname(char *_name);
/* This is type of the function DEVFS uses to hook into the kernel with */
typedef void devfs_create_t(dev_t dev);
typedef void devfs_destroy_t(dev_t dev);
extern devfs_create_t *devfs_create_hook;
extern devfs_destroy_t *devfs_destroy_hook;
void devfs_create(dev_t dev);
void devfs_destroy(dev_t dev);
#define UID_ROOT 0
#define UID_BIN 3

View File

@ -324,12 +324,8 @@ int unit2minor(int _unit);
void setconf(void);
dev_t getdiskbyname(char *_name);
/* This is type of the function DEVFS uses to hook into the kernel with */
typedef void devfs_create_t(dev_t dev);
typedef void devfs_destroy_t(dev_t dev);
extern devfs_create_t *devfs_create_hook;
extern devfs_destroy_t *devfs_destroy_hook;
void devfs_create(dev_t dev);
void devfs_destroy(dev_t dev);
#define UID_ROOT 0
#define UID_BIN 3