svn commit: r306276 - in head: sbin/mount_msdosfs sys/fs/msdosfs sys/sys

Alan Somers asomers at FreeBSD.org
Fri Sep 23 19:05:09 UTC 2016


Author: asomers
Date: Fri Sep 23 19:05:07 2016
New Revision: 306276
URL: https://svnweb.freebsd.org/changeset/base/306276

Log:
  Mount msdosfs with longnames support by default.
  
  The old behavior depended on the FAT version and on what files were in the
  root directory. "mount_msdosfs -o shortnames" is still supported.
  
  Reviewed by:	wblock, cem
  Discussed with:	trasz, adrian, imp
  MFC after:	4 weeks
  X-MFC-Notes:	Don't MFC the removal of findwin95
  Differential Revision:	https://reviews.freebsd.org/D8018

Modified:
  head/sbin/mount_msdosfs/mount_msdosfs.8
  head/sys/fs/msdosfs/denode.h
  head/sys/fs/msdosfs/msdosfs_lookup.c
  head/sys/fs/msdosfs/msdosfs_vfsops.c
  head/sys/sys/param.h

Modified: head/sbin/mount_msdosfs/mount_msdosfs.8
==============================================================================
--- head/sbin/mount_msdosfs/mount_msdosfs.8	Fri Sep 23 18:55:32 2016	(r306275)
+++ head/sbin/mount_msdosfs/mount_msdosfs.8	Fri Sep 23 19:05:07 2016	(r306276)
@@ -142,15 +142,8 @@ If neither
 nor
 .Fl l
 are given,
-.Nm
-searches the root directory of the file system to
-be mounted for any existing Win'95 long filenames.
-If no such entries are found, but short DOS filenames are found,
-.Fl s
-is the default.
-Otherwise
 .Fl l
-is assumed.
+is the default.
 .It Fl 9
 Ignore the special Win'95 directory entries even
 if deleting or renaming a file.

Modified: head/sys/fs/msdosfs/denode.h
==============================================================================
--- head/sys/fs/msdosfs/denode.h	Fri Sep 23 18:55:32 2016	(r306275)
+++ head/sys/fs/msdosfs/denode.h	Fri Sep 23 19:05:07 2016	(r306276)
@@ -265,7 +265,6 @@ int msdosfs_reclaim(struct vop_reclaim_a
  */
 int deget(struct msdosfsmount *, u_long, u_long, struct denode **);
 int uniqdosname(struct denode *, struct componentname *, u_char *);
-int findwin95(struct denode *);
 
 int readep(struct msdosfsmount *pmp, u_long dirclu, u_long dirofs,  struct buf **bpp, struct direntry **epp);
 int readde(struct denode *dep, struct buf **bpp, struct direntry **epp);

Modified: head/sys/fs/msdosfs/msdosfs_lookup.c
==============================================================================
--- head/sys/fs/msdosfs/msdosfs_lookup.c	Fri Sep 23 18:55:32 2016	(r306275)
+++ head/sys/fs/msdosfs/msdosfs_lookup.c	Fri Sep 23 19:05:07 2016	(r306276)
@@ -1062,55 +1062,3 @@ uniqdosname(struct denode *dep, struct c
 		}
 	}
 }
-
-/*
- * Find any Win'95 long filename entry in directory dep
- */
-int
-findwin95(struct denode *dep)
-{
-	struct msdosfsmount *pmp = dep->de_pmp;
-	struct direntry *dentp;
-	int blsize, win95;
-	u_long cn;
-	daddr_t bn;
-	struct buf *bp;
-
-	win95 = 1;
-	/*
-	 * Read through the directory looking for Win'95 entries
-	 * Note: Error currently handled just as EOF			XXX
-	 */
-	for (cn = 0;; cn++) {
-		if (pcbmap(dep, cn, &bn, 0, &blsize))
-			return (win95);
-		if (bread(pmp->pm_devvp, bn, blsize, NOCRED, &bp)) {
-			brelse(bp);
-			return (win95);
-		}
-		for (dentp = (struct direntry *)bp->b_data;
-		     (char *)dentp < bp->b_data + blsize;
-		     dentp++) {
-			if (dentp->deName[0] == SLOT_EMPTY) {
-				/*
-				 * Last used entry and not found
-				 */
-				brelse(bp);
-				return (win95);
-			}
-			if (dentp->deName[0] == SLOT_DELETED) {
-				/*
-				 * Ignore deleted files
-				 * Note: might be an indication of Win'95 anyway	XXX
-				 */
-				continue;
-			}
-			if (dentp->deAttributes == ATTR_WIN95) {
-				brelse(bp);
-				return 1;
-			}
-			win95 = 0;
-		}
-		brelse(bp);
-	}
-}

Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c
==============================================================================
--- head/sys/fs/msdosfs/msdosfs_vfsops.c	Fri Sep 23 18:55:32 2016	(r306275)
+++ head/sys/fs/msdosfs/msdosfs_vfsops.c	Fri Sep 23 19:05:07 2016	(r306276)
@@ -175,24 +175,8 @@ update_mp(struct mount *mp, struct threa
 
 	if (pmp->pm_flags & MSDOSFSMNT_NOWIN95)
 		pmp->pm_flags |= MSDOSFSMNT_SHORTNAME;
-	else if (!(pmp->pm_flags &
-	    (MSDOSFSMNT_SHORTNAME | MSDOSFSMNT_LONGNAME))) {
-		struct vnode *rootvp;
-
-		/*
-		 * Try to divine whether to support Win'95 long filenames
-		 */
-		if (FAT32(pmp))
-			pmp->pm_flags |= MSDOSFSMNT_LONGNAME;
-		else {
-			if ((error =
-			    msdosfs_root(mp, LK_EXCLUSIVE, &rootvp)) != 0)
-				return error;
-			pmp->pm_flags |= findwin95(VTODE(rootvp)) ?
-			    MSDOSFSMNT_LONGNAME : MSDOSFSMNT_SHORTNAME;
-			vput(rootvp);
-		}
-	}
+	else
+		pmp->pm_flags |= MSDOSFSMNT_LONGNAME;
 	return 0;
 }
 

Modified: head/sys/sys/param.h
==============================================================================
--- head/sys/sys/param.h	Fri Sep 23 18:55:32 2016	(r306275)
+++ head/sys/sys/param.h	Fri Sep 23 19:05:07 2016	(r306276)
@@ -58,7 +58,7 @@
  *		in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1200009	/* Master, propagated to newvers */
+#define __FreeBSD_version 1200010	/* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,


More information about the svn-src-all mailing list