summaryrefslogtreecommitdiffstats
path: root/sys/isofs (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Refactor klist insertion and removalvisa2020-12-251-3/+3
| | | | | | | | | | | | Rename klist_{insert,remove}() to klist_{insert,remove}_locked(). These functions assume that the caller has locked the klist. The current state of locking remains intact because the kernel lock is still used with all klists. Add new functions klist_insert() and klist_remove() that lock the klist internally. This allows some code simplification. OK mpi@
* Revert previous. hashfree() just calls free() which handles NULL withkrw2020-06-231-7/+6
| | | | | | aplomb. 16 lines of 'C' can be so hard to grok at a glance. Prompted to look more closely at those 16 lines by mpi@.
* hashfree() doesn't like NULL, so check for NULL if NULL is akrw2020-06-231-6/+7
| | | | | | | | possibility. i.e. when bailing out before calling hashinit().. COVERITY 1452907 ok mpi@
* Rename poll-compatibility flag to better reflect what it is.mpi2020-06-111-2/+2
| | | | | | While here prefix kernel-only EV flags with two underbars. Suggested by kettenis@, ok visa@
* Use a new EV_OLDAPI flag to match the behavior of poll(2) and select(2).mpi2020-06-081-1/+4
| | | | | | | | | Adapt FS kqfilters to always return true when the flag is set and bypass the polling mechanism of the NFS thread. While here implement a write filter for NFS. ok visa@
* Abstract the head of knote lists. This allows extending the lists,visa2020-04-071-3/+3
| | | | | | for example, with locking assertions. OK mpi@, anton@
* Remove unused "struct proc *" argument from the following functions:mpi2020-02-271-3/+2
| | | | | | | | | | | | | - ufs_chown() & ufs_chmod() - ufs_reclaim() - ext2fs_chown() & ext2fs_chmod() - ntfs_ntget() & ntfs_ntput() - ntfs_vgetex(), ntfs_ntlookup() & ntfs_ntlookupfile() While here use `ap->a_p' directly when it is only required to re-enter the VFS layer in order to help reducing the loop. ok visa@
* Replace field f_isfd with field f_flags in struct filterops to allowvisa2020-02-201-4/+4
| | | | | | adding more filter properties without cluttering the struct. OK mpi@, anton@
* struct vops is not modified during runtime so use const which moves eachclaudio2020-01-204-12/+12
| | | | | into read-only data segment. OK deraadt@ tedu@
* Use C99 designated initializers with struct filterops. In addition,visa2019-12-311-7/+21
| | | | | | make the structs const so that the data are put in .rodata. OK mpi@, deraadt@, anton@, bluhm@
* Convert struct vfsops initializer to C99 style.bluhm2019-12-262-28/+28
| | | | OK visa@
* Allow concurrent reads of the f_offset field of struct file byanton2019-08-051-2/+2
| | | | | | | | | serializing both read/write operations using the existing file mutex. The vnode lock still grants exclusive write access to the offset; the mutex is only used to make the actual write atomic and prevent any concurrent reader from observing intermediate values. ok mpi@ visa@
* vinvalbuf(9): tlseep -> tsleep_nsec(9); ok millert@cheloha2019-07-252-5/+5
|
* Revert anton@ changes about read/write unlockingsolene2019-07-121-2/+2
| | | | | | https://marc.info/?l=openbsd-cvs&m=156277704122293&w=2 ok anton@
* Make read/write of the f_offset field belonging to struct file MP-safe;anton2019-07-101-2/+2
| | | | | | | | | | | | | | | | as part of the effort to unlock the kernel. Instead of relying on the vnode lock, introduce a dedicated lock per file. Exclusive write access is granted using the new foffset_enter and foffset_leave API. A convenience function foffset_get is also available for threads that only need to read the current offset. The lock acquisition order in vn_write has been changed to match the one in vn_read in order to avoid a potential deadlock. This change also gets rid of a documented race in vn_read(). Inspired by the FreeBSD implementation. With help and ok mpi@ visa@
* remove unused i_lockf member from struct iso_node; ok tedu@ visa@anton2019-01-201-2/+1
|
* Move the allocating and freeing of mount points intovisa2018-09-261-3/+2
| | | | | | dedicated functions. OK deraadt@ mpi@
* Drop unnecessary `p' parameter from vget(9).visa2018-05-272-6/+4
| | | | OK mpi@
* Remove proc from the parameters of vn_lock(). The parameter isvisa2018-05-024-15/+13
| | | | | | unnecessary because curproc always does the locking. OK mpi@
* Clean up the parameters of VOP_LOCK() and VOP_UNLOCK(). It is alwaysvisa2018-04-285-16/+15
| | | | | | | curproc that does the locking or unlocking, so the proc parameter is pointless and can be dropped. OK mpi@, deraadt@
* Use RWL_IS_VNODE with locks that are acquired through VOP_LOCK(),visa2018-03-282-4/+4
| | | | | | | | to appease WITNESS. ext2fs and ffs already use the flag. The same locking pattern appears with other file systems too, so this patch addresses the remaining cases. OK mpi@
* Syncronize filesystems to disk when suspending. Each mountpoint's vnodesderaadt2018-02-104-8/+9
| | | | | | | | | | are pushed to disk. Dangling vnodes (unlinked files still in use) and vnodes undergoing change by long-running syscalls are identified -- and such filesystems are marked dirty on-disk while we are suspended (in case power is lost, a fsck will be required). Filesystems without dangling or busy vnodes are marked clean, resulting in faster boots following "battery died" circumstances. Tested by numerous developers, thanks for the feedback.
* Don't pull in <sys/file.h> just to get fcntl.hguenther2017-12-301-2/+2
| | | | ok deraadt@ krw@
* Delete unnecessary <sys/file.h> includesguenther2017-12-304-8/+4
| | | | ok millert@ krw@
* In uvm Chuck decided backing store would not be allocated proactivelyderaadt2017-12-112-21/+19
| | | | | | | | | | | | | | | | | | | | | | for blocks re-fetchable from the filesystem. However at reboot time, filesystems are unmounted, and since processes lack backing store they are killed. Since the scheduler is still running, in some cases init is killed... which drops us to ddb [noted by bluhm]. Solution is to convert filesystems to read-only [proposed by kettenis]. The tale follows: sys_reboot() should pass proc * to MD boot() to vfs_shutdown() which completes current IO with vfs_busy VB_WRITE|VB_WAIT, then calls VFS_MOUNT() with MNT_UPDATE | MNT_RDONLY, soon teaching us that *fs_mount() calls a copyin() late... so store the sizes in vfsconflist[] and move the copyin() to sys_mount()... and notice nfs_mount copyin() is size-variant, so kill legacy struct nfs_args3. Next we learn ffs_mount()'s MNT_UPDATE code is sharp and rusty especially wrt softdep, so fix some bugs adn add ~MNT_SOFTDEP to the downgrade. Some vnodes need a little more help, so tie them to &dead_vnops. ffs_mount calling DIOCCACHESYNC is causing a bit of grief still but this issue is seperate and will be dealt with in time. couple hundred reboots by bluhm and myself, advice from guenther and others at the hut
* If you use sys/param.h, you don't need sys/types.hderaadt2017-09-082-4/+2
|
* Tweak lock inits to make the system runnable with witness(4)visa2017-04-202-4/+4
| | | | on amd64 and i386.
* Move a pointer deref to after a NULL test.jsg2017-02-081-3/+2
| | | | ok krw@
* use hashfree in fs code. from Mathieu -tedu2016-09-241-6/+3
| | | | ok guenther
* all pools have their ipl set via pool_setipl, so fold it into pool_init.dlg2016-09-151-7/+4
| | | | | | | | | | | | | | | | | | | | | | the ioff argument to pool_init() is unused and has been for many years, so this replaces it with an ipl argument. because the ipl will be set on init we no longer need pool_setipl. most of these changes have been done with coccinelle using the spatch below. cocci sucks at formatting code though, so i fixed that by hand. the manpage and subr_pool.c bits i did myself. ok tedu@ jmatthew@ @ipl@ expression pp; expression ipl; expression s, a, o, f, m, p; @@ -pool_init(pp, s, a, o, f, m, p); -pool_setipl(pp, ipl); +pool_init(pp, s, a, ipl, f, m, p);
* Remove usermount remnants. ok tedunatano2016-09-072-26/+2
|
* Variable 'imp' is set earlier in cd9660_mount() if it's needed (whentom2016-09-021-2/+1
| | | | | | MNT_UPDATE is set in mnt_flag), so remove an unnecessary assignment later. ok bluhm
* pool_setipl for udfdlg2016-08-251-1/+4
| | | | ok phessler@ krw@
* Eliminate pointless casts to qaddr_t of a value being assigned to a void*guenther2016-08-132-4/+4
| | | | ok kettenis@ krw@ natano@ dlg@ espie@
* Remove the lockmgr() API. It is only used by filesystems, where it is anatano2016-06-197-20/+20
| | | | | | | | trivial change to use rrw locks instead. All it needs is LK_* defines for the RW_* flags. tested by naddy and sthen on package building infrastructure input and ok jmc mpi tedu
* When pulling an msdos formated umass stick during mount while thebluhm2016-05-222-2/+6
| | | | | | | | | | usb stack was busy, the kernel could trigger an uvm fault. There is a race between vop_generic_revoke() and sys_mount() where vgonel() could reset v_specinfo. Then v_specmountpoint is no longer valid. So after sleeping, msdosfs_mountfs() could crash in the error path. The code in the different *_mountfs() functions was inconsistent, implement the same check everywhere. OK krw@ natano@
* Populate all necessary statfs members in .vfs_statfs. cd9660, udf,natano2016-04-262-9/+9
| | | | | | | | | | msdosfs and nfsv2 don't set f_namemax. ntfs and ext2fs don't set f_namemeax and f_favail. fusefs doesn't set f_mntfromspec, f_favail and f_iosize. Also, make all filesystems use copy_statfs_info(), so that all statfs information is filled in correctly for the (sb != &mp->mnt-stat) case. ok stefan
* When pulling and unmounting an umass USB stick, the file systembluhm2016-03-272-7/+5
| | | | | | | | | | | | could end up in an inconsistent state. The fstype dependent mp->mnt_data was NULL, but the general mp was still listed as a valid mount point. Next access to the file system would crash with a NULL pointer dereference. If closing the device fails, the mount point must go away anyway. There is nothing we can do about it. Remove the workaround for the EIO error in the general unmount code, but do not generate any error in the file system specific unmount functions. OK natano@ beck@
* Remove the unused flags argument from VOP_UNLOCK().natano2016-03-196-20/+20
| | | | | | torture tested on amd64, i386 and macppc ok beck mpi stefan "the change looks right" deraadt
* Set mnt_data to NULL after freeing the file system specific mount point.bluhm2016-03-172-5/+5
| | | | OK krw@ natano@ as part of a larger diff
* Change a bunch of (<blah> *)0 to NULL.krw2016-03-141-2/+2
| | | | ok beck@ deraadt@
* Sync no-argument function declaration and definition by adding (void).naddy2016-03-071-2/+2
| | | | ok mpi@ millert@
* Move mnt_maxsymlink from struct mount to struct ufsmount.natano2016-02-271-2/+1
| | | | | | | | | | | | | | The concept of differentiating between "short" and "long" symlinks is specific to ufs/, so it shouldn't creep into the generic fs layer. Inspired by a similar commit to NetBSD. While there replace all references to mnt_maxsymlinklen in ufs/ext2fs with EXT2_MAXSYMLINKLEN, which is the constant max short symlink len for ext2fs. This allows to get rid of some (mnt_maxsymlinklen == 0) checks there, which is always false for ext2fs. input and ok stefan@ ok millert@
* Convert to uiomove(). From Martin Natano.stefan2016-02-021-7/+6
|
* Convert min() and uiomovei() to ulmin() and uiomove().stefan2016-01-191-8/+8
| | | | | | Diff from Martin Natano ok kettenis@
* implement kqfilter. copied from tmpfs (which I copied from ufs).tedu2015-12-111-1/+105
| | | | hint about kqueue from jsg after a crashing httpd report from sevan
* remove lockmgr_printinfo stubs. from Martin Natanotedu2015-09-231-2/+1
|
* Nuke some extraneous whitespace.krw2015-09-091-43/+43
|
* Use PR_WAITOK to indicate that pools are not used in interrupt contextkettenis2015-08-311-7/+7
| | | | | | instead of using pool_allocator_nointr. ok tedu@
* Tweaks utimensat/futimens handling to always update ctime, even when bothguenther2015-04-171-3/+4
| | | | | | | atime and mtime are UTIME_OMIT (at least for ufs, tmpfs, and ext2fs), and to correctly handle a timestamp of -1. ok millert@