From owner-svn-src-head@FreeBSD.ORG Wed Jul 20 16:53:32 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E952C1065670; Wed, 20 Jul 2011 16:53:32 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF0B08FC08; Wed, 20 Jul 2011 16:53:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6KGrW2w024696; Wed, 20 Jul 2011 16:53:32 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6KGrWN0024692; Wed, 20 Jul 2011 16:53:32 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201107201653.p6KGrWN0024692@svn.freebsd.org> From: Xin LI Date: Wed, 20 Jul 2011 16:53:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224231 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2011 16:53:33 -0000 Author: delphij Date: Wed Jul 20 16:53:32 2011 New Revision: 224231 URL: http://svn.freebsd.org/changeset/base/224231 Log: Add a new field to in-core znode, z_rdev, to represent device nodes. PR: kern/159010 Reviewed by: mm@ Approved by: re (kib) MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Wed Jul 20 16:52:51 2011 (r224230) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Wed Jul 20 16:53:32 2011 (r224231) @@ -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; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jul 20 16:52:51 2011 (r224230) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jul 20 16:53:32 2011 (r224231) @@ -2694,7 +2694,7 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i 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. */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Wed Jul 20 16:52:51 2011 (r224230) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Wed Jul 20 16:53:32 2011 (r224231) @@ -700,6 +700,16 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu 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;