Introduce lminor(dev_t dev), which returns a linear minor number,
ie: hides the fact that the major number is stuck in the middle.
This commit is contained in:
parent
2ce66fb320
commit
9a27d57978
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=49826
@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: kern_conf.c,v 1.55 1999/08/08 18:42:47 phk Exp $
|
||||
* $Id: kern_conf.c,v 1.56 1999/08/13 10:29:20 phk Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -194,6 +194,17 @@ minor(dev_t x)
|
||||
return(x->si_udev & 0xffff00ff);
|
||||
}
|
||||
|
||||
int
|
||||
lminor(dev_t x)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (x == NODEV)
|
||||
return NOUDEV;
|
||||
i = minor(x);
|
||||
return ((i & 0xff) | (i >> 8));
|
||||
}
|
||||
|
||||
dev_t
|
||||
makebdev(int x, int y)
|
||||
{
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)conf.h 8.5 (Berkeley) 1/9/95
|
||||
* $Id: conf.h,v 1.72 1999/08/13 16:29:27 phk Exp $
|
||||
* $Id: conf.h,v 1.73 1999/08/14 11:40:49 phk Exp $
|
||||
*/
|
||||
|
||||
#ifndef _SYS_CONF_H_
|
||||
@ -267,6 +267,7 @@ int iskmemdev __P((dev_t dev));
|
||||
int iszerodev __P((dev_t dev));
|
||||
dev_t makebdev __P((int maj, int min));
|
||||
dev_t make_dev __P((struct cdevsw *devsw, int minor, uid_t uid, gid_t gid, int perms, char *fmt, ...)) __printflike(6, 7);
|
||||
int lminor __P((dev_t dev));
|
||||
void setconf __P((void));
|
||||
|
||||
/*
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)conf.h 8.5 (Berkeley) 1/9/95
|
||||
* $Id: conf.h,v 1.72 1999/08/13 16:29:27 phk Exp $
|
||||
* $Id: conf.h,v 1.73 1999/08/14 11:40:49 phk Exp $
|
||||
*/
|
||||
|
||||
#ifndef _SYS_CONF_H_
|
||||
@ -267,6 +267,7 @@ int iskmemdev __P((dev_t dev));
|
||||
int iszerodev __P((dev_t dev));
|
||||
dev_t makebdev __P((int maj, int min));
|
||||
dev_t make_dev __P((struct cdevsw *devsw, int minor, uid_t uid, gid_t gid, int perms, char *fmt, ...)) __printflike(6, 7);
|
||||
int lminor __P((dev_t dev));
|
||||
void setconf __P((void));
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user