Author: emaste
Date: Mon Jun 12 20:42:37 2017
New Revision: 319870
URL: https://svnweb.freebsd.org/changeset/base/319870

Log:
  msdosfs: adjust #ifdefs to be similar to NetBSD
  
  - Add header guards where missing
  - Make parts available for use in makefs
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/fs/msdosfs/denode.h
  head/sys/fs/msdosfs/direntry.h
  head/sys/fs/msdosfs/fat.h

Modified: head/sys/fs/msdosfs/denode.h
==============================================================================
--- head/sys/fs/msdosfs/denode.h        Mon Jun 12 20:42:16 2017        
(r319869)
+++ head/sys/fs/msdosfs/denode.h        Mon Jun 12 20:42:37 2017        
(r319870)
@@ -47,6 +47,8 @@
  *
  * October 1992
  */
+#ifndef _FS_MSDOSFS_DENODE_H_
+#define        _FS_MSDOSFS_DENODE_H_
 
 /*
  * This is the pc filesystem specific portion of the vnode structure.
@@ -207,7 +209,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)
@@ -277,4 +279,6 @@ 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/sys/fs/msdosfs/direntry.h
==============================================================================
--- head/sys/fs/msdosfs/direntry.h      Mon Jun 12 20:42:16 2017        
(r319869)
+++ head/sys/fs/msdosfs/direntry.h      Mon Jun 12 20:42:37 2017        
(r319870)
@@ -133,7 +133,7 @@ struct winentry {
 #define DD_YEAR_MASK           0xFE00  /* year - 1980 */
 #define DD_YEAR_SHIFT          9
 
-#ifdef _KERNEL
+#if defined(_KERNEL) || defined(MAKEFS)
 struct mbnambuf {
        size_t  nb_len;
        int     nb_last_id;
@@ -159,5 +159,5 @@ int win2unixfn(struct mbnambuf *nbp, struct winentry *
 uint8_t winChksum(uint8_t *name);
 int    winSlotCnt(const u_char *un, size_t unlen, struct msdosfsmount *pmp);
 size_t winLenFixup(const u_char *un, size_t unlen);
-#endif /* _KERNEL */
+#endif /* _KERNEL || MAKEFS */
 #endif /* !_FS_MSDOSFS_DIRENTRY_H_ */

Modified: head/sys/fs/msdosfs/fat.h
==============================================================================
--- head/sys/fs/msdosfs/fat.h   Mon Jun 12 20:42:16 2017        (r319869)
+++ head/sys/fs/msdosfs/fat.h   Mon Jun 12 20:42:37 2017        (r319870)
@@ -48,6 +48,8 @@
  * October 1992
  */
 
+#ifndef _FS_MSDOSFS_FAT_H_
+#define        _FS_MSDOSFS_FAT_H_
 /*
  * Some useful cluster numbers.
  */
@@ -78,7 +80,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().
@@ -101,4 +103,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_ */
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to