Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/dm Add comment about dm_dev minor, and change it to ...



details:   https://anonhg.NetBSD.org/src/rev/de8728d72358
branches:  trunk
changeset: 759334:de8728d72358
user:      haad <haad%NetBSD.org@localhost>
date:      Mon Dec 06 08:54:49 2010 +0000

description:
Add comment about dm_dev minor, and change it to 32bit value we realy not
going to use so much device minor numbers.

diffstat:

 sys/dev/dm/dm.h       |  4 ++--
 sys/dev/dm/dm_ioctl.c |  6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diffs (45 lines):

diff -r 7c7e63288046 -r de8728d72358 sys/dev/dm/dm.h
--- a/sys/dev/dm/dm.h   Mon Dec 06 08:34:28 2010 +0000
+++ b/sys/dev/dm/dm.h   Mon Dec 06 08:54:49 2010 +0000
@@ -1,4 +1,4 @@
-/*        $NetBSD: dm.h,v 1.19 2010/10/23 21:18:54 haad Exp $      */
+/*        $NetBSD: dm.h,v 1.20 2010/12/06 08:54:49 haad Exp $      */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -124,7 +124,7 @@
        char uuid[DM_UUID_LEN];
 
        device_t devt; /* pointer to autoconf device_t structure */
-       uint64_t minor;
+       uint64_t minor; /* Device minor number */
        uint32_t flags; /* store communication protocol flags */
 
        kmutex_t dev_mtx; /* mutex for generall device lock */
diff -r 7c7e63288046 -r de8728d72358 sys/dev/dm/dm_ioctl.c
--- a/sys/dev/dm/dm_ioctl.c     Mon Dec 06 08:34:28 2010 +0000
+++ b/sys/dev/dm/dm_ioctl.c     Mon Dec 06 08:54:49 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dm_ioctl.c,v 1.22 2010/05/18 15:01:17 haad Exp $      */
+/* $NetBSD: dm_ioctl.c,v 1.23 2010/12/06 08:54:49 haad Exp $      */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -93,7 +93,7 @@
 #include "netbsd-dm.h"
 #include "dm.h"
 
-static uint64_t sc_minor_num;
+static uint32_t sc_minor_num;
 extern const struct dkdriver dmdkdriver;
 uint64_t dm_dev_counter;
 
@@ -236,7 +236,7 @@
        if (name)
                strlcpy(dmv->name, name, DM_NAME_LEN);
 
-       dmv->minor = atomic_inc_64_nv(&sc_minor_num);
+       dmv->minor = (uint64_t)atomic_inc_32_nv(&sc_minor_num);
        dmv->flags = 0;         /* device flags are set when needed */
        dmv->ref_cnt = 0;
        dmv->event_nr = 0;



Home | Main Index | Thread Index | Old Index