diff options
3 files changed, 12 insertions, 1 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h index d3955d7..1badcd0 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h @@ -209,6 +209,7 @@ typedef struct znode { boolean_t z_is_sa; /* are we native sa? */ /* FreeBSD-specific field. */ struct task z_task; + dev_t z_rdev; } znode_t; diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c index 588ea85..5e20ac2 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c @@ -2694,7 +2694,7 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr, vap->va_nlink = MIN(links, UINT32_MAX); /* nlink_t limit! */ vap->va_size = zp->z_size; vap->va_fsid = vp->v_mount->mnt_stat.f_fsid.val[0]; -// vap->va_rdev = zfs_cmpldev(pzp->zp_rdev); + vap->va_rdev = zp->z_rdev; vap->va_seq = zp->z_seq; vap->va_flags = 0; /* FreeBSD: Reset chflags(2) flags. */ 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 1f3d0b2..da32270 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 @@ -700,6 +700,16 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_buf_t *db, int blksz, case VDIR: zp->z_zn_prefetch = B_TRUE; /* z_prefetch default is enabled */ break; + case VBLK: + case VCHR: + { + uint64_t rdev; + VERIFY(sa_lookup(zp->z_sa_hdl, SA_ZPL_RDEV(zfsvfs), + &rdev, sizeof (rdev)) == 0); + + zp->z_rdev = zfs_cmpldev(rdev); + } + break; case VFIFO: vp->v_op = &zfs_fifoops; break; |