summaryrefslogtreecommitdiffstats
path: root/sys/fs/msdosfs/msdosfs_fat.c
Commit message (Collapse)AuthorAgeFilesLines
* Don't use almost perfectly pessimal cluster allocation. Allocationbde2007-07-101-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* Fix spacing from my previous commit to this file:trhodes2007-01-301-1/+1
| | | | Noticed by: fjoe
* Add a 3rd entry in the cache, which keeps the end positiontrhodes2007-01-161-2/+9
| | | | | | | | | | from just before extending a file. This has the desired effect of keeping the write speed constant. And yes, that helps a lot copying large files always at full speed now, and I have seen improvements using benchmarks/bonnie. Stolen from: NetBSD Reviewed by: bde
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-061-1/+1
|
* Merge from NetBSD:tjr2004-09-081-0/+5
| | | | | | | | | | Fix a panic that occurred when trying to traverse a corrupt msdosfs filesystem. With this particular corruption, the code in pcbmap() would compute an offset into an array that was way out of bounds, so check the bounds before trying to access and return an error if the offset would be out of bounds. Submitted by: Xin LI
* Fixed some (most) style bugs in rev.1.33. Mainly 4-char indentationbde2003-12-291-58/+68
| | | | | | (msdosfs uses normal 8-char indentation almost everywhere else), too-long lines, and minor English usage errors. The verbose formal comment before the new function is still abnormal.
* Make msdosfs support the dirty flag in FAT16 and FAT32.trhodes2003-12-261-0/+67
| | | | | | | | Enable lockf support. PR: 55861 Submitted by: Jun Su <junsu@m-net.arbornet.org> (original version) Reviewed by: make universe
* - Add a new 'flags' parameter to getblk().jeff2003-03-041-5/+8
| | | | | | | | | | - Define one flag GB_LOCK_NOWAIT that tells getblk() to pass the LK_NOWAIT flag to the initial BUF_LOCK(). This will eventually be used in cases were we want to use a buffer only if it is not currently in use. - Convert all consumers of the getblk() api to use this extra parameter. Reviwed by: arch Not objected to by: mckusick
* More s/file system/filesystem/gtrhodes2002-05-161-2/+2
|
* Fixed some style bugs in the removal of __P(()). Continuation linesbde2002-03-231-10/+10
| | | | | were not outdented to preserve non-KNF lining up of code with parentheses. Switch to KNF formatting.
* Remove __P.alfred2002-03-191-14/+14
|
* Introduce the new 64-bit size disk block, daddr64_t. Changemckusick2002-03-151-1/+4
| | | | | | | | | | | | the bio and buffer structures to have daddr64_t bio_pblkno, b_blkno, and b_lblkno fields which allows access to disks larger than a Terabyte in size. This change also requires that the VOP_BMAP vnode operation accept and return daddr64_t blocks. This delta should not affect system operation in any way. It merely sets up the necessary interfaces to allow the development of disk drivers that work with these larger disk block addresses. It also allows for the development of UFS2 which will use 64-bit block addresses.
* - sys/msdosfs moved to sys/fs/msdosfsru2001-05-251-5/+5
| | | | | - msdos.ko renamed to msdosfs.ko - /usr/include/msdosfs moved to /usr/include/fs/msdosfs
* Revert consequences of changes to mount.h, part 2.grog2001-04-291-2/+0
| | | | Requested by: bde
* Correct #includes to work with fixed sys/mount.h.grog2001-04-231-0/+2
|
* Separate the struct bio related stuff out of <sys/buf.h> intophk2000-05-051-0/+1
| | | | | | | | | | | | | | | <sys/bio.h>. <sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall not be made a nested include according to bdes teachings on the subject of nested includes. Diskdrivers and similar stuff below specfs::strategy() should no longer need to include <sys/buf.> unless they need caching of data. Still a few bogus uses of struct buf to track down. Repocopy by: peter
* Supported non-512 bytes/sector format.nyan2000-01-271-2/+3
| | | | | | | 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>
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Support compiling with `gcc -ansi'.bde1998-04-151-5/+7
|
* Use random() rather then than homegrown stuff.phk1998-04-061-11/+3
|
* Fix dead hang writing to FATache1998-03-281-2/+2
| | | | Submitted by: Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>
* Removed unused #includes.bde1998-02-201-2/+1
|
* Update MSDOSFS code using NetBSD's msdosfs as a guide to supportjkh1998-02-181-171/+281
| | | | | | | | | | | 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
* Staticize.eivind1998-02-091-6/+6
|
* Back out DIAGNOSTIC changes.eivind1998-02-061-6/+1
|
* Turn DIAGNOSTIC into a new-style option.eivind1998-02-041-1/+6
|
* Removed unused #includes.bde1997-09-021-4/+1
|
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* 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.
* Added prototypes.bde1995-12-031-2/+17
|
* staticize private parts.phk1995-11-071-4/+5
|
* Second batch of cleanup changes.phk1995-10-291-2/+2
| | | | | This time mostly making a lot of things static and some unused variables here and there.
* Remove trailing whitespace.rgrimes1995-05-301-32/+32
|
* Submitted by: Wolfgang Solfrank <ws@tools.de>bde1995-04-111-2/+2
| | | | | Fix off-by-1-sector error in the range checking for the end of the root directory. It was possible for the root directory to overwrite the FAT.
* Use the correct block number for updating the backup copy of the FAT whenbde1995-02-101-2/+2
| | | | deleting a file. Deleting a large file used to scramble the backup copy.
* Fix numerous timestamp bugs.bde1994-12-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DE_UPDATE was confused with DE_MODIFIED in some places (they do have confusing names). Handle them exactly the same as IN_UPDATE and IN_MODIFIED. This fixes chmod() and chown() clobbering the mtime and other bugs. DE_MODIFIED was set but not used. Parenthesize macro args. DE_TIMES() now takes a timeval arg instead of a timespec arg. It was stupid to use a macro for speed and do unused conversions to prepare for the macro. Restore the left shifting of the DOS seconds count by 1. It got lost among the shifts for the bitfields, so DOS seconds counts appeared to range from 0 to 29 seconds (step 1) instead of 0 to 58 seconds (step 2). Actually use the passed-in mtime in deupdat() as documented so that utimes() works. Change `extern __inline's to `static inline's so that msdosfs_fat.o can be linked when it is compiled without -O. Remove faking of directory mtimes to always be the current time. It's more surprising for directory mtimes to change when you read the directories than for them not to change when you write the directories. This should be controlled by a mount-time option if at all.
* Cosmetics. Silence gcc -Wallphk1994-10-101-5/+4
|
* Added declarations, fixed bugs due to missing decls. At least one of themphk1994-09-271-12/+13
| | | | could panic a system. (I know, it paniced mine!).
* Added msdosfs.dfr1994-09-191-0/+984
Obtained from: NetBSD
OpenPOWER on IntegriCloud