summaryrefslogtreecommitdiffstats
path: root/sys/fs/msdosfs/msdosfsmount.h
Commit message (Collapse)AuthorAgeFilesLines
* This update changes the mnt_flag field in the mount structure frommckusick2011-07-241-1/+1
| | | | | | | | | | 32 bits to 64 bits and eliminates the unused mnt_xflag field. The existing mnt_flag field is completely out of bits, so this update gives us room to expand. Note that the f_flags field in the statfs structure is already 64 bits, so the expanded mnt_flag field can be exported without having to make any changes in the statfs structure. Approved by: re (bz)
* The r184588 changed the layout of struct export_args, causing an ABIkib2010-10-101-1/+1
| | | | | | | | | | breakage for old mount(2) syscall, since most struct <filesystem>_args embed export_args. The mount(2) is supposed to provide ABI compatibility for pre-nmount mount(8) binaries, so restore ABI to pre-r184588. Requested and reviewed by: bde MFC after: 2 weeks
* Add per-mountpoint lockmgr lock for msdosfs. It is intended to be usedkib2010-02-281-1/+13
| | | | | | | as fat bitmap lock and to replace global mutex protecting fileno rbtree. Tested by: pho MFC after: 3 weeks
* - Hold a reference on the cdev a filesystem is mounted from in the mount.jhb2009-02-271-1/+2
| | | | | | | - Remove the cdev pointers from the denode and instead use the mountpoint's reference to call dev2udev() in getattr(). Reviewed by: kib, julian
* Fix some bugs involving the fsinfo block (many remain unfixed). This isbde2007-07-121-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | part of fixing msdosfs for large sector sizes. One of the fixed bugs was fatal for large sector sizes. 1. The fsinfo block has size 512, but it was misunderstood and declared as having size 1024, with nothing in the second 512 bytes except a signature at the end. The second 512 bytes actually normally (if the file system was created by Windows) consist of a second boot sector which is normally (in WinXP) empty except for a signature -- the normal layout is one boot sector, one fsinfo sector, another boot sector, then these 3 sectors duplicated. However, other layouts are valid. newfs_msdos produces a valid layout with one boot sector, one fsinfo sector, then these 2 sectors duplicated. The signature check for the extra part of the fsinfo was thus normally checking the signature in either the second boot sector or the first boot sector in the copy, and thus accidentally succeeding. The extra signature check would just fail for weirder layouts with 512-byte sectors, and for normal layouts with any other sector size. Remove the extra bytes and the extra signature check. 2. Old versions did i/o to the fsinfo block using size 1024, with the second half only used for the extra signature check on read. This was harmless for sector size 512, and worked accidentally for sector size 1024. The i/o just failed for larger sector sizes. The version being fixed did i/o to the fsinfo block using size fsi_size(pmp) = (1024 << ((pmp)->pm_BlkPerSec >> 2)). This expression makes no sense. It happens to work for sector small sector sizes, but for sector size 32K it gives the preposterous value of 64M and thus causes panics. A sector size of 32768 is necessary for at least some DVD-RW's (where the minimum write size is 32768 although the minimum read size is 2048). Now that the size of the fsinfo block is 512, it always fits in one sector so there is no need for a macro to express it. Just use the sector size where the old code uses 1024. Approved by: re (kensmith) Approved by: nyan (several years ago for a different version of (2))
* Don't use almost perfectly pessimal cluster allocation. Allocationbde2007-07-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of the the first cluster in a file (and, if the allocation cannot be continued contiguously, for subsequent clusters in a file) was randomized in an attempt to leave space for contiguous allocation of subsequent clusters in each file when there are multiple writers. This reduced internal fragmentation by a few percent, but it increased external fragmentation by up to a few thousand percent. Use simple sequential allocation instead. Actually maintain the fsinfo sequence index for this. The read and write of this index from/to disk still have many non-critical bugs, but we now write an index that has something to do with our allocations instead of being modified garbage. If there is no fsinfo on the disk, then we maintain the index internally and don't go near the bugs for writing it. Allocating the first free cluster gives a layout that is almost as good (better in some cases), but takes too much CPU if the FAT is large and the first free cluster is not near the beginning. The effect of this change for untar and tar of a slightly reduced copy of /usr/src on a new file system was: Before (msdosfs 4K-clusters): untar: 459.57 real untar from cached file (actually a pipe) tar: 342.50 real tar from uncached tree to /dev/zero Before (ffs2 soft updates 4K-blocks 4K-frags) untar: 39.18 real tar: 29.94 real Before (ffs2 soft updates 16K-blocks 2K-frags) untar: 31.35 real tar: 18.30 real After (msdosfs 4K-clusters): untar 54.83 real tar 16.18 real All of these times can be improved further. With multiple concurrent writers or readers (especially readers), the improvement is smaller, but I couldn't find any case where it is negative. 342 seconds for tarring up about 342 MB on a ~47MB/S partition is just hard to unimprove on. (This operation would take about 7.3 seconds with reasonably localized allocation and perfect read-ahead.) However, for active file systems, 342 seconds is closer to normal than the 16+ seconds above or the 11 seconds with other changes (best I've measured -- won easily by msdosfs!). E.g., my active /usr/src on ffs1 is quite old and fragmented, so reading to prepare for the above benchmark takes about 6 times longer than reading back the fresh copies of it. Approved by: re (kensmith)
* Eliminate cdev pointer in inodes, they're not used or needed.phk2005-03-151-1/+0
| | | | | The cdev could have been pulled out of the mountpoint cheaper back when it was used anyway.
* Use vfs_hash instead of home-rolling.phk2005-03-141-4/+0
|
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-061-1/+1
|
* Move MSDOSFS to GEOM backing instead of DEVFS.phk2004-10-291-0/+2
| | | | For details, please see src/sys/ufs/ffs/ffs_vfsops.c 1.250.
* By popular request, add a workaround that allows large (>128GB or so)tjr2004-07-031-1/+23
| | | | | | | | | | | | | | | FAT32 filesystems to be mounted, subject to some fairly serious limitations. This works by extending the internal pseudo-inode-numbers generated from the file's starting cluster number to 64-bits, then creating a table mapping these into arbitrary 32-bit inode numbers, which can fit in struct dirent's d_fileno and struct vattr's va_fileid fields. The mappings do not persist across unmounts or reboots, so it's not possible to export these filesystems through NFS. The mapping table may grow to be rather large, and may grow large enough to exhaust kernel memory on filesystems with millions of files. Don't enable this option unless you understand the consequences.
* Do the dreaded s/dev_t/struct cdev */phk2004-06-161-1/+1
| | | | Bump __FreeBSD_version accordingly.
* Do not place dirmask in unnamed padding. Move it to the bottom of thistrhodes2004-02-171-1/+1
| | | | | | list where it should have been added originally. Prodded by: bde
* - Support for multibyte charsets in LIBICONV.fjoe2003-09-261-13/+9
| | | | | | | | - CD9660_ICONV, NTFS_ICONV and MSDOSFS_ICONV kernel options (with corresponding modules). - kiconv(3) for loadable charset conversion tables support. Submitted by: Ryuichiro Imura <imura@ryu16.org>
* Add a '-M mask' option so that users can have differenttrhodes2003-08-121-2/+6
| | | | | | | | | | | masks for files and directories. This should make some of the Midnight Commander users happy. Remove an extra ')' in the manual page. PR: 35699 Submitted by: Eugene Grosbein <eugen@grosbein.pp.ru> (original version) Tested by: simon
* More s/file system/filesystem/gtrhodes2002-05-161-1/+1
|
* Remove __P.alfred2002-03-191-3/+3
|
* Axe more unused GEMDOS code that was #ifdef atari.jhb2001-11-281-1/+1
| | | | | PR: kern/21809 Submitted by: <mbendiks@eunet.no>
* Remove GEMDOS support from msdosfs. I don't think anyone is going tojhb2001-11-271-3/+0
| | | | port FreeBSD to Atari machines any time soon.
* Move the netexport structure from the fs-specific mountstructurephk2001-04-251-1/+0
| | | | | | | | | | | | | | to struct mount. This makes the "struct netexport *" paramter to the vfs_export and vfs_checkexport interface unneeded. Consequently that all non-stacking filesystems can use vfs_stdcheckexp(). At the same time, make it a pointer to a struct netexport in struct mount, so that we can remove the bogus AF_MAX and #include <net/radix.h> from <sys/mount.h>
* Quick fix for msdsofs_write() on alphas and other machines with eitherbde2000-08-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | longs larger than 32 bits or strict alignment requirements. pm_fatmask had type u_long, but it must have a type that has precisely 32 bits and this type must be no smaller than int, so that ~pmp->pm_fatmask has no bits above the 31st set. Otherwise, comparisons between (cn | ~pmp->pm_fatmask) and magic 32-bit "cluster" numbers always fail. The correct fix is to use the C99 type uint_least32_t and mask with 0xffffffff. The quick fix is to use u_int32_t and assume that ints have msdosfs metadata is riddled with unaligned fields, and on alphas, unaligned_fixup() apparently has problems fixing up the unaligned accesses caused by this. The quick fix is to not comment out the NetBSD code that sort of handles this, and define UNALIGNED_ACCESS on i386's so that the code doesn't change on i386's. The correct fix would define UNALIGNED_ACCESS in a central machine-dependent header and maybe add some extra cases to unaligned_fixup(). UNALIGNED_ACCESS is also tested in isofs. Submitted by: parts by Mark Abene <phiber@radicalmedia.com> PR: 19086
* Fix memory leakage on module unload.bp2000-06-291-0/+1
| | | | Spotted by: fixed INVARIANTS code
* Supported non-512 bytes/sector format.nyan2000-01-271-0/+7
| | | | | | | PR: misc/12992 Submitted by: chi@bd.mbn.or.jp (Chiharu Shibata) and Dmitrij Tejblum <tejblum@arc.hq.cti.ru> Reviewed by: Dmitrij Tejblum <tejblum@arc.hq.cti.ru>
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"peter1999-12-291-2/+2
| | | | | | is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come.
* It is possible that number of sectors specified in the BPBbp1999-12-281-1/+0
| | | | | | | | will exceed FAT capacity. This will lead to kernel panic while other systems just limit number of clusters. PR: 4381, 15136 Reviewed by: phk
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Implement loadable DOS<->local conversion tables for DOS namesache1998-02-231-3/+10
| | | | | Always create DOS name in uppercase Always view DOS name in lowercase
* Implement loadable upper->lower local conversion tableache1998-02-231-2/+5
|
* Implement loadable local<->unicode file names conversionache1998-02-221-2/+5
| | | | | | Note: it produce correct names only for Win95, DOS names are still incorrect and need similar work mount_msdos support coming soon
* Update MSDOSFS code using NetBSD's msdosfs as a guide to supportjkh1998-02-181-57/+88
| | | | | | | | | | | FAT32 partitions. Unfortunately, we looked around here at Walnut Creek CDROM for any newer FAT32-supporting versions of Win95 and we were unsuccessful; only the older stuff here. So this is untested beyond simply making sure it compiles and someone with access to an actual FAT32 fs will have to let us know how well it actually works. Submitted by: Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru> Obtained from: NetBSD
* Last major round (Unless Bruce thinks of somthing :-) of malloc changes.phk1997-10-121-1/+5
| | | | | | | | Distribute all but the most fundamental malloc types. This time I also remembered the trick to making things static: Put "static" in front of them. A couple of finer points by: bde
* Don't export kernel interfaces to applications. msdosfs_mount probablybde1997-03-031-1/+9
| | | | | | didn't compile before this change. Added idempotency ifdef.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make this compile without warnings after the Lite2 merge:mpp1997-02-121-1/+1
| | | | | | | | | - *fs_init routines now take a "struct vfsconf * vfsp" pointer as an argument. - Use the correct type for cookies. - Update function prototypes. Submitted by: bde
* This is the kernel Lite/2 commit. There are some requisite userlanddyson1997-02-101-0/+12
| | | | | | | | | | | | | | | changes, so don't expect to be able to run the kernel as-is (very well) without the appropriate Lite/2 userland changes. The system boots and can mount UFS filesystems. Untested: ext2fs, msdosfs, NFS Known problems: Incorrect Berkeley ID strings in some files. Mount_std mounts will not work until the getfsent library routine is changed. Reviewed by: various people Submitted by: Jeffery Hsu <hsu@freebsd.org>
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Fix a bunch of spelling errors in the comment fields ofmpp1996-01-301-2/+2
| | | | a bunch of system include files.
* Moved declarations for static functions to the correct place (not in abde1995-11-161-16/+2
| | | | header) and cleaned them up.
* staticize private parts.phk1995-11-071-11/+11
|
* Remove trailing whitespace.rgrimes1995-05-301-18/+18
|
* Added declarations, fixed bugs due to missing decls. At least one of themphk1994-09-271-1/+3
| | | | could panic a system. (I know, it paniced mine!).
* Added msdosfs.dfr1994-09-191-0/+183
Obtained from: NetBSD
OpenPOWER on IntegriCloud