Source-Changes-HG archive

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

[src/netbsd-8]: src/sys/dev/dm Pull up following revision(s) (requested by ml...



details:   https://anonhg.NetBSD.org/src/rev/8de20fa907d9
branches:  netbsd-8
changeset: 435304:8de20fa907d9
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Oct 13 17:09:41 2018 +0000

description:
Pull up following revision(s) (requested by mlelstv in ticket #1055):

        sys/dev/dm/device-mapper.c: revision 1.40

Add ioctls to query geometry.

diffstat:

 sys/dev/dm/device-mapper.c |  38 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 37 insertions(+), 1 deletions(-)

diffs (52 lines):

diff -r d13b4d6eb198 -r 8de20fa907d9 sys/dev/dm/device-mapper.c
--- a/sys/dev/dm/device-mapper.c        Tue Oct 09 10:11:08 2018 +0000
+++ b/sys/dev/dm/device-mapper.c        Sat Oct 13 17:09:41 2018 +0000
@@ -1,4 +1,4 @@
-/*        $NetBSD: device-mapper.c,v 1.38 2016/07/11 11:31:50 msaitoh Exp $ */
+/*        $NetBSD: device-mapper.c,v 1.38.10.1 2018/10/13 17:09:41 martin Exp $ */
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -510,6 +510,42 @@
                break;
        }
 
+       case DIOCGSECTORSIZE:
+       {
+               u_int *valp = data;
+               uint64_t numsec;
+               unsigned int secsize;
+
+               if ((dmv = dm_dev_lookup(NULL, NULL, minor(dev))) == NULL)
+                       return ENODEV;
+
+               aprint_debug("DIOCGSECTORSIZE ioctl called\n");
+
+               dm_table_disksize(&dmv->table_head, &numsec, &secsize);
+               *valp = secsize;
+
+               dm_dev_unbusy(dmv);
+               break;
+       }
+
+       case DIOCGMEDIASIZE:
+       {
+               off_t *valp = data;
+               uint64_t numsec;
+               unsigned int secsize;
+
+               if ((dmv = dm_dev_lookup(NULL, NULL, minor(dev))) == NULL)
+                       return ENODEV;
+
+               aprint_debug("DIOCGMEDIASIZE ioctl called\n");
+
+               dm_table_disksize(&dmv->table_head, &numsec, &secsize);
+               *valp = numsec;
+
+               dm_dev_unbusy(dmv);
+               break;
+       }
+
 
        default:
                aprint_debug("unknown disk_ioctl called\n");



Home | Main Index | Thread Index | Old Index