summaryrefslogtreecommitdiff
path: root/sys/ufs
AgeCommit message (Collapse)Author
2022-02-14Introduce a signal context that is used to pass signal related informationClaudio Jeker
from cursig() to postsig() or the caller itself. This will simplify locking. Also alter sigactsfree() a bit and move it into process_zap() so ps_sigacts is always a valid pointer. OK semarie@
2022-01-11spellingJonathan Gray
ok jmc@
2021-12-12Use vnode parameter instead of vfinddev() in mfs_strategy()Visa Hankala
Getting the mfs device vnode through vfinddev() is more complex than necessary. Also, the indirection is not robust. OK mpi@
2021-12-12Add vnode parameter to VOP_STRATEGY()Visa Hankala
Pass the device vnode as a parameter to VOP_STRATEGY() to allow calling the correct vop_strategy callback. Now the vnode is also available in the callback. OK mpi@
2021-12-11Clarify usage of __EV_POLL and __EV_SELECTVisa Hankala
Make __EV_POLL specific to kqueue-based poll(2), to remove overlap with __EV_SELECT that only select(2) uses. OK millert@ mpi@
2021-10-20revert vnode: remove VLOCKSWORK and check locking when vop_islocked != nullopSebastien Marie
(both kernel and userland bits) GENERIC + VFSLCKDEBUG is broken with it.
2021-10-19vnode: remove VLOCKSWORK and check locking when vop_islocked != nullopSebastien Marie
This flag is currently used to mark or unmark a vnode to actively check vnode locking semantic (when compiled with VFSLCKDEBUG). Currently, VLOCKSWORK flag isn't properly set for several FS implementation which have full locking support. This commit enable proper checking for them too (cd9660, udf, fuse, msdosfs, tmpfs). Instead of using a particular flag, it directly check if v_op->vop_islocked is nullop or not to activate or not the vnode locking checks. ok mpi@
2021-10-19vnode: do not manipulate vnode lock directlySebastien Marie
use VOP_LOCK / VOP_UNLOCK wrappers. VOP_LOCK() is prefered over vn_lock() here in order to keep equivalent code. ok mpi@ visa@ (as part of larger diff)
2021-10-15vnode: remove vop_generic_{,is,un}lock stub functionsSebastien Marie
These functions are only stubs (returning 0). Replace them with nullop function (same behaviour). There is no intented behaviour changes. While here, reorder some vop_islocked member in structs to be next others vop_{,un}lock members. ok visa@
2021-10-08curproc can't be NULL here. So simplify code accordingly.Claudio Jeker
OK mpi@
2021-10-05For now the signal returned in cursig() is only set in p_siglist.Claudio Jeker
Simplify the code and remove the now unused CLRSIG() macro. OK mpi@
2021-10-04Use the fact the vnodes are locked when operations are inflight.Claudio Jeker
Remove the v_inflight member and alter the ffs and ext2fs sync code to track inflight by checking if the node is locked or not (which it already did before but for a different reason). OK mpi@
2021-10-02vfs: merge *_badop to vop_generic_badopSebastien Marie
It replaces spec_badop, fifo_badop, dead_badop and mfs_badop, which are only calls to panic(9), to one unique function vop_generic_badop(). No intented behaviour changes (outside the panic message which isn't the same). ok mpi@
2021-05-16panic does not require a \n at the end. When one is provided, it looks wrong.Theo de Raadt
2021-05-01Update the remaining SYSCTL_INT_READONLY casesgnezdo
OK mvs@
2021-04-28Introduce a global vnode_mtx and use it to make vn_lock() safe to be calledClaudio Jeker
without the KERNEL_LOCK. This moves VXLOCK and VXWANT to a mutex protected v_lflag field and also v_lockcount is protected by this mutex. The vn_lock() dance is overly complex and all of this should probably replaced by a proper lock on the vnode but such a diff is a lot more complex. This is an intermediate step so that at least some calls can be modified to grab the KERNEL_LOCK later or not at all. OK mpi@
2021-03-24cd9660, mfs: do not hide generic vop functions behind #defineSebastien Marie
It makes clearer which vop functions are real fileystem-implementations and which one are only stubs. No functional changes are intented. ok visa@
2021-03-24make some `struct vops' members explicitly NULL instead of implicitly NULLSebastien Marie
ok mpi@
2021-03-11spellingJonathan Gray
2021-03-05ansiJonathan Gray
2021-03-04Merge issignal() and CURSIG() in preparation for turning it mp-safe.Martin Pieuchot
This makes appear some redundant & racy checks. ok semarie@
2020-12-25Refactor klist insertion and removalVisa Hankala
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@
2020-11-07Convert ffs_sysctl to sysctl_bounded_argsgnezdo
Requires sysctl_bounded_arr branch to support sysctl_rdint. The read-only variables are marked by an empty range of [1, 0]. OK millert@
2020-10-09Do not dereference `vp' after vput(9)ing it.Martin Pieuchot
From dholland@NetBSD ok anton@
2020-08-10remove #if 0'd ufs2 magic error which predates ffs2 supportJonathan Gray
ok kn@
2020-08-10use EROFS when attempting to mount a 4.2BSD fs without MNT_RDONLYJonathan Gray
This is the documented behaviour which was changed by pedro in rev 1.81 which was partially backed out in rev 1.82.
2020-06-24kernel: use gettime(9)/getuptime(9) in lieu of time_second(9)/time_uptime(9)cheloha
time_second(9) and time_uptime(9) are widely used in the kernel to quickly get the system UTC or system uptime as a time_t. However, time_t is 64-bit everywhere, so it is not generally safe to use them on 32-bit platforms: you have a split-read problem if your hardware cannot perform atomic 64-bit reads. This patch replaces time_second(9) with gettime(9), a safer successor interface, throughout the kernel. Similarly, time_uptime(9) is replaced with getuptime(9). There is a performance cost on 32-bit platforms in exchange for eliminating the split-read problem: instead of two register reads you now have a lockless read loop to pull the values from the timehands. This is really not *too* bad in the grand scheme of things, but compared to what we were doing before it is several times slower. There is no performance cost on 64-bit (__LP64__) platforms. With input from visa@, dlg@, and tedu@. Several bugs squashed by visa@. ok kettenis@
2020-06-20With filesystem having many cylinder groups and many inodes per cg theOtto Moerbeek
ncg * ipg calcualtion can overflow if signed types are used. Move to uint32_t for the relevant values. Aligned with FreeBSD changes. Also make sure newfs refuses to create an fs with more that 2^32-1 inodes. ok millert@
2020-06-11Rename poll-compatibility flag to better reflect what it is.Martin Pieuchot
While here prefix kernel-only EV flags with two underbars. Suggested by kettenis@, ok visa@
2020-06-08Use a new EV_OLDAPI flag to match the behavior of poll(2) and select(2).Martin Pieuchot
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@
2020-05-29When the preferred cylinder group if full scan forward (wrapping if needed)Otto Moerbeek
to find another, instead of first forward and then backward. The latter method causes most full cgs to end up at the end of the partition. From FreeBSD. ok millert@
2020-05-28Make generation numbers unsigned and fill them using a random numberOtto Moerbeek
from the range [1..UINT_MAX] initially. On inode re-use increment and on wrap refill from the range [1..UINT_MAX-1] to avoid assigning UINT_MAX (the original value). Zero still means uninitialized. ok millert@
2020-05-21Explicitly documents that `vop_kqfilter' isn't missing.Martin Pieuchot
Just like most of the vop_* methods in MFS they aren't used. ok millert@, visa@
2020-04-07Abstract the head of knote lists. This allows extending the lists,Visa Hankala
for example, with locking assertions. OK mpi@, anton@
2020-03-09Avoid a tight CPU loop when no unlocked worklist items can be processed.Todd C. Miller
If process_worklist_item() is unable to process locked vnodes, num_on_worklist will still be non-zero, preventing the loop in softdep_process_worklist() from exiting. This can result in a kernel hang. To fix this, process_worklist_item() now returns non-zero if it was able to process a worklist item (regardless of whether it matched the mountpoint) and takes a pointer to matchcnt as a function argument. We now break out of the loop in softdep_process_worklist() if process_worklist_item() is unable to make progress. OK beck@ bluhm@
2020-02-27Remove unused "struct proc *" argument from the following functions:Martin Pieuchot
- 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@
2020-02-21Use proper function to get a timestamp, as time_second isn't safe;Otto Moerbeek
ok cheloha@
2020-02-21Handle the mount(... MNT_RELOAD) case for ffs2 as well. ok kettenis@Otto Moerbeek
2020-02-20Replace field f_isfd with field f_flags in struct filterops to allowVisa Hankala
adding more filter properties without cluttering the struct. OK mpi@, anton@
2020-02-18Cleanup <sys/kthread.h> and <sys/proc.h> includes.Martin Pieuchot
Do not include <sys/kthread.h> where it is not needed and stop including <sys/proc.h> in it. ok visa@, anton@
2020-02-14Call CURSIG() only once and pass that signal to the check in dounmount()Claudio Jeker
and to CLRSIG. OK mpi@ visa@
2020-02-04Replace TAILQ concatenation loop with TAILQ_CONCATbket
OK florian@, bluhm@, visa@
2020-01-24Improve small random read ffs performance:Kurt Miller
Only call bread_cluster if either the previously read ffs block is adjacent to the current block or if the current read request exceeds the current ffs block. This effectively turns off read-ahead for random reads that fall within one ffs block. okay beck@, mpi@, visa@
2020-01-20struct vops is not modified during runtime so use const which moves eachClaudio Jeker
into read-only data segment. OK deraadt@ tedu@
2020-01-14Convert custom semaphores to tsleep_nsec(9).Martin Pieuchot
ok bluhm@
2020-01-04Call process_worklist_item with LK_NOWAIT to skip locked vnodes fromBob Beck
within softdep_process_worklist. When this is called from the syncer a vnode may be legtitimately locked by someone waiting for buffers so we need to skip anything locked. FreeBSD appears to have a similar change. This avoids a deadlock where the syncer ends up waiting for the inode lock that his held by someone waiting for buffer space. Found by bluhm@ and some genua folks ok bluhm@
2019-12-31Use C99 designated initializers with struct filterops. In addition,Visa Hankala
make the structs const so that the data are put in .rodata. OK mpi@, deraadt@, anton@, bluhm@
2019-12-26Convert struct vfsops initializer to C99 style.Alexander Bluhm
OK visa@
2019-11-27Re-enable IO_NOCACHE, and use is in vnd.Bob Beck
Ensure that io to a file backing a vnd is IO_SYNC, so IO to a vnd device is both synchronous and not cached in the buffer cache. This allows the "mount" regress to work repeatably, and avoids a situation where when the buffer cache cleaner runs to clear dirty buffers while people are waiting, it actually increases the dirty buffers when the writes to the underlying vnd are also delayed. ok bluhm@
2019-11-25Convert infinite sleeps to tsleep_nsec(9).Martin Pieuchot
ok bluhm@, cheloha@