From owner-svn-src-head@freebsd.org Wed Aug 21 19:07:15 2019 Return-Path: Delivered-To: svn-src-head@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 B4D8DD0C8F; Wed, 21 Aug 2019 19:07:15 +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 46DHGW4KgWz4LlP; Wed, 21 Aug 2019 19:07:15 +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 7641F20266; Wed, 21 Aug 2019 19:07:15 +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 x7LJ7FQi088564; Wed, 21 Aug 2019 19:07:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7LJ7DFA088554; Wed, 21 Aug 2019 19:07:13 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201908211907.x7LJ7DFA088554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 21 Aug 2019 19:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351346 - in head: sys/fs/msdosfs usr.sbin/makefs usr.sbin/makefs/ffs usr.sbin/makefs/msdos X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: sys/fs/msdosfs usr.sbin/makefs usr.sbin/makefs/ffs usr.sbin/makefs/msdos X-SVN-Commit-Revision: 351346 X-SVN-Commit-Repository: base 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.29 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: Wed, 21 Aug 2019 19:07:15 -0000 Author: emaste Date: Wed Aug 21 19:07:13 2019 New Revision: 351346 URL: https://svnweb.freebsd.org/changeset/base/351346 Log: makefs: share denode.h between kernel msdosfs and makefs There is no need to duplicate this file when it can be trivially shared (just exposing sections previously under #ifdef _KERNEL). MFC with: r351273 Differential Revision: The FreeBSD Foundation Deleted: head/usr.sbin/makefs/msdos/denode.h Modified: head/sys/fs/msdosfs/denode.h head/usr.sbin/makefs/ffs/buf.h head/usr.sbin/makefs/msdos.c 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 Modified: head/sys/fs/msdosfs/denode.h ============================================================================== --- head/sys/fs/msdosfs/denode.h Wed Aug 21 18:28:38 2019 (r351345) +++ head/sys/fs/msdosfs/denode.h Wed Aug 21 19:07:13 2019 (r351346) @@ -213,7 +213,7 @@ struct denode { ((dep)->de_Attributes & ATTR_DIRECTORY) ? 0 : (dep)->de_FileSize), \ putushort((dp)->deHighClust, (dep)->de_StartCluster >> 16)) -#ifdef _KERNEL +#if defined(_KERNEL) || defined(MAKEFS) #define VTODE(vp) ((struct denode *)(vp)->v_data) #define DETOV(de) ((de)->de_vnode) @@ -262,9 +262,11 @@ struct defid { extern struct vop_vector msdosfs_vnodeops; +#ifdef _KERNEL int msdosfs_lookup(struct vop_cachedlookup_args *); int msdosfs_inactive(struct vop_inactive_args *); int msdosfs_reclaim(struct vop_reclaim_args *); +#endif /* * Internal service routine prototypes. @@ -283,5 +285,5 @@ int deupdat(struct denode *dep, int waitfor); int removede(struct denode *pdep, struct denode *dep); int detrunc(struct denode *dep, u_long length, int flags, struct ucred *cred); int doscheckpath( struct denode *source, struct denode *target); -#endif /* _KERNEL */ +#endif /* _KERNEL || MAKEFS */ #endif /* !_FS_MSDOSFS_DENODE_H_ */ Modified: head/usr.sbin/makefs/ffs/buf.h ============================================================================== --- head/usr.sbin/makefs/ffs/buf.h Wed Aug 21 18:28:38 2019 (r351345) +++ head/usr.sbin/makefs/ffs/buf.h Wed Aug 21 19:07:13 2019 (r351346) @@ -45,6 +45,7 @@ #include #include +struct componentname; struct makefs_fsinfo; struct ucred; Modified: head/usr.sbin/makefs/msdos.c ============================================================================== --- head/usr.sbin/makefs/msdos.c Wed Aug 21 18:28:38 2019 (r351345) +++ head/usr.sbin/makefs/msdos.c Wed Aug 21 19:07:13 2019 (r351346) @@ -55,17 +55,17 @@ __FBSDID("$FreeBSD$"); #include #include +#include "ffs/buf.h" #include "makefs.h" #include "msdos.h" #include #include +#include "msdos/direntry.h" +#include -#include "ffs/buf.h" #include "msdos/msdosfsmount.h" -#include "msdos/direntry.h" -#include "msdos/denode.h" static int msdos_populate_dir(const char *, struct denode *, fsnode *, fsnode *, fsinfo_t *); Modified: head/usr.sbin/makefs/msdos/msdosfs_conv.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_conv.c Wed Aug 21 18:28:38 2019 (r351345) +++ head/usr.sbin/makefs/msdos/msdosfs_conv.c Wed Aug 21 19:07:13 2019 (r351346) @@ -56,13 +56,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include "msdos/direntry.h" +#include "msdos/msdosfsmount.h" #include "makefs.h" #include "msdos.h" - -#include "msdos/denode.h" -#include "msdos/direntry.h" -#include "msdos/msdosfsmount.h" static int char8ucs2str(const uint8_t *in, int n, uint16_t *out, int m); static void ucs2pad(uint16_t *buf, int len, int size); Modified: head/usr.sbin/makefs/msdos/msdosfs_denode.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_denode.c Wed Aug 21 18:28:38 2019 (r351345) +++ head/usr.sbin/makefs/msdos/msdosfs_denode.c Wed Aug 21 19:07:13 2019 (r351346) @@ -59,18 +59,18 @@ __FBSDID("$FreeBSD$"); #include #include +#include "ffs/buf.h" + #include -#include "msdos/denode.h" -#include "msdos/msdosfsmount.h" +#include +#include #include +#include "msdos/msdosfsmount.h" #include "makefs.h" #include "msdos.h" -#include "ffs/buf.h" -#include "msdos/direntry.h" - /* * If deget() succeeds it returns with the gotten denode locked(). * @@ -208,7 +208,7 @@ deget(struct msdosfsmount *pmp, u_long dirclust, u_lon * Truncate the file described by dep to the length specified by length. */ int -detrunc(struct denode *dep, u_long length, int flags) +detrunc(struct denode *dep, u_long length, int flags, struct ucred *cred) { int error; int allerror; @@ -240,7 +240,7 @@ detrunc(struct denode *dep, u_long length, int flags) } if (dep->de_FileSize < length) - return deextend(dep, length); + return deextend(dep, length, cred); /* * If the desired length is 0 then remember the starting cluster of @@ -333,7 +333,7 @@ detrunc(struct denode *dep, u_long length, int flags) * Extend the file described by dep to length specified by length. */ int -deextend(struct denode *dep, u_long length) +deextend(struct denode *dep, u_long length, struct ucred *cred) { struct msdosfsmount *pmp = dep->de_pmp; u_long count; @@ -364,7 +364,7 @@ deextend(struct denode *dep, u_long length) error = extendfile(dep, count, NULL, NULL, DE_CLEAR); if (error) { /* truncate the added clusters away again */ - (void) detrunc(dep, dep->de_FileSize, 0); + (void) detrunc(dep, dep->de_FileSize, 0, cred); return (error); } } Modified: head/usr.sbin/makefs/msdos/msdosfs_fat.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_fat.c Wed Aug 21 18:28:38 2019 (r351345) +++ head/usr.sbin/makefs/msdos/msdosfs_fat.c Wed Aug 21 19:07:13 2019 (r351346) @@ -58,14 +58,13 @@ #include #include -#include -#include "msdos/denode.h" -#include "msdos/msdosfsmount.h" -#include - #include "ffs/buf.h" +#include #include "msdos/direntry.h" +#include +#include +#include "msdos/msdosfsmount.h" #include "makefs.h" #include "msdos.h" Modified: head/usr.sbin/makefs/msdos/msdosfs_lookup.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_lookup.c Wed Aug 21 18:28:38 2019 (r351345) +++ head/usr.sbin/makefs/msdos/msdosfs_lookup.c Wed Aug 21 19:07:13 2019 (r351346) @@ -56,15 +56,13 @@ #include #include +#include "ffs/buf.h" #include -#include "msdos/denode.h" -#include "msdos/msdosfsmount.h" +#include "msdos/direntry.h" +#include #include +#include "msdos/msdosfsmount.h" -#include "ffs/buf.h" - -#include "msdos/direntry.h" - #include "makefs.h" #include "msdos.h" @@ -104,7 +102,7 @@ createde(struct denode *dep, struct denode *ddep, stru dirclust = de_clcount(pmp, diroffset); error = extendfile(ddep, dirclust, 0, 0, DE_CLEAR); if (error) { - (void)detrunc(ddep, ddep->de_FileSize, 0); + (void)detrunc(ddep, ddep->de_FileSize, 0, NULL); return error; } Modified: head/usr.sbin/makefs/msdos/msdosfs_vfsops.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_vfsops.c Wed Aug 21 18:28:38 2019 (r351345) +++ head/usr.sbin/makefs/msdos/msdosfs_vfsops.c Wed Aug 21 19:07:13 2019 (r351346) @@ -58,20 +58,20 @@ __FBSDID("$FreeBSD$"); #include #include +#include "ffs/buf.h" #include #include -#include "msdos/denode.h" -#include "msdos/msdosfsmount.h" +#include "msdos/direntry.h" +#include #include +#include "msdos/msdosfsmount.h" #include #include "makefs.h" #include "msdos.h" -#include "ffs/buf.h" -#include "msdos/direntry.h" struct msdosfsmount * msdosfs_mount(struct vnode *devvp) Modified: head/usr.sbin/makefs/msdos/msdosfs_vnops.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_vnops.c Wed Aug 21 18:28:38 2019 (r351345) +++ head/usr.sbin/makefs/msdos/msdosfs_vnops.c Wed Aug 21 19:07:13 2019 (r351346) @@ -62,18 +62,16 @@ __FBSDID("$FreeBSD$"); #include #include +#include "ffs/buf.h" #include -#include "msdos/denode.h" -#include "msdos/msdosfsmount.h" +#include "msdos/direntry.h" +#include #include +#include "msdos/msdosfsmount.h" #include "makefs.h" #include "msdos.h" -#include "ffs/buf.h" - -#include "msdos/direntry.h" - /* * Some general notes: * @@ -455,7 +453,7 @@ msdosfs_wfile(const char *path, struct denode *dep, fs nsize = st->st_size; MSDOSFS_DPRINTF(("%s(nsize=%zu, osize=%zu)\n", __func__, nsize, osize)); if (nsize > osize) { - if ((error = deextend(dep, nsize)) != 0) + if ((error = deextend(dep, nsize, NULL)) != 0) return error; if ((error = msdosfs_updatede(dep)) != 0) return error;