aboutsummaryrefslogtreecommitdiff
path: root/sys/msdosfs
Commit message (Collapse)AuthorAgeFilesLines
* - sys/msdosfs moved to sys/fs/msdosfsRuslan Ermilov2001-05-2512-7945/+0
| | | | | | | | - msdos.ko renamed to msdosfs.ko - /usr/include/msdosfs moved to /usr/include/fs/msdosfs Notes: svn path=/head/; revision=77162
* Change the second argument of vflush() to an integer that specifiesIan Dowse2001-05-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | the number of references on the filesystem root vnode to be both expected and released. Many filesystems hold an extra reference on the filesystem root vnode, which must be accounted for when determining if the filesystem is busy and then released if it isn't busy. The old `skipvp' approach required individual filesystem xxx_unmount functions to re-implement much of vflush()'s logic to deal with the root vnode. All 9 filesystems that hold an extra reference on the root vnode got the logic wrong in the case of forced unmounts, so `umount -f' would always fail if there were any extra root vnode references. Fix this issue centrally in vflush(), now that we can. This commit also fixes a vnode reference leak in devfs, which could result in idle devfs filesystems that refuse to unmount. Reviewed by: phk, bp Notes: svn path=/head/; revision=76688
* Implement vop_std{get|put}pages() and add them to the default vop[].Poul-Henning Kamp2001-05-011-31/+0
| | | | | | | | Un-copy&paste all the VOP_{GET|PUT}PAGES() functions which do nothing but the default. Notes: svn path=/head/; revision=76167
* Revert consequences of changes to mount.h, part 2.Greg Lehey2001-04-295-10/+0
| | | | | | | Requested by: bde Notes: svn path=/head/; revision=76117
* Move the netexport structure from the fs-specific mountstructurePoul-Henning Kamp2001-04-252-23/+2
| | | | | | | | | | | | | | | | | 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> Notes: svn path=/head/; revision=75934
* Correct #includes to work with fixed sys/mount.h.Greg Lehey2001-04-235-0/+10
| | | | Notes: svn path=/head/; revision=75858
* Grab the process lock while calling psignal and before calling psignal.John Baldwin2001-03-071-0/+2
| | | | Notes: svn path=/head/; revision=73929
* Reviewed by: jlemonAdrian Chadd2001-03-011-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An initial tidyup of the mount() syscall and VFS mount code. This code replaces the earlier work done by jlemon in an attempt to make linux_mount() work. * the guts of the mount work has been moved into vfs_mount(). * move `type', `path' and `flags' from being userland variables into being kernel variables in vfs_mount(). `data' remains a pointer into userspace. * Attempt to verify the `type' and `path' strings passed to vfs_mount() aren't too long. * rework mount() and linux_mount() to take the userland parameters (besides data, as mentioned) and pass kernel variables to vfs_mount(). (linux_mount() already did this, I've just tidied it up a little more.) * remove the copyin*() stuff for `path'. `data' still requires copyin*() since its a pointer into userland. * set `mount->mnt_statf_mntonname' in vfs_mount() rather than in each filesystem. This variable is generally initialised with `path', and each filesystem can override it if they want to. * NOTE: f_mntonname is intiailised with "/" in the case of a root mount. Notes: svn path=/head/; revision=73286
* Change and clean the mutex lock interface.Bosko Milekic2001-02-093-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mtx_enter(lock, type) becomes: mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks) mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized) similarily, for releasing a lock, we now have: mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN. We change the caller interface for the two different types of locks because the semantics are entirely different for each case, and this makes it explicitly clear and, at the same time, it rids us of the extra `type' argument. The enter->lock and exit->unlock change has been made with the idea that we're "locking data" and not "entering locked code" in mind. Further, remove all additional "flags" previously passed to the lock acquire/release routines with the exception of two: MTX_QUIET and MTX_NOSWITCH The functionality of these flags is preserved and they can be passed to the lock/unlock routines by calling the corresponding wrappers: mtx_{lock, unlock}_flags(lock, flag(s)) and mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN locks, respectively. Re-inline some lock acq/rel code; in the sleep lock case, we only inline the _obtain_lock()s in order to ensure that the inlined code fits into a cache line. In the spin lock case, we inline recursion and actually only perform a function call if we need to spin. This change has been made with the idea that we generally tend to avoid spin locks and that also the spin locks that we do have and are heavily used (i.e. sched_lock) do recurse, and therefore in an effort to reduce function call overhead for some architectures (such as alpha), we inline recursion for this case. Create a new malloc type for the witness code and retire from using the M_DEV type. The new type is called M_WITNESS and is only declared if WITNESS is enabled. Begin cleaning up some machdep/mutex.h code - specifically updated the "optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently need those. Finally, caught up to the interface changes in all sys code. Contributors: jake, jhb, jasone (in no particular order) Notes: svn path=/head/; revision=72200
* Fix typo: seperate -> separate.Jeroen Ruigrok van der Werven2001-02-061-1/+1
| | | | | | | Seperate does not exist in the english language. Notes: svn path=/head/; revision=72091
* Mechanical change to use <sys/queue.h> macro API instead ofPoul-Henning Kamp2001-02-041-1/+1
| | | | | | | | | | fondling implementation details. Created with: sed(1) Reviewed by: md5(1) Notes: svn path=/head/; revision=71999
* Convert all simplelocks to mutexes and remove the simplelock implementations.Jason Evans2001-01-242-21/+18
| | | | Notes: svn path=/head/; revision=71576
* Use macro API to <sys/queue.h>Poul-Henning Kamp2000-12-311-2/+2
| | | | Notes: svn path=/head/; revision=70536
* Convert more malloc+bzero to malloc+M_ZERO.David Malone2000-12-081-4/+2
| | | | | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net> Notes: svn path=/head/; revision=69781
* Weaken a bogus dependency on <sys/proc.h> in <sys/buf.h> by #ifdef'ingPoul-Henning Kamp2000-10-291-1/+0
| | | | | | | | | | | | | the offending inline function (BUF_KERNPROC) on it being #included already. I'm not sure BUF_KERNPROC() is even the right thing to do or in the right place or implemented the right way (inline vs normal function). Remove consequently unneeded #includes of <sys/proc.h> Notes: svn path=/head/; revision=67885
* Update stale comment.Boris Popov2000-10-221-3/+1
| | | | | | | PR: kern/21805 Notes: svn path=/head/; revision=67438
* Remove de_lock field from denode structure and make msdosfs PDIRUNLOCK aware.Boris Popov2000-10-224-13/+27
| | | | Notes: svn path=/head/; revision=67437
* Blow away the v_specmountpoint define, replacing it with what it wasEivind Eklund2000-10-091-2/+2
| | | | | | | defined as (rdev->si_mountpoint) Notes: svn path=/head/; revision=66886
* Convert lockmgr locks from using simple locks to using mutexes.Jason Evans2000-10-043-6/+13
| | | | | | | | | Add lockdestroy() and appropriate invocations, which corresponds to lockinit() and must be called to clean up after a lockmgr lock is no longer needed. Notes: svn path=/head/; revision=66615
* o Restructure vaccess() so as to check for DAC permission to modify theRobert Watson2000-08-291-1/+1
| | | | | | | | | | | | | | | | | | | object before falling back on privilege. Make vaccess() accept an additional optional argument, privused, to determine whether privilege was required for vaccess() to return 0. Add commented out capability checks for reference. Rename some variables to make it more clear which modes/uids/etc are associated with the object, and which with the access mode. o Update file system use of vaccess() to pass NULL as the optional privused argument. Once additional patches are applied, suser() will no longer set ASU, so privused will permit passing of privilege information up the stack to the caller. Reviewed by: bde, green, phk, -security, others Obtained from: TrustedBSD Project Notes: svn path=/head/; revision=65200
* Quick fix for msdsofs_write() on alphas and other machines with eitherBruce Evans2000-08-252-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=65075
* Centralize the canonical vop_access user/group/other check in vaccess().Poul-Henning Kamp2000-08-201-41/+3
| | | | | | | Discussed with: bde Notes: svn path=/head/; revision=64865
* Certain error contitions cause msdosfs_rename() to decrement theDavid Malone2000-07-141-2/+2
| | | | | | | | | | | vnode reference count on 'fdvp' more times than it should. PR: 17347 Submitted by: Ian Dowse <iedowse@maths.tcd.ie> Approved by: bde Notes: svn path=/head/; revision=63141
* Fix memory leakage on module unload.Boris Popov2000-06-293-1/+12
| | | | | | | Spotted by: fixed INVARIANTS code Notes: svn path=/head/; revision=62227
* Remove obsolete comment.Boris Popov2000-06-251-5/+0
| | | | | | | Submitted by: Marius Bendiksen <mbendiks@eunet.no> Notes: svn path=/head/; revision=62048
* Separate the struct bio related stuff out of <sys/buf.h> intoPoul-Henning Kamp2000-05-055-0/+5
| | | | | | | | | | | | | | | | | | <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 Notes: svn path=/head/; revision=60041
* Remove unneeded #include <vm/vm_zone.h>Poul-Henning Kamp2000-04-302-2/+0
| | | | | | | Generated by: src/tools/tools/kerninclude Notes: svn path=/head/; revision=59794
* Complete the bio/buf divorce for all code below devfs::strategyPoul-Henning Kamp2000-04-151-2/+2
| | | | | | | | | | | | | Exceptions: Vinum untouched. This means that it cannot be compiled. Greg Lehey is on the case. CCD not converted yet, casts to struct buf (still safe) atapi-cd casts to struct buf to examine B_PHYS Notes: svn path=/head/; revision=59249
* Move B_ERROR flag to b_ioflags and call it BIO_ERROR.Poul-Henning Kamp2000-04-021-1/+1
| | | | | | | | | | | | | | | | (Much of this done by script) Move B_ORDERED flag to b_ioflags and call it BIO_ORDERED. Move b_pblkno and b_iodone_chain to struct bio while we transition, they will be obsoleted once bio structs chain/stack. Add bio_queue field for struct bio aware disksort. Address a lot of stylistic issues brought up by bde. Notes: svn path=/head/; revision=58934
* Commit the buffer cache cleanup patch to 4.x and 5.x. This patch fixes aMatthew Dillon2000-03-271-1/+3
| | | | | | | | | | | | | | | | | | | fragmentation problem due to geteblk() reserving too much space for the buffer and imposes a larger granularity (16K) on KVA reservations for the buffer cache to avoid fragmentation issues. The buffer cache size calculations have been redone to simplify them (fewer defines, better comments, less chance of running out of KVA). The geteblk() fix solves a performance problem that DG was able reproduce. This patch does not completely fix the KVA fragmentation problems, but it goes a long way Mostly Reviewed by: bde and others Approved by: jkh Notes: svn path=/head/; revision=58706
* Supported non-512 bytes/sector format.Yoshihiro Takahashi2000-01-274-70/+61
| | | | | | | | | | 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> Notes: svn path=/head/; revision=56674
* Give vn_isdisk() a second argument where it can return a suitable errno.Poul-Henning Kamp2000-01-101-2/+2
| | | | | | | Suggested by: bde Notes: svn path=/head/; revision=55756
* Treat negative uio_offset value as eof (idea by: bde).Boris Popov2000-01-081-8/+11
| | | | | | | | | | Prevent overflows by casting uio_offset to uoff_t. Return correct error number if directory entry is broken. Reviewed by: bde Notes: svn path=/head/; revision=55594
* Fix the mess with signed/unsigned longs and ints (inspired by bde).Boris Popov2000-01-021-18/+26
| | | | | | | | | Fix potential bug with directory reading. Explicitly limit file size to 4GB (msdos can't handle larger files). Slightly reorganize msdosfs_read() to reduce number of 'if's. Notes: svn path=/head/; revision=55308
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"Peter Wemm1999-12-294-8/+8
| | | | | | | | | 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. Notes: svn path=/head/; revision=55206
* Avoid to write garbage if uiomove fails.Boris Popov1999-12-281-0/+4
| | | | Notes: svn path=/head/; revision=55190
* Fix an overflow in the msdosfs_read() function which exposed on the filesBoris Popov1999-12-281-3/+3
| | | | | | | | | | | with size > 2GB. PR: 15639 Submitted by: Tim Kientzle <kientzle@acm.org> Reviewed by: phk Notes: svn path=/head/; revision=55189
* It is possible that number of sectors specified in the BPBBoris Popov1999-12-282-6/+14
| | | | | | | | | | | will exceed FAT capacity. This will lead to kernel panic while other systems just limit number of clusters. PR: 4381, 15136 Reviewed by: phk Notes: svn path=/head/; revision=55188
* Second pass commit to introduce new ACL and Extended Attribute systemRobert Watson1999-12-191-1/+3
| | | | | | | | | | calls, vnops, vfsops, both in /kern, and to individual file systems that require a vfsop_ array entry. Reviewed by: eivind Notes: svn path=/head/; revision=54803
* Introduce NDFREE (and remove VOP_ABORTOP)Eivind Eklund1999-12-152-26/+2
| | | | Notes: svn path=/head/; revision=54655
* struct mountlist and struct mount.mnt_list have no business beingPoul-Henning Kamp1999-11-201-1/+1
| | | | | | | | | | | | | a CIRCLEQ. Change them to TAILQ_HEAD and TAILQ_ENTRY respectively. This removes ugly mp != (void*)&mountlist comparisons. Requested by: phk Submitted by: Jake Burkholder jake@checker.org PR: 14967 Notes: svn path=/head/; revision=53452
* Next step in the device cleanup process.Poul-Henning Kamp1999-11-091-0/+2
| | | | | | | | | | | Correctly lock vnodes when calling VOP_OPEN() from filesystem mount code. Unify spec_open() for bdev and cdev cases. Remove the disabled bdev specific read/write code. Notes: svn path=/head/; revision=53059
* More removals of vnode->v_lastr, replaced by preexisting seqcountMatthew Dillon1999-09-202-5/+8
| | | | | | | | | | | | heuristic to detect sequential operation. VM-related forced clustering code removed from ufs in preparation for a commit to vm/vm_fault.c that does it more generally. Reviewed by: David Greenman <dg@root.com>, Alan Cox <alc@cs.rice.edu> Notes: svn path=/head/; revision=51486
* Seperate the export check in VFS_FHTOVP, exports are now checked viaAlfred Perlstein1999-09-111-10/+21
| | | | | | | | | | | | VFS_CHECKEXP. Add fh(open|stat|stafs) syscalls to allow userland to query filesystems based on (network) filehandle. Obtained from: NetBSD Notes: svn path=/head/; revision=51138
* All unimplemented VFS ops now have entries in kern/vfs_default.c that returnAlfred Perlstein1999-09-071-38/+3
| | | | | | | | | | | | | | | | reasonable defaults. This avoids confusing and ugly casting to eopnotsupp or making dummy functions. Bogus casting of filesystem sysctls to eopnotsupp() have been removed. This should make *_vfsops.c more readable and reduce bloat. Reviewed by: msmith, eivind Approved by: phk Tested by: Jeroen Ruigrok/Asmodai <asmodai@wxs.nl> Notes: svn path=/head/; revision=51068
* $Id$ -> $FreeBSD$Peter Wemm1999-08-2812-12/+12
| | | | Notes: svn path=/head/; revision=50477
* Introduce vn_isdisk(struct vnode *vp) function, and use it to test for diskness.Poul-Henning Kamp1999-08-251-6/+2
| | | | Notes: svn path=/head/; revision=50347
* Initialise fsids with (user) device numbers again. Bitrot when dev_t'sBruce Evans1999-08-231-2/+2
| | | | | | | | were changed to pointers was obscured by casting dev_t's to longs. fsids haven't even been comprised of longs since the Lite2 merge. Notes: svn path=/head/; revision=50256
* The bdevsw() and cdevsw() are now identical, so kill the former.Poul-Henning Kamp1999-08-131-2/+2
| | | | Notes: svn path=/head/; revision=49679
* Decommision miscfs/specfs/specdev.h. Most of it goes into <sys/conf.h>,Poul-Henning Kamp1999-08-082-4/+2
| | | | | | | | | a few lines into <sys/vnode.h>. Add a few fields to struct specinfo, paving the way for the fun part. Notes: svn path=/head/; revision=49535