diff options
author | Brian Behlendorf <[email protected]> | 2011-02-23 15:13:03 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2011-02-23 15:13:03 -0800 |
commit | dc1d7665c54de024cf5ded1b835482dbc5f1ae38 (patch) | |
tree | 2e95fda6a54f284665cd1954aa15e3362407d319 /module/zfs/zfs_znode.c | |
parent | 99c564bc48710ff2a6edbfcad16d3c3b89773111 (diff) |
Remove rdev packing
Remove custom code to pack/unpack dev_t's. Under Linux all dev_t's
are an unsigned 32-bit value even on 64-bit platforms. The lower
20 bits are used for the minor number and the upper 12 for the major
number.
This means if your importing a pool from Solaris you may get strange
major/minor numbers. But it doesn't really matter because even if
we add compatibility code to translate the encoded Solaris major/minor
they won't do you any good under Linux. You will still need to
recreate the dev_t with a major/minor which maps to reserved major
numbers used under Linux.
Dropping this code also resolves 32-bit builds by removing the
offending 32-bit compatibility code.
Diffstat (limited to 'module/zfs/zfs_znode.c')
-rw-r--r-- | module/zfs/zfs_znode.c | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/module/zfs/zfs_znode.c b/module/zfs/zfs_znode.c index 56ac2ab8c..9aac34e31 100644 --- a/module/zfs/zfs_znode.c +++ b/module/zfs/zfs_znode.c @@ -206,40 +206,6 @@ zfs_create_share_dir(zfs_sb_t *zsb, dmu_tx_t *tx) #endif /* HAVE_SHARE */ } -/* - * define a couple of values we need available - * for both 64 and 32 bit environments. - */ -#ifndef NBITSMINOR64 -#define NBITSMINOR64 32 -#endif -#ifndef MAXMAJ64 -#define MAXMAJ64 0xffffffffUL -#endif -#ifndef MAXMIN64 -#define MAXMIN64 0xffffffffUL -#endif - -/* - * Create special expldev for ZFS private use. - * Can't use standard expldev since it doesn't do - * what we want. The standard expldev() takes a - * dev32_t in LP64 and expands it to a long dev_t. - * We need an interface that takes a dev32_t in ILP32 - * and expands it to a long dev_t. - */ -static uint64_t -zfs_expldev(dev_t dev) -{ -#ifndef _LP64 - major_t major = (major_t)dev >> NBITSMINOR32 & MAXMAJ32; - return (((uint64_t)major << NBITSMINOR64) | - ((minor_t)dev & MAXMIN32)); -#else - return (dev); -#endif -} - static void zfs_znode_sa_init(zfs_sb_t *zsb, znode_t *zp, dmu_buf_t *db, dmu_object_type_t obj_type, sa_handle_t *sa_hdl) @@ -588,7 +554,7 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, dmu_tx_t *tx, cred_t *cr, if (S_ISBLK(vap->va_mode) || S_ISCHR(vap->va_mode) || S_ISFIFO(vap->va_mode) || S_ISSOCK(vap->va_mode)) - rdev = zfs_expldev(vap->va_rdev); + rdev = vap->va_rdev; parent = dzp->z_id; mode = acl_ids->z_mode; |