Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/sys Add DK_DEV_BSIZE_OK()
details: https://anonhg.NetBSD.org/src/rev/ee29dc271fc1
branches: trunk
changeset: 811724:ee29dc271fc1
user: christos <christos%NetBSD.org@localhost>
date: Thu Nov 12 15:25:22 2015 +0000
description:
Add DK_DEV_BSIZE_OK()
diffstat:
sys/sys/disk.h | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diffs (18 lines):
diff -r 73e5d4c394f0 -r ee29dc271fc1 sys/sys/disk.h
--- a/sys/sys/disk.h Thu Nov 12 15:13:03 2015 +0000
+++ b/sys/sys/disk.h Thu Nov 12 15:25:22 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: disk.h,v 1.65 2015/08/16 18:00:03 mlelstv Exp $ */
+/* $NetBSD: disk.h,v 1.66 2015/11/12 15:25:22 christos Exp $ */
/*-
* Copyright (c) 1996, 1997, 2004 The NetBSD Foundation, Inc.
@@ -519,6 +519,8 @@
#define DK_BSIZE2BLKSHIFT(b) ((ffs((b) / DEV_BSIZE)) - 1)
#define DK_BSIZE2BYTESHIFT(b) (ffs((b)) - 1)
+#define DK_DEV_BSIZE_OK(b) \
+ ((b) >= DEV_BSIZE && ((b) & ((b) - 1)) == 0 && (b) <= MAXPHYS)
#ifdef _KERNEL
extern int disk_count; /* number of disks in global disklist */
Home |
Main Index |
Thread Index |
Old Index