Rename the minor' argument of make_dev(9) to unit'.

To prevent any further confusion about device minor and unit numbers,
we'd better just refer to device unit numbers. Many people still think
the numbers we show inside devfs have any relation to the numbers passed
to make_dev(9), which is not the case.

Discussed with:	kib
This commit is contained in:
Ed Schouten 2008-09-26 14:31:24 +00:00
parent d3ce832719
commit edde874555
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=183382
3 changed files with 18 additions and 18 deletions

View File

@ -44,11 +44,11 @@ and DEVFS registration for devices
.In sys/param.h
.In sys/conf.h
.Ft struct cdev *
.Fn make_dev "struct cdevsw *cdevsw" "int minor" "uid_t uid" "gid_t gid" "int perms" "const char *fmt" ...
.Fn make_dev "struct cdevsw *cdevsw" "int unit" "uid_t uid" "gid_t gid" "int perms" "const char *fmt" ...
.Ft struct cdev *
.Fn make_dev_cred "struct cdevsw *cdevsw" "int minor" "struct ucred *cr" "uid_t uid" "gid_t gid" "int perms" "const char *fmt" ...
.Fn make_dev_cred "struct cdevsw *cdevsw" "int unit" "struct ucred *cr" "uid_t uid" "gid_t gid" "int perms" "const char *fmt" ...
.Ft struct cdev *
.Fn make_dev_credf "int flags" "struct cdevsw *cdevsw" "int minor" "struct ucred *cr" "uid_t uid" "gid_t gid" "int perms" "const char *fmt" ...
.Fn make_dev_credf "int flags" "struct cdevsw *cdevsw" "int unit" "struct ucred *cr" "uid_t uid" "gid_t gid" "int perms" "const char *fmt" ...
.Ft struct cdev *
.Fn make_dev_alias "struct cdev *pdev" "const char *fmt" ...
.Ft void
@ -148,14 +148,14 @@ The
.Fn make_dev_cred
function is equivalent to the call
.Bd -literal -offset indent
make_dev_credf(0, cdevsw, minor, cr, uid, gid, perms, fmt, ...);
make_dev_credf(0, cdevsw, unit, cr, uid, gid, perms, fmt, ...);
.Ed .
.Pp
The
.Fn make_dev
function call is the same as
.Bd -literal -offset indent
make_dev_credf(0, cdevsw, minor, NULL, uid, gid, perms, fmt, ...);
make_dev_credf(0, cdevsw, unit, NULL, uid, gid, perms, fmt, ...);
.Ed .
.Pp
The
@ -184,7 +184,7 @@ that are available to store state.
Both fields are of type
.Ft void * .
These are designed to replace the
.Fa minor
.Fa unit
argument to
.Fn make_dev .
.Pp

View File

@ -55,7 +55,7 @@ static void destroy_devl(struct cdev *dev);
static int destroy_dev_sched_cbl(struct cdev *dev,
void (*cb)(void *), void *arg);
static struct cdev *make_dev_credv(int flags,
struct cdevsw *devsw, int minornr,
struct cdevsw *devsw, int unit,
struct ucred *cr, uid_t uid, gid_t gid, int mode, const char *fmt,
va_list ap);
@ -649,7 +649,7 @@ prep_cdevsw(struct cdevsw *devsw)
}
struct cdev *
make_dev_credv(int flags, struct cdevsw *devsw, int minornr,
make_dev_credv(int flags, struct cdevsw *devsw, int unit,
struct ucred *cr, uid_t uid,
gid_t gid, int mode, const char *fmt, va_list ap)
{
@ -659,7 +659,7 @@ make_dev_credv(int flags, struct cdevsw *devsw, int minornr,
dev = devfs_alloc();
dev_lock();
prep_cdevsw(devsw);
dev = newdev(devsw, minornr, dev);
dev = newdev(devsw, unit, dev);
if (flags & MAKEDEV_REF)
dev_refl(dev);
if (dev->si_flags & SI_CHEAPCLONE &&
@ -701,34 +701,34 @@ make_dev_credv(int flags, struct cdevsw *devsw, int minornr,
}
struct cdev *
make_dev(struct cdevsw *devsw, int minornr, uid_t uid, gid_t gid, int mode,
make_dev(struct cdevsw *devsw, int unit, uid_t uid, gid_t gid, int mode,
const char *fmt, ...)
{
struct cdev *dev;
va_list ap;
va_start(ap, fmt);
dev = make_dev_credv(0, devsw, minornr, NULL, uid, gid, mode, fmt, ap);
dev = make_dev_credv(0, devsw, unit, NULL, uid, gid, mode, fmt, ap);
va_end(ap);
return (dev);
}
struct cdev *
make_dev_cred(struct cdevsw *devsw, int minornr, struct ucred *cr, uid_t uid,
make_dev_cred(struct cdevsw *devsw, int unit, struct ucred *cr, uid_t uid,
gid_t gid, int mode, const char *fmt, ...)
{
struct cdev *dev;
va_list ap;
va_start(ap, fmt);
dev = make_dev_credv(0, devsw, minornr, cr, uid, gid, mode, fmt, ap);
dev = make_dev_credv(0, devsw, unit, cr, uid, gid, mode, fmt, ap);
va_end(ap);
return (dev);
}
struct cdev *
make_dev_credf(int flags, struct cdevsw *devsw, int minornr,
make_dev_credf(int flags, struct cdevsw *devsw, int unit,
struct ucred *cr, uid_t uid,
gid_t gid, int mode, const char *fmt, ...)
{
@ -736,7 +736,7 @@ make_dev_credf(int flags, struct cdevsw *devsw, int minornr,
va_list ap;
va_start(ap, fmt);
dev = make_dev_credv(flags, devsw, minornr, cr, uid, gid, mode,
dev = make_dev_credv(flags, devsw, unit, cr, uid, gid, mode,
fmt, ap);
va_end(ap);

View File

@ -258,15 +258,15 @@ void dev_ref(struct cdev *dev);
void dev_refl(struct cdev *dev);
void dev_rel(struct cdev *dev);
void dev_strategy(struct cdev *dev, struct buf *bp);
struct cdev *make_dev(struct cdevsw *_devsw, int _minor, uid_t _uid, gid_t _gid,
struct cdev *make_dev(struct cdevsw *_devsw, int _unit, uid_t _uid, gid_t _gid,
int _perms, const char *_fmt, ...) __printflike(6, 7);
struct cdev *make_dev_cred(struct cdevsw *_devsw, int _minor,
struct cdev *make_dev_cred(struct cdevsw *_devsw, int _unit,
struct ucred *_cr, uid_t _uid, gid_t _gid, int _perms,
const char *_fmt, ...) __printflike(7, 8);
#define MAKEDEV_REF 0x1
#define MAKEDEV_WHTOUT 0x2
struct cdev *make_dev_credf(int _flags,
struct cdevsw *_devsw, int _minornr,
struct cdevsw *_devsw, int _unit,
struct ucred *_cr, uid_t _uid, gid_t _gid, int _mode,
const char *_fmt, ...) __printflike(8, 9);
struct cdev *make_dev_alias(struct cdev *_pdev, const char *_fmt, ...) __printflike(2, 3);