summaryrefslogtreecommitdiffstats
path: root/sys/fs
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* 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
* White-space align a struct definition.phk2004-02-153-37/+27
| | | | Move a SYSINIT to the file where it belongs.
* 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.
* Fix a panic in pseudofs(9) that could occur when doing an I/Onectar2004-02-101-0/+5
| | | | | | | operation with a large request or large offset. Reported by: Joel Ray Holveck <joelh@piquan.org> Submitted by: des
* Fixes problems that occurred when a file was removed and a directorytjr2004-02-103-1/+42
| | | | | | | | | | | | | | | | created with the same name, and vice versa: - Immediately recycle vnodes of files & directories that have been deleted or renamed. - When looking an entry in the VFS name cache or smbfs's private cache, make sure the vnode type is consistent with the type of file the server thinks it is, and re-create the vnode if it isn't. The alternative to this is to recycle vnodes unconditionally when their use count drops to 0, but this would make all the caching we do mostly useless. PR: 62342 MFC after: 2 weeks
* Locking for the per-process resource limits structure.jhb2004-02-045-19/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* Fix style(9) of my previous commit.cperciva2004-01-211-1/+1
| | | | | Noticed by: nate Approved by: nate, rwatson (mentor)
* Allow devfs path rules to work on directories. Without this fix,cperciva2004-01-211-1/+2
| | | | | | | | devfs rule add path fd unhide is a no-op, while it should unhide the fd subdirectory. Approved by: phk, rwatson (mentor) PR: kern/60897
* Spell magic '16' number as IO_SEQSHIFT.kan2004-01-191-1/+1
|
* Do not allow operations which cause known file-system corruption.green2004-01-161-2/+8
|
* Remove a warning.green2004-01-161-2/+0
|
* Fix an upper-vnode leak created in revision 1.52. When an upper-layergreen2004-01-162-19/+13
| | | | | | | | | | | | file has been removed, it should be purged from the cache, but it need not be removed from the directory stack causing corruption; instead, it will simply be removed once the last references and holds on it are dropped at the end of the unlink/rmdir system calls, and the normal !UN_CACHED VOP_INACTIVE() handler for unionfs finishes it off. This is easily reproduced by repeated "echo >file; rm file" on a unionfs mount. Strangely, "echo -n >file; rm file" didn't make it happen.
* Fix an inverted test for NOPEN in the unused function smb_smb_flush().tjr2004-01-121-1/+1
|
* Don't try to unlock the directory vnode in null_lookup() if the lock istruckman2004-01-111-1/+1
| | | | | shared with the underlying file system and the lookup in the underlying file system did the unlock for us.
* Restore closing of SMB find handle in smbfs_close().tjr2004-01-101-1/+8
|
* Lock p->p_textvp before calling vn_fullpath() on it. Note therwatson2004-01-071-0/+2
| | | | | | | | potential lock order concern due to the vnode lock held simultaneously by the caller into procfs. Reported by: kuriyama Approved by: des
* In smbfs_inactive(), only invalidate the node's attribute cache if wetjr2004-01-041-1/+1
| | | | had to send a file close request to the server.
* Pass ACL, extended attribute and MAC vnode ops down the vnode stack.tjr2004-01-031-0/+239
|
* Improve on POLA by populating DEVFS before doing devfs(8) rule ioctls.phk2004-01-021-0/+5
| | | | | PR: 60687 Spotted by: Colin Percival <cperciva@daemonology.net>
* 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.
OpenPOWER on IntegriCloud