From owner-svn-src-stable@FreeBSD.ORG Fri Aug 23 17:03:44 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 073C53BC; Fri, 23 Aug 2013 17:03:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D95832489; Fri, 23 Aug 2013 17:03:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NH3htH066468; Fri, 23 Aug 2013 17:03:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NH3hok066466; Fri, 23 Aug 2013 17:03:43 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201308231703.r7NH3hok066466@svn.freebsd.org> From: Andriy Gapon Date: Fri, 23 Aug 2013 17:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r254718 - stable/8/sys/fs/devfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 17:03:44 -0000 Author: avg Date: Fri Aug 23 17:03:43 2013 New Revision: 254718 URL: http://svnweb.freebsd.org/changeset/base/254718 Log: MFC r212966: Modify devfs_fqpn() for future use in devfs path reference counting code This should fix build failure introduced in r254708. Pointyhat to: avg MFC slacker: jh Modified: stable/8/sys/fs/devfs/devfs.h stable/8/sys/fs/devfs/devfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/fs/ (props changed) Modified: stable/8/sys/fs/devfs/devfs.h ============================================================================== --- stable/8/sys/fs/devfs/devfs.h Fri Aug 23 16:54:38 2013 (r254717) +++ stable/8/sys/fs/devfs/devfs.h Fri Aug 23 17:03:43 2013 (r254718) @@ -122,6 +122,8 @@ struct devfs_rule { MALLOC_DECLARE(M_DEVFS); #endif +struct componentname; + struct devfs_dirent { struct cdev_priv *de_cdp; int de_inode; @@ -176,6 +178,8 @@ void devfs_ruleset_set(devfs_rsnum rsnum void devfs_ruleset_apply(struct devfs_mount *dm); int devfs_allocv(struct devfs_dirent *de, struct mount *mp, int lockmode, struct vnode **vpp); +char *devfs_fqpn(char *, struct devfs_mount *, struct devfs_dirent *, + struct componentname *); void devfs_delete(struct devfs_mount *dm, struct devfs_dirent *de, int vp_locked); void devfs_dirent_free(struct devfs_dirent *de); void devfs_populate (struct devfs_mount *dm); Modified: stable/8/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/8/sys/fs/devfs/devfs_vnops.c Fri Aug 23 16:54:38 2013 (r254717) +++ stable/8/sys/fs/devfs/devfs_vnops.c Fri Aug 23 17:03:43 2013 (r254718) @@ -253,29 +253,34 @@ finished: } /* - * Construct the fully qualified path name relative to the mountpoint + * Construct the fully qualified path name relative to the mountpoint. + * If a NULL cnp is provided, no '/' is appended to the resulting path. */ -static char * -devfs_fqpn(char *buf, struct vnode *dvp, struct componentname *cnp) +char * +devfs_fqpn(char *buf, struct devfs_mount *dmp, struct devfs_dirent *dd, + struct componentname *cnp) { int i; - struct devfs_dirent *de, *dd; - struct devfs_mount *dmp; + struct devfs_dirent *de; + + sx_assert(&dmp->dm_lock, SA_LOCKED); - dmp = VFSTODEVFS(dvp->v_mount); - dd = dvp->v_data; i = SPECNAMELEN; buf[i] = '\0'; - i -= cnp->cn_namelen; + if (cnp != NULL) + i -= cnp->cn_namelen; if (i < 0) return (NULL); - bcopy(cnp->cn_nameptr, buf + i, cnp->cn_namelen); + if (cnp != NULL) + bcopy(cnp->cn_nameptr, buf + i, cnp->cn_namelen); de = dd; while (de != dmp->dm_rootdir) { - i--; - if (i < 0) - return (NULL); - buf[i] = '/'; + if (cnp != NULL || i < SPECNAMELEN) { + i--; + if (i < 0) + return (NULL); + buf[i] = '/'; + } i -= de->de_dirent->d_namlen; if (i < 0) return (NULL); @@ -838,7 +843,7 @@ devfs_lookupx(struct vop_lookup_args *ap * OK, we didn't have an entry for the name we were asked for * so we try to see if anybody can create it on demand. */ - pname = devfs_fqpn(specname, dvp, cnp); + pname = devfs_fqpn(specname, dmp, dd, cnp); if (pname == NULL) break;