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 ioctls to query geometry.
details: https://anonhg.NetBSD.org/src/rev/54dbeb4774f9
branches: trunk
changeset: 433815:54dbeb4774f9
user: mlelstv <mlelstv%NetBSD.org@localhost>
date: Sat Oct 06 14:59:11 2018 +0000
description:
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 fa4c7a0aed9e -r 54dbeb4774f9 sys/dev/dm/device-mapper.c
--- a/sys/dev/dm/device-mapper.c Sat Oct 06 13:53:58 2018 +0000
+++ b/sys/dev/dm/device-mapper.c Sat Oct 06 14:59:11 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: device-mapper.c,v 1.39 2017/10/28 04:53:55 riastradh Exp $ */
+/* $NetBSD: device-mapper.c,v 1.40 2018/10/06 14:59:11 mlelstv Exp $ */
/*
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -508,6 +508,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