summaryrefslogtreecommitdiffstats
path: root/sys/msdosfs
Commit message (Collapse)AuthorAgeFilesLines
* Use macro API to <sys/queue.h>phk2000-12-311-2/+2
|
* Convert more malloc+bzero to malloc+M_ZERO.dwmalone2000-12-081-4/+2
| | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
* Weaken a bogus dependency on <sys/proc.h> in <sys/buf.h> by #ifdef'ingphk2000-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>
* Update stale comment.bp2000-10-221-3/+1
| | | | PR: kern/21805
* Remove de_lock field from denode structure and make msdosfs PDIRUNLOCK aware.bp2000-10-224-13/+27
|
* Blow away the v_specmountpoint define, replacing it with what it waseivind2000-10-091-2/+2
| | | | defined as (rdev->si_mountpoint)
* Convert lockmgr locks from using simple locks to using mutexes.jasone2000-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.
* o Restructure vaccess() so as to check for DAC permission to modify therwatson2000-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
* Quick fix for msdsofs_write() on alphas and other machines with eitherbde2000-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
* Centralize the canonical vop_access user/group/other check in vaccess().phk2000-08-201-41/+3
| | | | Discussed with: bde
* Certain error contitions cause msdosfs_rename() to decrement thedwmalone2000-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
* Fix memory leakage on module unload.bp2000-06-293-1/+12
| | | | Spotted by: fixed INVARIANTS code
* Remove obsolete comment.bp2000-06-251-5/+0
| | | | Submitted by: Marius Bendiksen <mbendiks@eunet.no>
* Separate the struct bio related stuff out of <sys/buf.h> intophk2000-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
* Remove unneeded #include <vm/vm_zone.h>phk2000-04-302-2/+0
| | | | Generated by: src/tools/tools/kerninclude
* Complete the bio/buf divorce for all code below devfs::strategyphk2000-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
* Move B_ERROR flag to b_ioflags and call it BIO_ERROR.phk2000-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.
* Commit the buffer cache cleanup patch to 4.x and 5.x. This patch fixes adillon2000-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
* Supported non-512 bytes/sector format.nyan2000-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>
* Give vn_isdisk() a second argument where it can return a suitable errno.phk2000-01-101-2/+2
| | | | Suggested by: bde
* Treat negative uio_offset value as eof (idea by: bde).bp2000-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
* Fix the mess with signed/unsigned longs and ints (inspired by bde).bp2000-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.
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"peter1999-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.
* Avoid to write garbage if uiomove fails.bp1999-12-281-0/+4
|
* Fix an overflow in the msdosfs_read() function which exposed on the filesbp1999-12-281-3/+3
| | | | | | | | with size > 2GB. PR: 15639 Submitted by: Tim Kientzle <kientzle@acm.org> Reviewed by: phk
* It is possible that number of sectors specified in the BPBbp1999-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
* Second pass commit to introduce new ACL and Extended Attribute systemrwatson1999-12-191-1/+3
| | | | | | | calls, vnops, vfsops, both in /kern, and to individual file systems that require a vfsop_ array entry. Reviewed by: eivind
* Introduce NDFREE (and remove VOP_ABORTOP)eivind1999-12-152-26/+2
|
* struct mountlist and struct mount.mnt_list have no business beingphk1999-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
* Next step in the device cleanup process.phk1999-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.
* More removals of vnode->v_lastr, replaced by preexisting seqcountdillon1999-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>
* Seperate the export check in VFS_FHTOVP, exports are now checked viaalfred1999-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
* All unimplemented VFS ops now have entries in kern/vfs_default.c that returnalfred1999-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>
* $Id$ -> $FreeBSD$peter1999-08-2812-12/+12
|
* Introduce vn_isdisk(struct vnode *vp) function, and use it to test for diskness.phk1999-08-251-6/+2
|
* Initialise fsids with (user) device numbers again. Bitrot when dev_t'sbde1999-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.
* The bdevsw() and cdevsw() are now identical, so kill the former.phk1999-08-131-2/+2
|
* Decommision miscfs/specfs/specdev.h. Most of it goes into <sys/conf.h>,phk1999-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.
* Don't set DE_ACCESS for unsuccessful reads.bde1999-07-251-8/+12
| | | | | | | | | | Translated from: a similar fix in ufs_readwrite.c rev.1.61. Don't forget to set DE_ACCESS for short reads. Check for invalid (negative) offsets before checking for reads of 0 bytes, as in ufs, although checking for invalid offsets at all is probably a bug.
* move <sys/systm.h> before <sys/buf.h>peter1999-07-011-2/+2
|
* Convert buffer locking from using the B_BUSY and B_WANTED flags to usingmckusick1999-06-261-3/+2
| | | | | | | lockmgr locks. This commit should be functionally equivalent to the old semantics. That is, all buffer locking is done with LK_EXCLUSIVE requests. Changes to take advantage of LK_SHARED and LK_RECURSIVE will be done in future commits.
* Simplify cdevsw registration.phk1999-05-311-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | The cdevsw_add() function now finds the major number(s) in the struct cdevsw passed to it. cdevsw_add_generic() is no longer needed, cdevsw_add() does the same thing. cdevsw_add() will print an message if the d_maj field looks bogus. Remove nblkdev and nchrdev variables. Most places they were used bogusly. Instead check a dev_t for validity by seeing if devsw() or bdevsw() returns NULL. Move bdevsw() and devsw() functions to kern/kern_conf.c Bump __FreeBSD_version to 400006 This commit removes: 72 bogus makedev() calls 26 bogus SYSINIT functions if_xe.c bogusly accessed cdevsw[], author/maintainer please fix. I4b and vinum not changed. Patches emailed to authors. LINT probably broken until they catch up.
* Divorce "dev_t" from the "major|minor" bitmap, which is now calledphk1999-05-112-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | udev_t in the kernel but still called dev_t in userland. Provide functions to manipulate both types: major() umajor() minor() uminor() makedev() umakedev() dev2udev() udev2dev() For now they're functions, they will become in-line functions after one of the next two steps in this process. Return major/minor/makedev to macro-hood for userland. Register a name in cdevsw[] for the "filedescriptor" driver. In the kernel the udev_t appears in places where we have the major/minor number combination, (ie: a potential device: we may not have the driver nor the device), like in inodes, vattr, cdevsw registration and so on, whereas the dev_t appears where we carry around a reference to a actual device. In the future the cdevsw and the aliased-from vnode will be hung directly from the dev_t, along with up to two softc pointers for the device driver and a few houskeeping bits. This will essentially replace the current "alias" check code (same buck, bigger bang). A little stunt has been provided to try to catch places where the wrong type is being used (dev_t vs udev_t), if you see something not working, #undef DEVT_FASCIST in kern/kern_conf.c and see if it makes a difference. If it does, please try to track it down (many hands make light work) or at least try to reproduce it as simply as possible, and describe how to do that. Without DEVT_FASCIST I belive this patch is a no-op. Stylistic/posixoid comments about the userland view of the <sys/*.h> files welcome now, from userland they now contain the end result. Next planned step: make all dev_t's refer to the same devsw[] which means convert BLK's to CHR's at the perimeter of the vnodes and other places where they enter the game (bootdev, mknod, sysctl).
* I got tired of seeing all the cdevsw[major(foo)] all over the place.phk1999-05-081-2/+2
| | | | | | | | Made a new (inline) function devsw(dev_t dev) and substituted it. Changed to the BDEV variant to this format as well: bdevsw(dev_t dev) DEVFS will eventually benefit from this change too.
* Continue where Julian left off in July 1998:phk1999-05-071-2/+2
| | | | | | | | | | | | | | Virtualize bdevsw[] from cdevsw. bdevsw() is now an (inline) function. Join CDEV_MODULE and BDEV_MODULE to DEV_MODULE (please pay attention to the order of the cmaj/bmaj arguments!) Join CDEV_DRIVER_MODULE and BDEV_DRIVER_MODULE to DEV_DRIVER_MODULE (ditto!) (Next step will be to convert all bdev dev_t's to cdev dev_t's before they get to do any damage^H^H^H^H^H^Hwork in the kernel.)
* Add sufficient braces to keep egcs happy about potentially ambiguouspeter1999-05-062-5/+6
| | | | if/else nesting.
* This Implements the mumbled about "Jail" feature.phk1999-04-281-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a seriously beefed up chroot kind of thing. The process is jailed along the same lines as a chroot does it, but with additional tough restrictions imposed on what the superuser can do. For all I know, it is safe to hand over the root bit inside a prison to the customer living in that prison, this is what it was developed for in fact: "real virtual servers". Each prison has an ip number associated with it, which all IP communications will be coerced to use and each prison has its own hostname. Needless to say, you need more RAM this way, but the advantage is that each customer can run their own particular version of apache and not stomp on the toes of their neighbors. It generally does what one would expect, but setting up a jail still takes a little knowledge. A few notes: I have no scripts for setting up a jail, don't ask me for them. The IP number should be an alias on one of the interfaces. mount a /proc in each jail, it will make ps more useable. /proc/<pid>/status tells the hostname of the prison for jailed processes. Quotas are only sensible if you have a mountpoint per prison. There are no privisions for stopping resource-hogging. Some "#ifdef INET" and similar may be missing (send patches!) If somebody wants to take it from here and develop it into more of a "virtual machine" they should be most welcome! Tools, comments, patches & documentation most welcome. Have fun... Sponsored by: http://www.rndassociates.com/ Run for almost a year by: http://www.servetheweb.com/
* Suser() simplification:phk1999-04-271-5/+5
| | | | | | | | | | | | | | | | | | | 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
* Back out half of 1.32: don't print a message on every failed mount attempt.dt1999-03-281-3/+1
| | | | | It is too chatty and hardly useful. 2 mesages in somewhat usual cases are left for now.
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-272-4/+9
| | | | kernel compile
OpenPOWER on IntegriCloud