From owner-svn-src-head@freebsd.org Fri Sep 30 17:11:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FF5AC0327F; Fri, 30 Sep 2016 17:11:05 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B400180B; Fri, 30 Sep 2016 17:11:05 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8UHB4kX046398; Fri, 30 Sep 2016 17:11:04 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8UHB35d046389; Fri, 30 Sep 2016 17:11:03 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201609301711.u8UHB35d046389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 30 Sep 2016 17:11:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306509 - in head/sys: fs/nandfs kern sys ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Fri, 30 Sep 2016 17:11:05 -0000 Author: mjg Date: Fri Sep 30 17:11:03 2016 New Revision: 306509 URL: https://svnweb.freebsd.org/changeset/base/306509 Log: vfs: remove the __bo_vnode field from struct vnode The pointer can be obtained using __containerof instead. Reviewed by: kib Modified: head/sys/fs/nandfs/nandfs_subr.c head/sys/kern/vfs_bio.c head/sys/kern/vfs_subr.c head/sys/sys/bufobj.h head/sys/sys/vnode.h head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/fs/nandfs/nandfs_subr.c ============================================================================== --- head/sys/fs/nandfs/nandfs_subr.c Fri Sep 30 16:35:30 2016 (r306508) +++ head/sys/fs/nandfs/nandfs_subr.c Fri Sep 30 17:11:03 2016 (r306509) @@ -80,7 +80,7 @@ nandfs_bufsync(struct bufobj *bo, int wa struct vnode *vp; int error = 0; - vp = bo->__bo_vnode; + vp = bo2vnode(bo); ASSERT_VOP_LOCKED(vp, __func__); error = nandfs_sync_file(vp); Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri Sep 30 16:35:30 2016 (r306508) +++ head/sys/kern/vfs_bio.c Fri Sep 30 17:11:03 2016 (r306509) @@ -4544,7 +4544,7 @@ int bufsync(struct bufobj *bo, int waitfor) { - return (VOP_FSYNC(bo->__bo_vnode, waitfor, curthread)); + return (VOP_FSYNC(bo2vnode(bo), waitfor, curthread)); } void Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Sep 30 16:35:30 2016 (r306508) +++ head/sys/kern/vfs_subr.c Fri Sep 30 17:11:03 2016 (r306509) @@ -372,7 +372,6 @@ vnode_init(void *mem, int size, int flag * Initialize bufobj. */ bo = &vp->v_bufobj; - bo->__bo_vnode = vp; rw_init(BO_LOCKPTR(bo), "bufobj interlock"); bo->bo_private = vp; TAILQ_INIT(&bo->bo_clean.bv_hd); @@ -2052,7 +2051,7 @@ sync_vnode(struct synclist *slp, struct *bo = LIST_FIRST(slp); if (*bo == NULL) return (0); - vp = (*bo)->__bo_vnode; /* XXX */ + vp = bo2vnode(*bo); if (VOP_ISLOCKED(vp) != 0 || VI_TRYLOCK(vp) == 0) return (1); /* Modified: head/sys/sys/bufobj.h ============================================================================== --- head/sys/sys/bufobj.h Fri Sep 30 16:35:30 2016 (r306508) +++ head/sys/sys/bufobj.h Fri Sep 30 17:11:03 2016 (r306509) @@ -94,11 +94,6 @@ struct bufobj { struct vm_object *bo_object; /* v Place to store VM object */ LIST_ENTRY(bufobj) bo_synclist; /* S dirty vnode list */ void *bo_private; /* private pointer */ - struct vnode *__bo_vnode; /* - * XXX: This vnode pointer is here - * XXX: only to keep the syncer working - * XXX: for now. - */ struct bufv bo_clean; /* i Clean buffers */ struct bufv bo_dirty; /* i Dirty buffers */ long bo_numoutput; /* i Writes in progress */ Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Fri Sep 30 16:35:30 2016 (r306508) +++ head/sys/sys/vnode.h Fri Sep 30 17:11:03 2016 (r306509) @@ -179,6 +179,8 @@ struct vnode { #define v_rdev v_un.vu_cdev #define v_fifoinfo v_un.vu_fifoinfo +#define bo2vnode(bo) __containerof((bo), struct vnode, v_bufobj) + /* XXX: These are temporary to avoid a source sweep at this time */ #define v_object v_bufobj.bo_object Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Fri Sep 30 16:35:30 2016 (r306508) +++ head/sys/ufs/ffs/ffs_snapshot.c Fri Sep 30 17:11:03 2016 (r306509) @@ -2170,7 +2170,7 @@ ffs_bdflush(bo, bp) td = curthread; vp = bp->b_vp; - devvp = bo->__bo_vnode; + devvp = bo2vnode(bo); KASSERT(vp == devvp, ("devvp != vp %p %p", bo, bp)); VI_LOCK(devvp); Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Fri Sep 30 16:35:30 2016 (r306508) +++ head/sys/ufs/ffs/ffs_vfsops.c Fri Sep 30 17:11:03 2016 (r306509) @@ -2177,7 +2177,7 @@ ffs_geom_strategy(struct bufobj *bo, str struct buf *tbp; int nocopy; - vp = bo->__bo_vnode; + vp = bo2vnode(bo); if (bp->b_iocmd == BIO_WRITE) { if ((bp->b_flags & B_VALIDSUSPWRT) == 0 && bp->b_vp != NULL && bp->b_vp->v_mount != NULL &&