From owner-svn-src-head@freebsd.org Fri Sep 23 19:05:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2030EBE7E46; Fri, 23 Sep 2016 19:05:09 +0000 (UTC) (envelope-from asomers@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 mx1.freebsd.org (Postfix) with ESMTPS id D87211B2; Fri, 23 Sep 2016 19:05:08 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8NJ58d9094740; Fri, 23 Sep 2016 19:05:08 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8NJ57oT094735; Fri, 23 Sep 2016 19:05:07 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201609231905.u8NJ57oT094735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 23 Sep 2016 19:05:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306276 - in head: sbin/mount_msdosfs sys/fs/msdosfs sys/sys X-SVN-Group: head 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.23 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: Fri, 23 Sep 2016 19:05:09 -0000 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,