summaryrefslogtreecommitdiffstats
path: root/sys/fs/msdosfs
Commit message (Collapse)AuthorAgeFilesLines
* Fixed a serious off by 1 error. The cluster-in-use bitmap was overrunbde2004-02-211-2/+1
| | | | | | | by 1 u_int if the number of clusters was 1 more than a multiple of (8 * sizeof(u_int)). The bitmap is malloced and large (often huge), so fatal overrun probably only occurred if the number of clusters was 1 more than 1 multiple of PAGE_SIZE/8.
* Use size_t or ssize_t wherever appropriate instead of casting from int *tjr2004-02-192-26/+27
| | | | | | | to size_t *, which is incorrect because they may have different widths. This caused some subtle forms of corruption, the mostly frequently reported one being that the last character of a filename was sometimes duplicated on amd64.
* 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
* If the "next free cluster" field of the FSInfo block is 0xFFFFFFFF,tjr2004-02-171-2/+4
| | | | | | | | | | it means that the correct value is unknown. Since this value is just a hint to improve performance, initially assume that the first non-reserved cluster is free, then correct this assumption if necessary before writing the FSInfo block back to disk. PR: 62826 MFC after: 2 weeks
* Fixed some style bugs:bde2004-02-141-4/+4
| | | | | | - don't unlock the vnode after vinvalbuf() only to have to relock it almost immediately. - don't refer to devices classified by vn_isdisk() as block devices.
* MFffs (ffs_vfsops.c 1.227: clean up open mode bandaid). This reducesbde2004-02-121-11/+12
| | | | gratuitous differences with ffs a little.
* Locking for the per-process resource limits structure.jhb2004-02-041-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - struct plimit includes a mutex to protect a reference count. The plimit structure is treated similarly to struct ucred in that is is always copy on write, so having a reference to a structure is sufficient to read from it without needing a further lock. - The proc lock protects the p_limit pointer and must be held while reading limits from a process to keep the limit structure from changing out from under you while reading from it. - Various global limits that are ints are not protected by a lock since int writes are atomic on all the archs we support and thus a lock wouldn't buy us anything. - All accesses to individual resource limits from a process are abstracted behind a simple lim_rlimit(), lim_max(), and lim_cur() API that return either an rlimit, or the current or max individual limit of the specified resource from a process. - dosetrlimit() was renamed to kern_setrlimit() to match existing style of other similar syscall helper functions. - The alpha OSF/1 compat layer no longer calls getrlimit() and setrlimit() (it didn't used the stackgap when it should have) but uses lim_rlimit() and kern_setrlimit() instead. - The svr4 compat no longer uses the stackgap for resource limits calls, but uses lim_rlimit() and kern_setrlimit() instead. - The ibcs2 compat no longer uses the stackgap for resource limits. It also no longer uses the stackgap for accessing sysctl's for the ibcs2_sysconf() syscall but uses kernel_sysctl() instead. As a result, ibcs2_sysconf() no longer needs Giant. - The p_rlimit macro no longer exists. Submitted by: mtm (mostly, I only did a few cleanups and catchups) Tested on: i386 Compiled on: alpha, amd64
* 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.
* Fixed some minor style bugs in rev.1.144. All related to msdosfs_advlock()bde2003-12-291-11/+8
| | | | | | | (mainly unsorting). There were no changes related to the dirty flag here. The reference NetBSD implementation put msdosfs_advlock() in a different place. This commit only moves its declarations and changes some of the function body to be like the NetBSD version.
* Fixed style bugs in rev.1.112. The bugs started with obscure magicbde2003-12-291-12/+12
| | | | numbers in comments (Apple PR numbers?) and didn't improve.
* Make msdosfs support the dirty flag in FAT16 and FAT32.trhodes2003-12-265-1/+106
| | | | | | | | Enable lockf support. PR: 55861 Submitted by: Jun Su <junsu@m-net.arbornet.org> (original version) Reviewed by: make universe
* Make msdosfs long filenames matching case insensitive again.fjoe2003-12-081-3/+5
| | | | | PR: 59765 Submitted by: Ryuichiro Imura <imura@ryu16.org>
* Remove mntvnode_mtx and replace it with per-mountpoint mutex.kan2003-11-051-6/+6
| | | | | | | | | | Introduce two new macros MNT_ILOCK(mp)/MNT_IUNLOCK(mp) to operate on this mutex transparently. Eventually new mutex will be protecting more fields in struct mount, not only vnode list. Discussed with: jeff
* Take care not to call vput if thread used in corresponding vgetkan2003-11-021-1/+2
| | | | | | | | | | wasn't curthread, i.e. when we receive a thread pointer to use as a function argument. Use VOP_UNLOCK/vrele in these cases. The only case there td != curthread known at the moment is boot() calling sync with thread0 pointer. This fixes the panic on shutdown people have reported.
* Temporarily undo parts of the stuct mount locking commit by jeff.kan2003-11-011-2/+1
| | | | | | | | It is unsafe to hold a mutex across vput/vrele calls. This will be redone when a better locking strategy is agreed upon. Discussed with: jeff
* DuH!phk2003-10-181-1/+1
| | | | | bp->b_iooffset (the spot on the disk), not bp->b_offset (the offset in the file)
* Initialize b_offset before calling VOP_STRATEGY/VOP_SPECSTRATEGY.phk2003-10-181-0/+1
| | | | | Remove various comments of KASSERTS and comments about B_PHYS which does not apply anymore.
* - Check the XLOCK prior to inspecting v_data.jeff2003-10-051-0/+4
|
* - Don't cache_purge() in *_reclaim routines. vclean() does it for us sojeff2003-10-051-1/+0
| | | | this is redundant.
* - Acquire the vnode interlock prior to droping the mntvnode_mtx. This doesjeff2003-10-041-1/+1
| | | | | not eliminate races where the vnode could be reclaimed and end up with a NULL v_data pointer but Giant is protecting us from that at the moment.
* Fixed some style bugs in previous commit. Mainly, forward-declarebde2003-09-271-15/+21
| | | | | | | | | | struct msdosfsmount so that this file has the same prerequisites as it used to. The new prerequistite was a meta-style bug. It required many style bugs (unsorted includes ...) elsewhere. Formatted prototypes in KNF. Resisted urge to sort all the prototypes, to minimise differences with NetBSD. (NetBSD has reformatted the prototypes but has not sorted them and still uses __P(()).)
* - Support for multibyte charsets in LIBICONV.fjoe2003-09-267-351/+596
| | | | | | | | - 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-123-4/+10
| | | | | | | | | | | 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
* Add a "int fd" argument to VOP_OPEN() which in the future willphk2003-07-261-2/+2
| | | | | | | | | contain the filedescriptor number on opens from userland. The index is used rather than a "struct file *" since it conveys a bit more information, which may be useful to in particular fdescfs and /dev/fd/* For now pass -1 all over the place.
* If bread() returns a zero-length buffer, as can happen after atrhodes2003-07-031-0/+4
| | | | | | | failed write, return an error instead of looping forever. PR: 37035 Submitted by: das
* XXX Copy workaround from UFS: open device for write access even iftjr2003-06-291-0/+19
| | | | | | | | | | | | | | the user requests a read-only mount. This is necessary because we don't do the VOP_OPEN again if they upgrade a read-only mount to read-write. Fixes lockup when creating files on msdosfs mounts that have been mounted read-only then upgraded to read-write. The exact cause of the lockup is not known, but it is likely to be the kernel getting stuck in an infinite loop trying to write dirty buffers to a device without write permission. Reported/tested by andreas, discussed with phk.
* Fix a bug where a truncate operation involving truncate() or ftruncate() ontrhodes2003-06-271-17/+10
| | | | | | | | | an MSDOSFS file system either failed, silently corrupted the file, or sometimes corrupted the neighboring file. PR: 53695 Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my> (original version) MFC: 3 days
* change dev_t to struct cdev * to match ufs. This fixes fstat for cd9660jmg2003-06-241-1/+1
| | | | | | and msdosfs. Reviewed by: bde
* Add the same KASSERT to all VOP_STRATEGY and VOP_SPECSTRATEGY implementationsphk2003-06-151-0/+2
| | | | to check that the buffer points to the correct vnode.
* Initialize struct vfsops C99-sparsely.phk2003-06-121-14/+9
| | | | | Submitted by: hmp Reviewed by: phk
* Remove unused variable(s).phk2003-05-311-6/+0
| | | | Found by: FlexeLint
* Fail to mount a device if the bytes per sector in the BPB is less thanjhb2003-04-241-0/+6
| | | | DEV_BSIZE or if the number of FAT sectors is zero.
* It appears that msdosfs_init() is called multiple times. This happensimp2003-04-101-0/+13
| | | | | | on my system where I preload msdosfs and have it in my kernel. There's likely another bug that's causing msdosfs_init() to be called multiple times, but this makes that harmless.
* - Add a new 'flags' parameter to getblk().jeff2003-03-042-7/+10
| | | | | | | | | | - 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
* Finish cleanup of vprint() which was begun with changing v_tag to a string.njl2003-03-031-1/+1
| | | | | | Remove extraneous uses of vop_null, instead defering to the default op. Rename vnode type "vfs" to the more descriptive "syncer". Fix formatting for various filesystems that use vop_print.
* Clean up whitespace, s/register //, refrain from strong urge to ANSIfy.des2003-03-021-14/+14
|
* uiomove-related caddr_t -> void * (just the low-hanging fruit)des2003-03-021-4/+2
|
* Back out M_* changes, per decision of the TRB.imp2003-02-193-4/+4
| | | | Approved by: trb
* - Cleanup unlocked accesses to buf flags by introducing a new b_vflag memberjeff2003-02-091-37/+4
| | | | | | | | | | that is protected by the vnode lock. - Move B_SCANNED into b_vflags and call it BV_SCANNED. - Create a vop_stdfsync() modeled after spec's sync. - Replace spec_fsync, msdos_fsync, and hpfs_fsync with the stdfsync and some fs specific processing. This gives all of these filesystems proper behavior wrt MNT_WAIT/NOWAIT and the use of the B_SCANNED flag. - Annotate the locking in buf.h
* Split the global timezone structure into two integer fields tophk2003-02-031-2/+2
| | | | | | | | | | prevent the compiler from optimizing assignments into byte-copy operations which might make access to the individual fields non-atomic. Use the individual fields throughout, and don't bother locking them with Giant: it is no longer needed. Inspired by: tjr
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-213-4/+4
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Temporarily introduce a new VOP_SPECSTRATEGY operation while I tryphk2003-01-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | to sort out disk-io from file-io in the vm/buffer/filesystem space. The intent is to sort VOP_STRATEGY calls into those which operate on "real" vnodes and those which operate on VCHR vnodes. For the latter kind, the call will be changed to VOP_SPECSTRATEGY, possibly conditionally for those places where dual-use happens. Add a default VOP_SPECSTRATEGY method which will call the normal VOP_STRATEGY. First time it is called it will print debugging information. This will only happen if a normal vnode is passed to VOP_SPECSTRATEGY by mistake. Add a real VOP_SPECSTRATEGY in specfs, which does what VOP_STRATEGY does on a VCHR vnode today. Add a new VOP_STRATEGY method in specfs to catch instances where the conversion to VOP_SPECSTRATEGY has not yet happened. Handle the request just like we always did, but first time called print debugging information. Apart up to two instances of console messages per boot, this amounts to a glorified no-op commit. If you get any of the messages on your console I would very much like a copy of them mailed to phk@freebsd.org
* Since Jeffr made the std* functions the default in rev 1.63 ofphk2003-01-041-3/+0
| | | | | | | kern/vfs_defaults.c it is wrong for the individual filesystems to use the std* functions as that prevents override of the default. Found by: src/tools/tools/vop_table
* Abstract-out the constants for the sequential heuristic.dillon2002-12-281-1/+1
| | | | | | No operational changes. MFC after: 1 day
* Fix instances of macros with improperly parenthasized arguments.alfred2002-11-091-2/+2
| | | | Verified by: md5
* Fix winChkName() to match when the last slot contains nothing but thesemenu2002-10-291-1/+8
| | | | | | | | terminating zero (it was treated as length missmatch). The mtools create such slots if the name len is the product of 13 (max number of unicode chars fitting in directory slot). MFC after: 1 week
* Grrr, s/PBP/BPB/ here as well.jhb2002-10-211-1/+1
| | | | Noticed by: peter
* Spell the BPB member of the 7.10 bootsector as bsBPB rather than bsPBP tojhb2002-10-211-1/+1
| | | | be like all the other bootsectors. Apple has done the same it seems.
* Regularize the vop_stdlock'ing protocol across all the filesystemsmckusick2002-10-141-3/+0
| | | | | | | | | | | | | | | | | | | | that use it. Specifically, vop_stdlock uses the lock pointed to by vp->v_vnlock. By default, getnewvnode sets up vp->v_vnlock to reference vp->v_lock. Filesystems that wish to use the default do not need to allocate a lock at the front of their node structure (as some still did) or do a lockinit. They can simply start using vn_lock/VOP_UNLOCK. Filesystems that wish to manage their own locks, but still use the vop_stdlock functions (such as nullfs) can simply replace vp->v_vnlock with a pointer to the lock that they wish to have used for the vnode. Such filesystems are responsible for setting the vp->v_vnlock back to the default in their vop_reclaim routine (e.g., vp->v_vnlock = &vp->v_lock). In theory, this set of changes cleans up the existing filesystem lock interface and should have no function change to the existing locking scheme. Sponsored by: DARPA & NAI Labs.
* - Use vrefcnt() where it is safe to do so instead of doing direct andjeff2002-09-253-11/+15
| | | | | | | unlocked accesses to v_usecount. - Lock access to the buf lists in the various sync routines. interlock locking could be avoided almost entirely in leaf filesystems if the fsync function had a generic helper.
OpenPOWER on IntegriCloud