summaryrefslogtreecommitdiffstats
path: root/sys/fs
Commit message (Collapse)AuthorAgeFilesLines
* Do a pass over all modules in the kernel and make them return EOPNOTSUPPphk2004-07-153-3/+4
| | | | | | | | for unknown events. A number of modules return EINVAL in this instance, and I have left those alone for now and instead taught MOD_QUIESCE to accept this as "didn't do anything".
* Another LINT compilation fixphk2004-07-131-1/+0
|
* Make LINT compilephk2004-07-132-2/+0
|
* Remove 'td = curthread' that shadows the arguments to coda_root().rwatson2004-07-121-1/+0
| | | | Missed by: alfred
* Make VFS_ROOT() and vflush() take a thread argument.alfred2004-07-1218-49/+59
| | | | | | This is to allow filesystems to decide based on the passed thread which vnode to return. Several filesystems used curthread, they now use the passed thread.
* Update for the KDB framework:marcel2004-07-101-3/+4
| | | | o Call kdb_enter() instead of Debugger().
* Update for the KDB framework:marcel2004-07-102-3/+3
| | | | | o Call kdb_enter() instead of Debugger(). o Make debugging code conditional upon KDB instead of DDB.
* Accumulate directory entries in a fixed-length sbuf, and uiomove them indes2004-07-091-8/+10
| | | | | | | | | | | one go before returning. This avoids calling uiomove() while holding allproc_lock. Don't adjust uio->uio_offset manually, uiomove() does that for us. Don't drop allproc_lock before calling panic(). Suggested by: alfred
* When we traverse the vnodes on a mountpoint we need to look out forphk2004-07-042-14/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | our cached 'next vnode' being removed from this mountpoint. If we find that it was recycled, we restart our traversal from the start of the list. Code to do that is in all local disk filesystems (and a few other places) and looks roughly like this: MNT_ILOCK(mp); loop: for (vp = TAILQ_FIRST(&mp...); (vp = nvp) != NULL; nvp = TAILQ_NEXT(vp,...)) { if (vp->v_mount != mp) goto loop; MNT_IUNLOCK(mp); ... MNT_ILOCK(mp); } MNT_IUNLOCK(mp); The code which takes vnodes off a mountpoint looks like this: MNT_ILOCK(vp->v_mount); ... TAILQ_REMOVE(&vp->v_mount->mnt_nvnodelist, vp, v_nmntvnodes); ... MNT_IUNLOCK(vp->v_mount); ... vp->v_mount = something; (Take a moment and try to spot the locking error before you read on.) On a SMP system, one CPU could have removed nvp from our mountlist but not yet gotten to assign a new value to vp->v_mount while another CPU simultaneously get to the top of the traversal loop where it finds that (vp->v_mount != mp) is not true despite the fact that the vnode has indeed been removed from our mountpoint. Fix: Introduce the macro MNT_VNODE_FOREACH() to traverse the list of vnodes on a mountpoint while taking into account that vnodes may be removed from the list as we go. This saves approx 65 lines of duplicated code. Split the insmntque() which potentially moves a vnode from one mount point to another into delmntque() and insmntque() which does just what the names say. Fix delmntque() to set vp->v_mount to NULL while holding the mountpoint lock.
* Remove "register" keyword and trailing white space.phk2004-07-035-60/+60
|
* By popular request, add a workaround that allows large (>128GB or so)tjr2004-07-034-14/+233
| | | | | | | | | | | | | | | 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.
* Remove spls from portal_open(). Acquire socket lock while sleepingrwatson2004-06-241-7/+8
| | | | | | waiting for the socket to connect and use msleep() on the socket mute rather than tsleep(). Acquire socket buffer mutexes around read-modify-write of socket buffer flags.
* Make the udf_vnops side endian clean.scottl2004-06-231-35/+41
|
* First half of making UDF be endian-clean. This addresses the vfsops side.scottl2004-06-233-23/+28
|
* Include <sys/mutex.h> and its prerequisite <sys/lock.h> instead ofbde2004-06-231-10/+11
| | | | | | | | | depending on namespace pollution in <sys/vnode.h> for the definition of mutex interfaces used in SOCKBUF_*LOCK(). Sorted includes. Removed unused includes.
* Remove unlocked read annotation for sbspace(); the read is locked.rwatson2004-06-231-1/+0
|
* Reduce a fair bit of the atomics because we are now called with aphk2004-06-181-73/+55
| | | | | lock from kern_conf.c and cdev's act a lot more like real objects these days.
* Merge some additional leaf node socket buffer locking fromrwatson2004-06-181-6/+27
| | | | | | | | | | | | | | | | | | | | | rwatson_netperf: Introduce conditional locking of the socket buffer in fifofs kqueue filters; KNOTE() will be called holding the socket buffer locks in fifofs, but sometimes the kqueue() system call will poll using the same entry point without holding the socket buffer lock. Introduce conditional locking of the socket buffer in the socket kqueue filters; KNOTE() will be called holding the socket buffer locks in the socket code, but sometimes the kqueue() system call will poll using the same entry points without holding the socket buffer lock. Simplify the logic in sodisconnect() since we no longer need spls. NOTE: To remove conditional locking in the kqueue filters, it would make sense to use a separate kqueue API entry into the socket/fifo code when calling from the kqueue() system call.
* Merge additional socket buffer locking from rwatson_netperf:rwatson2004-06-172-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | - Lock down low hanging fruit use of sb_flags with socket buffer lock. - Lock down low hanging fruit use of so_state with socket lock. - Lock down low hanging fruit use of so_options. - Lock down low-hanging fruit use of sb_lowwat and sb_hiwat with socket buffer lock. - Annotate situations in which we unlock the socket lock and then grab the receive socket buffer lock, which are currently actually the same lock. Depending on how we want to play our cards, we may want to coallesce these lock uses to reduce overhead. - Convert a if()->panic() into a KASSERT relating to so_state in soaccept(). - Remove a number of splnet()/splx() references. More complex merging of socket and socket buffer locking to follow.
* Second half of the dev_t cleanup.phk2004-06-177-11/+11
| | | | | | | | | | | The big lines are: NODEV -> NULL NOUDEV -> NODEV udev_t -> dev_t udev2dev() -> findcdev() Various minor adjustments including handling of userland access to kernel space struct cdev etc.
* Do the dreaded s/dev_t/struct cdev */phk2004-06-1631-93/+93
| | | | Bump __FreeBSD_version accordingly.
* Nice, is a property of a process as a whole..julian2004-06-161-2/+2
| | | | | I mistakenly moved it to the ksegroup when breaking up the process structure. Put it back in the proc structure.
* Grab the socket buffer send or receive mutex when performing arwatson2004-06-151-0/+6
| | | | | | read-modify-write on the sb_state field. This commit catches only the "easy" ones where it doesn't interact with as yet unmerged locking.
* The socket field so_state is used to hold a variety of socket relatedrwatson2004-06-141-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | flags relating to several aspects of socket functionality. This change breaks out several bits relating to send and receive operation into a new per-socket buffer field, sb_state, in order to facilitate locking. This is required because, in order to provide more granular locking of sockets, different state fields have different locking properties. The following fields are moved to sb_state: SS_CANTRCVMORE (so_state) SS_CANTSENDMORE (so_state) SS_RCVATMARK (so_state) Rename respectively to: SBS_CANTRCVMORE (so_rcv.sb_state) SBS_CANTSENDMORE (so_snd.sb_state) SBS_RCVATMARK (so_rcv.sb_state) This facilitates locking by isolating fields to be located with other identically locked fields, and permits greater granularity in socket locking by avoiding storing fields with different locking semantics in the same short (avoiding locking conflicts). In the future, we may wish to coallesce sb_state and sb_flags; for the time being I leave them separate and there is no additional memory overhead due to the packing/alignment of shorts in the socket buffer structure.
* Add MSG_NBIO flag option to soreceive() and sosend() that causestruckman2004-06-011-12/+6
| | | | | | | | | | | | them to behave the same as if the SS_NBIO socket flag had been set for this call. The SS_NBIO flag for ordinary sockets is set by fcntl(fd, F_SETFL, O_NONBLOCK). Pass the MSG_NBIO flag to the soreceive() and sosend() calls in fifo_read() and fifo_write() instead of frobbing the SS_NBIO flag on the underlying socket for each I/O operation. The O_NONBLOCK flag is a property of the descriptor, and unlike ordinary sockets, fifos may be referenced by multiple descriptors.
* add missing #include <sys/module.h>phk2004-05-301-0/+1
|
* Switch from using the vnode interlock to a private mutex in fifo_open()truckman2004-05-171-24/+23
| | | | | | | | to avoid lock order problems when manipulating the sockets associated with the fifo. Minor optimization of a couple of calls to fifo_cleanup() from fifo_open().
* Make vm_page's PG_ZERO flag immutable between the time of the page'salc2004-05-063-6/+0
| | | | | | | | | | allocation and deallocation. This flag's principal use is shortly after allocation. For such cases, clearing the flag is pointless. The only unusual use of PG_ZERO is in vfs_bio_clrbuf(). However, allocbuf() never requests a prezeroed page. So, vfs_bio_clrbuf() never sees a prezeroed page. Reviewed by: tegge@
* Do not drop Giant around the poll method yet, we're not ready for it.phk2004-04-121-2/+2
|
* Remove advertising clause from University of California Regent'simp2004-04-0747-189/+1
| | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson
* Remove ps_argsopen from this check, because of two reasons:pjd2004-04-011-1/+1
| | | | | | 1. This check if wrong, because it is true by default (kern.ps_argsopen is 1 by default) (p_cansee() is not even checked). 2. Sysctl kern.ps_argsopen is going away.
* Export uipc_connect2() from uipc_usrreq.c instead of unp_connect2(),rwatson2004-03-312-2/+2
| | | | | | | | | | and consume that interface in portalfs and fifofs instead. In the new world order, unp_connect2() assumes that the unpcb mutex is held, whereas uipc_connect2() validates that the passed sockets are UNIX domain sockets, then grabs the mutex. NB: the portalfs and fifofs code gets down and dirty with UNIX domain sockets. Maybe this is a bad thing.
* Catch all cases where bread() returns an error and a valid *bp, and releasescottl2004-03-302-6/+11
| | | | | | the *bp. Obtained from: DragonFlyBSD
* Clean up the stub fake vnode locking implemenations. The main reason thispeter2004-03-291-0/+9
| | | | | | | | | | | | stuff was here (NFS) was fixed by Alfred in November. The only remaining consumer of the stub functions was umapfs, which is horribly horribly broken. It has missed out on about the last 5 years worth of maintenence that was done on nullfs (from which umapfs is derived). It needs major work to bring it up to date with the vnode locking protocol. umapfs really needs to find a caretaker to bring it into the 21st century. Functions GC'ed: vop_noislocked, vop_nolock, vop_nounlock, vop_sharedlock.
* Don't reject FAT file systems with a number of "Heads" greater thanrwatson2004-03-141-1/+1
| | | | | | 255; USB keychains exist that use 256 as the number of heads. This check has also been removed in Darwin (along with most of the other head/sector sanity checks).
* When taking event callbacks (like process_exit) out from under Giant, thosegreen2004-03-141-0/+2
| | | | which do not lock Giant themselves will be exposed. Unbreak pfs_exit().
* When I was a kid my work table was one cluttered mess an cleaning it upphk2004-03-111-20/+0
| | | | | | | | | | | | | were a rather overwhelming task. I soon learned that if you don't know where you're going to store something, at least try to pile it next to something slightly related in the hope that a pattern emerges. Apply the same principle to the ffs/snapshot/softupdates code which have leaked into specfs: Add yet a buf-quasi-method and call it from the only two places I can see it can make a difference and implement the magic in ffs_softdep.c where it belongs. It's not pretty, but at least it's one less layer violated.
* Remove unused second arg to vfinddev().phk2004-03-111-1/+3
| | | | Don't call addaliasu() on VBLK nodes.
* Don't call devsw() more than we need to, and in particular do not exposephk2004-03-101-4/+4
| | | | | | ourselves to device removal by not checking for it the second time. Use count_dev(dev) rather than vcount(vp)
* Change __FUNCTION__ to __func__scottl2004-03-031-2/+2
| | | | Submitted by: Stefan Farfeleder
* Rename dup_sockaddr() to sodupsockaddr() for consistency with otherrwatson2004-03-011-1/+2
| | | | | | | | | | | | functions in kern_socket.c. Rename the "canwait" field to "mflags" and pass M_WAITOK and M_NOWAIT in from the caller context rather than "1" or "0". Correct mflags pass into mac_init_socket() from previous commit to not include M_ZERO. Submitted by: sam
* Do not attempt to open NODEVphk2004-02-241-0/+3
|
* Fix comment containing vop_readdir_args contents: a_cookies is reallytjr2004-02-231-1/+1
| | | | u_long ** not u_long *.
* cookies is an array of u_long, not u_int, so MALLOC() it accordingly.tjr2004-02-231-2/+2
| | | | | Allocating it with the wrong size could have caused corruption on 64-bit architectures.
* 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.
* Device megapatch 6/6:phk2004-02-211-9/+30
| | | | | | | | | | | | | | | | | | | | | | | | | This is what we came here for: Hang dev_t's from their cdevsw, refcount cdevsw and dev_t and generally keep track of things a lot better than we used to: Hold a cdevsw reference around all entrances into the device driver, this will be necessary to safely determine when we can unload driver code. Hold a dev_t reference while the device is open. KASSERT that we do not enter the driver on a non-referenced dev_t. Remove old D_NAG code, anonymous dev_t's are not a problem now. When destroy_dev() is called on a referenced dev_t, move it to dead_cdevsw's list. When the refcount drops, free it. Check that cdevsw->d_version is correct. If not, set all methods to the dead_*() methods to prevent entrance into driver. Print warning on console to this effect. The device driver may still explode if it is also incompatible with newbus, but in that case we probably didn't get this far in the first place.
* Device megapatch 5/6:phk2004-02-211-2/+1
| | | | | | | | | | | | Remove the unused second argument from udev2dev(). Convert all remaining users of makedev() to use udev2dev(). The semantic difference is that udev2dev() will only locate a pre-existing dev_t, it will not line makedev() create a new one. Apart from the tiny well controlled windown in D_PSEUDO drivers, there should no longer be any "anonymous" dev_t's in the system now, only dev_t's created with make_dev() and make_dev_alias()
* Device megapatch 4/6:phk2004-02-212-8/+10
| | | | | | | | Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION. Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
* Report the correct length for symlink entries.phk2004-02-191-1/+1
|
* 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.
OpenPOWER on IntegriCloud