Author: emaste
Date: Wed Aug 21 02:21:40 2019
New Revision: 351321
URL: https://svnweb.freebsd.org/changeset/base/351321

Log:
  makefs: share fat.h between kernel msdosfs and makefs
  
  There is no reason to duplicate this file when it can be trivially
  shared (just exposing one section previously under #ifdef _KERNEL).
  
  Reviewed by:  imp, cem
  MFC with:     r351273
  Sponsored by: The FreeBSD Foundation
  Differential Revision:        https://reviews.freebsd.org/D21346

Deleted:
  head/usr.sbin/makefs/msdos/fat.h
Modified:
  head/sys/fs/msdosfs/fat.h
  head/usr.sbin/makefs/msdos/Makefile.inc
  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/fat.h
==============================================================================
--- head/sys/fs/msdosfs/fat.h   Wed Aug 21 02:17:39 2019        (r351320)
+++ head/sys/fs/msdosfs/fat.h   Wed Aug 21 02:21:40 2019        (r351321)
@@ -82,7 +82,7 @@
 
 #define        MSDOSFSEOF(pmp, cn)     ((((cn) | ~(pmp)->pm_fatmask) & 
CLUST_EOFS) == CLUST_EOFS)
 
-#ifdef _KERNEL
+#if defined (_KERNEL) || defined(MAKEFS)
 /*
  * These are the values for the function argument to the function
  * fatentry().
@@ -105,5 +105,5 @@ int extendfile(struct denode *dep, u_long count, struc
 void fc_purge(struct denode *dep, u_int frcn);
 int markvoldirty(struct msdosfsmount *pmp, int dirty);
 
-#endif /* _KERNEL */
+#endif /* _KERNEL || MAKEFS */
 #endif /* !_FS_MSDOSFS_FAT_H_ */

Modified: head/usr.sbin/makefs/msdos/Makefile.inc
==============================================================================
--- head/usr.sbin/makefs/msdos/Makefile.inc     Wed Aug 21 02:17:39 2019        
(r351320)
+++ head/usr.sbin/makefs/msdos/Makefile.inc     Wed Aug 21 02:21:40 2019        
(r351321)
@@ -6,7 +6,7 @@ MSDOS_NEWFS=    ${SRCTOP}/sbin/newfs_msdos
 
 .PATH: ${SRCDIR}/msdos ${MSDOS} ${MSDOS_NEWFS}
 
-CFLAGS+= -I${MSDOS} -I${MSDOS_NEWFS}
+CFLAGS+= -DMAKEFS -I${MSDOS} -I${MSDOS_NEWFS}
 
 SRCS+= mkfs_msdos.c
 SRCS+= msdosfs_conv.c msdosfs_denode.c msdosfs_fat.c msdosfs_lookup.c

Modified: head/usr.sbin/makefs/msdos/msdosfs_conv.c
==============================================================================
--- head/usr.sbin/makefs/msdos/msdosfs_conv.c   Wed Aug 21 02:17:39 2019        
(r351320)
+++ head/usr.sbin/makefs/msdos/msdosfs_conv.c   Wed Aug 21 02:21:40 2019        
(r351321)
@@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$");
 
 #include "msdos/denode.h"
 #include "msdos/direntry.h"
-#include "msdos/fat.h"
 #include "msdos/msdosfsmount.h"
 
 static int char8ucs2str(const uint8_t *in, int n, uint16_t *out, int m);

Modified: head/usr.sbin/makefs/msdos/msdosfs_denode.c
==============================================================================
--- head/usr.sbin/makefs/msdos/msdosfs_denode.c Wed Aug 21 02:17:39 2019        
(r351320)
+++ head/usr.sbin/makefs/msdos/msdosfs_denode.c Wed Aug 21 02:21:40 2019        
(r351321)
@@ -60,16 +60,16 @@ __FBSDID("$FreeBSD$");
 #include <util.h>
 
 #include <fs/msdosfs/bpb.h>
+#include "msdos/denode.h"
+#include "msdos/msdosfsmount.h"
+#include <fs/msdosfs/fat.h>
 
 #include "makefs.h"
 #include "msdos.h"
 
 #include "ffs/buf.h"
 
-#include "msdos/denode.h"
 #include "msdos/direntry.h"
-#include "msdos/fat.h"
-#include "msdos/msdosfsmount.h"
 
 /*
  * If deget() succeeds it returns with the gotten denode locked().

Modified: head/usr.sbin/makefs/msdos/msdosfs_fat.c
==============================================================================
--- head/usr.sbin/makefs/msdos/msdosfs_fat.c    Wed Aug 21 02:17:39 2019        
(r351320)
+++ head/usr.sbin/makefs/msdos/msdosfs_fat.c    Wed Aug 21 02:21:40 2019        
(r351321)
@@ -59,13 +59,13 @@
 #include <strings.h>
 
 #include <fs/msdosfs/bpb.h>
+#include "msdos/denode.h"
+#include "msdos/msdosfsmount.h"
+#include <fs/msdosfs/fat.h>
 
 #include "ffs/buf.h"
 
-#include "msdos/denode.h"
 #include "msdos/direntry.h"
-#include "msdos/fat.h"
-#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 02:17:39 2019        
(r351320)
+++ head/usr.sbin/makefs/msdos/msdosfs_lookup.c Wed Aug 21 02:21:40 2019        
(r351321)
@@ -57,13 +57,13 @@
 #include <string.h>
 
 #include <fs/msdosfs/bpb.h>
+#include "msdos/denode.h"
+#include "msdos/msdosfsmount.h"
+#include <fs/msdosfs/fat.h>
 
 #include "ffs/buf.h"
 
-#include "msdos/denode.h"
 #include "msdos/direntry.h"
-#include "msdos/fat.h"
-#include "msdos/msdosfsmount.h"
 
 #include "makefs.h"
 #include "msdos.h"

Modified: head/usr.sbin/makefs/msdos/msdosfs_vfsops.c
==============================================================================
--- head/usr.sbin/makefs/msdos/msdosfs_vfsops.c Wed Aug 21 02:17:39 2019        
(r351320)
+++ head/usr.sbin/makefs/msdos/msdosfs_vfsops.c Wed Aug 21 02:21:40 2019        
(r351321)
@@ -60,6 +60,9 @@ __FBSDID("$FreeBSD$");
 
 #include <fs/msdosfs/bootsect.h>
 #include <fs/msdosfs/bpb.h>
+#include "msdos/denode.h"
+#include "msdos/msdosfsmount.h"
+#include <fs/msdosfs/fat.h>
 
 #include <mkfs_msdos.h>
 
@@ -68,10 +71,7 @@ __FBSDID("$FreeBSD$");
 
 #include "ffs/buf.h"
 
-#include "msdos/denode.h"
 #include "msdos/direntry.h"
-#include "msdos/fat.h"
-#include "msdos/msdosfsmount.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 02:17:39 2019        
(r351320)
+++ head/usr.sbin/makefs/msdos/msdosfs_vnops.c  Wed Aug 21 02:21:40 2019        
(r351321)
@@ -63,16 +63,16 @@ __FBSDID("$FreeBSD$");
 #include <unistd.h>
 
 #include <fs/msdosfs/bpb.h>
+#include "msdos/denode.h"
+#include "msdos/msdosfsmount.h"
+#include <fs/msdosfs/fat.h>
 
 #include "makefs.h"
 #include "msdos.h"
 
 #include "ffs/buf.h"
 
-#include "msdos/denode.h"
 #include "msdos/direntry.h"
-#include "msdos/fat.h"
-#include "msdos/msdosfsmount.h"
 
 /*
  * Some general notes:
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to