From owner-svn-src-all@freebsd.org Thu Aug 22 17:49:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 133D0CE0D0; Thu, 22 Aug 2019 17:49:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46DsVS6kYpz3Dch; Thu, 22 Aug 2019 17:49:36 +0000 (UTC) (envelope-from emaste@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C86E77BB0; Thu, 22 Aug 2019 17:49:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7MHnaMH099310; Thu, 22 Aug 2019 17:49:36 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7MHnZfP099302; Thu, 22 Aug 2019 17:49:35 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201908221749.x7MHnZfP099302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 22 Aug 2019 17:49:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351396 - head/usr.sbin/makefs/msdos X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/makefs/msdos X-SVN-Commit-Revision: 351396 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.29 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: Thu, 22 Aug 2019 17:49:37 -0000 Author: emaste Date: Thu Aug 22 17:49:34 2019 New Revision: 351396 URL: https://svnweb.freebsd.org/changeset/base/351396 Log: makefs: diff reduction to sys/fs/msdosfs No functional change. Modified: head/usr.sbin/makefs/msdos/direntry.h head/usr.sbin/makefs/msdos/msdosfs_conv.c head/usr.sbin/makefs/msdos/msdosfs_denode.c head/usr.sbin/makefs/msdos/msdosfs_fat.c head/usr.sbin/makefs/msdos/msdosfs_lookup.c head/usr.sbin/makefs/msdos/msdosfs_vfsops.c head/usr.sbin/makefs/msdos/msdosfs_vnops.c head/usr.sbin/makefs/msdos/msdosfsmount.h Modified: head/usr.sbin/makefs/msdos/direntry.h ============================================================================== --- head/usr.sbin/makefs/msdos/direntry.h Thu Aug 22 16:06:52 2019 (r351395) +++ head/usr.sbin/makefs/msdos/direntry.h Thu Aug 22 17:49:34 2019 (r351396) @@ -135,12 +135,12 @@ struct winentry { #define DD_YEAR_MASK 0xFE00 /* year - 1980 */ #define DD_YEAR_SHIFT 9 -uint8_t winChksum(uint8_t *name); -int winSlotCnt(const u_char *un, size_t unlen); -int unix2dosfn(const u_char *un, u_char dn[12], size_t unlen, u_int gen); -int winChkName(const u_char *un, size_t unlen, struct winentry *wep, - int chksum); -int unix2winfn(const u_char *un, size_t unlen, struct winentry *wep, int cnt, - int chksum); +int unix2dosfn(const u_char *un, u_char dn[12], size_t unlen, u_int gen); +int unix2winfn(const u_char *un, size_t unlen, struct winentry *wep, int cnt, + int chksum); +int winChkName(const u_char *un, size_t unlen, struct winentry *wep, + int chksum); +uint8_t winChksum(uint8_t *name); +int winSlotCnt(const u_char *un, size_t unlen); #endif /* !_FS_MSDOSFS_DIRENTRY_H_ */ Modified: head/usr.sbin/makefs/msdos/msdosfs_conv.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_conv.c Thu Aug 22 16:06:52 2019 (r351395) +++ head/usr.sbin/makefs/msdos/msdosfs_conv.c Thu Aug 22 17:49:34 2019 (r351396) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. * Copyright (C) 1994, 1995, 1997 TooLs GmbH. * All rights reserved. @@ -29,7 +31,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* +/*- * Written by Paul Popelka (paulp@uts.amdahl.com) * * You can do anything you want with this software, just don't say you wrote Modified: head/usr.sbin/makefs/msdos/msdosfs_denode.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_denode.c Thu Aug 22 16:06:52 2019 (r351395) +++ head/usr.sbin/makefs/msdos/msdosfs_denode.c Thu Aug 22 17:49:34 2019 (r351396) @@ -1,6 +1,8 @@ /* $NetBSD: msdosfs_denode.c,v 1.7 2015/03/29 05:52:59 agc Exp $ */ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. * Copyright (C) 1994, 1995, 1997 TooLs GmbH. * All rights reserved. @@ -31,7 +33,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* +/*- * Written by Paul Popelka (paulp@uts.amdahl.com) * * You can do anything you want with this software, just don't say you wrote @@ -261,7 +263,7 @@ detrunc(struct denode *dep, u_long length, int flags, if (error) { MSDOSFS_DPRINTF(("detrunc(): pcbmap fails %d\n", error)); - return error; + return (error); } } @@ -282,10 +284,9 @@ detrunc(struct denode *dep, u_long length, int flags, MSDOSFS_DPRINTF(("detrunc(): bread fails %d\n", error)); - return error; + return (error); } - memset((char *)bp->b_data + boff, 0, - pmp->pm_bpcluster - boff); + memset(bp->b_data + boff, 0, pmp->pm_bpcluster - boff); if (flags & IO_SYNC) bwrite(bp); else @@ -326,7 +327,7 @@ detrunc(struct denode *dep, u_long length, int flags, if (chaintofree != 0 && !MSDOSFSEOF(pmp, chaintofree)) freeclusterchain(pmp, chaintofree); - return allerror; + return (allerror); } /* @@ -343,16 +344,16 @@ deextend(struct denode *dep, u_long length, struct ucr * The root of a DOS filesystem cannot be extended. */ if (dep->de_vnode != NULL && !FAT32(pmp)) - return EINVAL; + return (EINVAL); /* * Directories cannot be extended. */ if (dep->de_Attributes & ATTR_DIRECTORY) - return EISDIR; + return (EISDIR); if (length <= dep->de_FileSize) - return E2BIG; + return (E2BIG); /* * Compute the number of clusters to allocate. Modified: head/usr.sbin/makefs/msdos/msdosfs_fat.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_fat.c Thu Aug 22 16:06:52 2019 (r351395) +++ head/usr.sbin/makefs/msdos/msdosfs_fat.c Thu Aug 22 17:49:34 2019 (r351396) @@ -870,9 +870,11 @@ freeclusterchain(struct msdosfsmount *pmp, u_long clus int fillinusemap(struct msdosfsmount *pmp) { - struct buf *bp = NULL; + struct buf *bp; u_long bn, bo, bsize, byteoffset, cn, readcn; int error; + + bp = NULL; /* * Mark all clusters in use, we mark the free ones in the FAT scan Modified: head/usr.sbin/makefs/msdos/msdosfs_lookup.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_lookup.c Thu Aug 22 16:06:52 2019 (r351395) +++ head/usr.sbin/makefs/msdos/msdosfs_lookup.c Thu Aug 22 17:49:34 2019 (r351396) @@ -276,7 +276,7 @@ uniqdosname(struct denode *dep, struct componentname * return error; } for (dentp = (struct direntry *)bp->b_data; - (char *)dentp < (char *)bp->b_data + blsize; + (char *)dentp < bp->b_data + blsize; dentp++) { if (dentp->deName[0] == SLOT_EMPTY) { /* Modified: head/usr.sbin/makefs/msdos/msdosfs_vfsops.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_vfsops.c Thu Aug 22 16:06:52 2019 (r351395) +++ head/usr.sbin/makefs/msdos/msdosfs_vfsops.c Thu Aug 22 17:49:34 2019 (r351396) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. * Copyright (C) 1994, 1995, 1997 TooLs GmbH. * All rights reserved. @@ -29,7 +31,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* +/*- * Written by Paul Popelka (paulp@uts.amdahl.com) * * You can do anything you want with this software, just don't say you wrote Modified: head/usr.sbin/makefs/msdos/msdosfs_vnops.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_vnops.c Thu Aug 22 16:06:52 2019 (r351395) +++ head/usr.sbin/makefs/msdos/msdosfs_vnops.c Thu Aug 22 17:49:34 2019 (r351396) @@ -1,6 +1,8 @@ /* $NetBSD: msdosfs_vnops.c,v 1.19 2017/04/13 17:10:12 christos Exp $ */ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. * Copyright (C) 1994, 1995, 1997 TooLs GmbH. * All rights reserved. @@ -31,7 +33,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* +/*- * Written by Paul Popelka (paulp@uts.amdahl.com) * * You can do anything you want with this software, just don't say you wrote @@ -217,7 +219,7 @@ msdosfs_findslot(struct denode *dp, struct componentna for (blkoff = 0; blkoff < blsize; blkoff += sizeof(struct direntry), diroff += sizeof(struct direntry)) { - dep = (struct direntry *)((char *)bp->b_data + blkoff); + dep = (struct direntry *)(bp->b_data + blkoff); /* * If the slot is empty and we are still looking * for an empty then remember this one. If the @@ -493,7 +495,7 @@ msdosfs_wfile(const char *path, struct denode *dep, fs goto out; } cpsize = MIN((nsize - offs), blsize - on); - memcpy((char *)bp->b_data + on, dat + offs, cpsize); + memcpy(bp->b_data + on, dat + offs, cpsize); bwrite(bp); offs += cpsize; } Modified: head/usr.sbin/makefs/msdos/msdosfsmount.h ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfsmount.h Thu Aug 22 16:06:52 2019 (r351395) +++ head/usr.sbin/makefs/msdos/msdosfsmount.h Thu Aug 22 17:49:34 2019 (r351396) @@ -51,7 +51,7 @@ */ #ifndef _MSDOSFS_MSDOSFSMOUNT_H_ -#define _MSDOSFS_MSDOSFSMOUNT_H_ +#define _MSDOSFS_MSDOSFSMOUNT_H_ #include