diff options
author | ed <ed@FreeBSD.org> | 2008-06-12 08:30:54 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2008-06-12 08:30:54 +0000 |
commit | 4327eebef0393f0b9c18ab3f86b4555ef309f742 (patch) | |
tree | f8f066a50f4fd515a22bc25b1b4119448ab6f55b /sys/cddl | |
parent | 1053568d9da027edf9d7e40fef69b0fe630965ff (diff) | |
download | FreeBSD-src-4327eebef0393f0b9c18ab3f86b4555ef309f742.zip FreeBSD-src-4327eebef0393f0b9c18ab3f86b4555ef309f742.tar.gz |
Turn dev2unit(), minor(), unit2minor() and minor2unit() into macro's.
Now that we got rid of the minor-to-unit conversion and the constraints
on device minor numbers, we can convert the functions that operate on
minor and unit numbers to simple macro's. The unit2minor() and
minor2unit() macro's are now no-ops.
The ZFS code als defined a macro named `minor'. Change the ZFS code to
use umajor() and uminor() here, as it is the correct approach to do
this. Also add $FreeBSD$ to keep SVN happy.
Approved by: philip (mentor), pjd
Diffstat (limited to 'sys/cddl')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c index e32e873..321f837 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c @@ -17,6 +17,8 @@ * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END + * + * $FreeBSD$ */ /* * Copyright 2007 Sun Microsystems, Inc. All rights reserved. @@ -279,12 +281,6 @@ zfs_init_fs(zfsvfs_t *zfsvfs, znode_t **zpp, cred_t *cr) #ifndef MAXMIN64 #define MAXMIN64 0xffffffffUL #endif -#ifndef major -#define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */ -#endif -#ifndef minor -#define minor(x) ((int)((x)&0xffff00ff)) /* minor number */ -#endif /* * Create special expldev for ZFS private use. @@ -297,7 +293,7 @@ zfs_init_fs(zfsvfs_t *zfsvfs, znode_t **zpp, cred_t *cr) static uint64_t zfs_expldev(dev_t dev) { - return (((uint64_t)major(dev) << NBITSMINOR64) | minor(dev)); + return (((uint64_t)umajor(dev) << NBITSMINOR64) | uminor(dev)); } /* * Special cmpldev for ZFS private use. |