From owner-svn-src-all@FreeBSD.ORG Mon Dec 24 20:03:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 472F6BA1; Mon, 24 Dec 2012 20:03:57 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 1DF778FC0A; Mon, 24 Dec 2012 20:03:56 +0000 (UTC) Received: from Alfreds-MacBook-Pro-9.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 5D56A1A3C2B; Mon, 24 Dec 2012 12:03:56 -0800 (PST) Message-ID: <50D8B533.8080507@mu.org> Date: Mon, 24 Dec 2012 12:04:03 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r244663 - stable/9 References: <201212241422.qBOEMrcF021632@svn.freebsd.org> In-Reply-To: Content-Type: multipart/mixed; boundary="------------060807030005000102040907" Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov , svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2012 20:03:57 -0000 This is a multi-part message in MIME format. --------------060807030005000102040907 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 12/24/12 11:24 AM, Adrian Chadd wrote: > ... why'd we break the KBI in a stable branch? > I am not sure either. I think a single VOP for nullfs (while ugly) would have sufficed. I have a partial patch here that shows the direction I was going. What's left is to: shim #defines for -stable to route the "new" vops from -current (VOP_ISTEXT, VOP_WRITECOUNT..) into just plain #defines inside of vnode.h to call into VOP_NULLFS_CALLTHROUGH with the proper VOP_NULLFS_IS_TEXT/VOP_NULLFS_SET_TEXT and remap stuff around into struct vop_nullfs_callthrough_args. best way to do this would be to just copy the code from the -current vnode_if.h into sys/vnode.h and hack it up for that it maps properly. Partial patch attached. -Alfred > > Adrian > > > On 24 December 2012 06:22, Konstantin Belousov wrote: >> Author: kib >> Date: Mon Dec 24 14:22:52 2012 >> New Revision: 244663 >> URL: http://svnweb.freebsd.org/changeset/base/244663 >> >> Log: >> Note that filesystem modules must be recompiled. >> >> Modified: >> stable/9/UPDATING >> >> Modified: stable/9/UPDATING >> ============================================================================== >> --- stable/9/UPDATING Mon Dec 24 14:12:43 2012 (r244662) >> +++ stable/9/UPDATING Mon Dec 24 14:22:52 2012 (r244663) >> @@ -11,6 +11,11 @@ handbook: >> Items affecting the ports and packages system can be found in >> /usr/ports/UPDATING. Please read that file before running portupgrade. >> >> +20121224: >> + The VFS KBI was changed with the merge of several nullfs >> + optimizations and fixes. All filesystem modules must be >> + recompiled. >> + >> 20121218: >> With the addition of auditdistd(8), a new auditdistd user is now >> depended on during installworld. "mergemaster -p" can be used to add --------------060807030005000102040907 Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="fskpi_fix1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fskpi_fix1.diff" diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index fd2437b..f109bc8 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -78,6 +78,8 @@ static int dirent_exists(struct vnode *vp, const char *dirname, #define DIRENT_MINSIZE (sizeof(struct dirent) - (MAXNAMLEN+1) + 4) +static int vop_nullfs_callthrough(struct vop_nullfs_callthrough_args *ap); + static int vop_stdis_text(struct vop_is_text_args *ap); static int vop_stdset_text(struct vop_set_text_args *ap); static int vop_stdunset_text(struct vop_unset_text_args *ap); @@ -132,11 +134,7 @@ struct vop_vector default_vnodeops = { .vop_unp_bind = vop_stdunp_bind, .vop_unp_connect = vop_stdunp_connect, .vop_unp_detach = vop_stdunp_detach, - .vop_is_text = vop_stdis_text, - .vop_set_text = vop_stdset_text, - .vop_unset_text = vop_stdunset_text, - .vop_get_writecount = vop_stdget_writecount, - .vop_add_writecount = vop_stdadd_writecount, + .vop_nullfs_callthrough = vop_stdnullfs_callthrough, }; /* @@ -1085,6 +1083,54 @@ vop_stdunp_detach(struct vop_unp_detach_args *ap) } static int +vop_stdnullfs_callthrough(struct vop_nullfs_callthrough_args *ap) +{ + + switch (ap->a_op) { + case VOP_NULLFS_IS_TEXT: + { + struct vop_is_text_args ap2; + ap2.a_vp = ap->a_vp; + return vop_stdis_text(&ap2); + } + case VOP_NULLFS_SET_TEXT: + { + struct vop_set_text_args ap2; + ap2.a_vp = ap->a_vp; + return vop_stdset_text(&ap2); + } + case VOP_NULLFS_UNSET_TEXT: + { + struct vop_unset_text_args ap2; + ap2.a_vp = ap->a_vp; + return vop_stdunset_text(&ap2); + } + case VOP_NULLFS_GET_WRITECOUNT: + { + struct vop_get_writecount_args ap2; + int error; + int writecount; + + ap2.a_vp = ap->a_vp; + ap2.a_writecount = &writecount; + error = vop_stdget_writecount(&ap2); + *((int *)ap->a_out0) = writecount; + return (error); + } + case VOP_NULLFS_ADD_WRITECOUNT: + { + struct vop_add_writecount_args ap2; + + ap2.a_vp = ap->a_vp; + ap2.a_inc = ap->a_in0; + return vop_stdadd_writecount(&ap2); + } + default: + return (EOPNOTSUPP); + } +} + +static int vop_stdis_text(struct vop_is_text_args *ap) { diff --git a/sys/kern/vnode_if.src b/sys/kern/vnode_if.src index 194e9f8..2bcc80a 100644 --- a/sys/kern/vnode_if.src +++ b/sys/kern/vnode_if.src @@ -658,36 +658,12 @@ vop_unp_detach { IN struct vnode *vp; }; -%% is_text vp L L L +%% nullfs_callthrough vp = = = -vop_is_text { +vop_nullfs_callthrough { IN struct vnode *vp; -}; - -%% set_text vp E E E - -vop_set_text { - IN struct vnode *vp; -}; - -%% vop_unset_text vp E E E - -vop_unset_text { - IN struct vnode *vp; -}; - -%% get_writecount vp L L L - -vop_get_writecount { - IN struct vnode *vp; - OUT int *writecount; -}; - -%% add_writecount vp E E E - -vop_add_writecount { - IN struct vnode *vp; - IN int inc; + IN uintptr_t in0; + OUT uintptr_t *out0; }; # The VOPs below are spares at the end of the table to allow new VOPs to be @@ -695,10 +671,6 @@ vop_add_writecount { # be added above these spares. When merging a new VOP to a stable branch, # the new VOP should replace one of the spares. -vop_spare4 { - IN struct vnode *vp; -}; - vop_spare5 { IN struct vnode *vp; }; --------------060807030005000102040907--