From owner-svn-src-all@freebsd.org Sat Jul 29 10:30:14 2017 Return-Path: Delivered-To: svn-src-all@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 8DFA0DC0CD7; Sat, 29 Jul 2017 10:30:14 +0000 (UTC) (envelope-from dchagin@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 64B8C677A0; Sat, 29 Jul 2017 10:30:14 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6TAUDMS098602; Sat, 29 Jul 2017 10:30:13 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6TAUDcn098600; Sat, 29 Jul 2017 10:30:13 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201707291030.v6TAUDcn098600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 29 Jul 2017 10:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321681 - stable/11/sys/fs/fdescfs X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/11/sys/fs/fdescfs X-SVN-Commit-Revision: 321681 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 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: Sat, 29 Jul 2017 10:30:14 -0000 Author: dchagin Date: Sat Jul 29 10:30:13 2017 New Revision: 321681 URL: https://svnweb.freebsd.org/changeset/base/321681 Log: MFC r320814: Style(9). Add blank line aftr {. MFC r320815: Remove init from declaration. MFC r320816: Remove init from declaration, collapse two int vars declarations into single. MFC r320817: Don't take a lock around atomic operation. MFC r320818: Eliminate the bogus cast. MFC r320819: Eliminate the bogus cast. MFC r320820: Don't initialize error in declaration. Modified: stable/11/sys/fs/fdescfs/fdesc_vfsops.c stable/11/sys/fs/fdescfs/fdesc_vnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/fdescfs/fdesc_vfsops.c ============================================================================== --- stable/11/sys/fs/fdescfs/fdesc_vfsops.c Sat Jul 29 09:56:07 2017 (r321680) +++ stable/11/sys/fs/fdescfs/fdesc_vfsops.c Sat Jul 29 10:30:13 2017 (r321681) @@ -68,6 +68,7 @@ static vfs_root_t fdesc_root; int fdesc_cmount(struct mntarg *ma, void *data, uint64_t flags) { + return kernel_mount(ma, flags); } @@ -77,10 +78,10 @@ fdesc_cmount(struct mntarg *ma, void *data, uint64_t f static int fdesc_mount(struct mount *mp) { - int error = 0; struct fdescmount *fmp; struct thread *td = curthread; struct vnode *rvp; + int error; if (!prison_allow(td->td_ucred, PR_ALLOW_MOUNT_FDESCFS)) return (EPERM); @@ -98,7 +99,7 @@ fdesc_mount(struct mount *mp) * We need to initialize a few bits of our local mount point struct to * avoid confusion in allocvp. */ - mp->mnt_data = (qaddr_t) fmp; + mp->mnt_data = fmp; fmp->flags = 0; error = fdesc_allocvp(Froot, -1, FD_ROOT, mp, &rvp); if (error) { @@ -122,11 +123,10 @@ static int fdesc_unmount(struct mount *mp, int mntflags) { struct fdescmount *fmp; - caddr_t data; - int error; - int flags = 0; + int error, flags; - fmp = (struct fdescmount *)mp->mnt_data; + flags = 0; + fmp = mp->mnt_data; if (mntflags & MNT_FORCE) { /* The hash mutex protects the private mount flags. */ mtx_lock(&fdesc_hashmtx); @@ -147,15 +147,10 @@ fdesc_unmount(struct mount *mp, int mntflags) return (error); /* - * Finally, throw away the fdescmount structure. Hold the hashmtx to - * protect the fdescmount structure. + * Finally, throw away the fdescmount structure. */ - mtx_lock(&fdesc_hashmtx); - data = mp->mnt_data; mp->mnt_data = NULL; - mtx_unlock(&fdesc_hashmtx); - free(data, M_FDESCMNT); /* XXX */ - + free(fmp, M_FDESCMNT); return (0); } Modified: stable/11/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- stable/11/sys/fs/fdescfs/fdesc_vnops.c Sat Jul 29 09:56:07 2017 (r321680) +++ stable/11/sys/fs/fdescfs/fdesc_vnops.c Sat Jul 29 10:30:13 2017 (r321681) @@ -152,7 +152,7 @@ fdesc_allocvp(fdntype ftype, unsigned fd_fd, int ix, s struct fdescnode *fd, *fd2; struct vnode *vp, *vp2; struct thread *td; - int error = 0; + int error; td = curthread; fc = FD_NHASH(ix);