summaryrefslogtreecommitdiffstats
path: root/sys/geom/journal
Commit message (Collapse)AuthorAgeFilesLines
* MFC 313409: Defer startup of gjournal switcher kproc.jhb2017-05-101-11/+35
| | | | Don't start switcher kproc until the first GEOM is created.
* MFC r306279: Use g_wither_provider() where applicable.mav2016-10-061-2/+1
| | | | | It is just a helper function combining G_PF_WITHER setting with g_orphan_provider().
* Removal of Giant droping wrappers for GEOM classes.kib2016-05-201-10/+0
| | | | Sponsored by: The FreeBSD Foundation
* sys/geom: spelling fixes in comments.pfg2016-04-291-3/+3
| | | | No functional change.
* sys/geom: spelling fixes.pfg2016-04-281-1/+1
| | | | | | These affect debugging messages. MFC after: 2 weeks
* Create an API to reset a struct bio (g_reset_bio). This is mandatoryimp2016-02-171-2/+2
| | | | | | | | | for all struct bio you get back from g_{new,alloc}_bio. Temporary bios that you create on the stack or elsewhere should use this before first use of the bio, and between uses of the bio. At the moment, it is nothing more than a wrapper around bzero, but that may change in the future. The wrapper also removes one place where we encode the size of struct bio in the KBI.
* CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than tenjkim2015-05-221-1/+1
| | | | | | | | | | years for head. However, it is continuously misused as the mpsafe argument for callout_init(9). Deprecate the flag and clean up callout_init() calls to make them more consistent. Differential Revision: https://reviews.freebsd.org/D2613 Reviewed by: jhb MFC after: 2 weeks
* cswitch is unsigned, so don't compare it < 0. Any negative numbersimp2014-08-071-1/+1
| | | | will look huge and be caught by > 100.
* Pull in r267961 and r267973 again. Fix for issues reported will follow.hselasky2014-06-281-5/+2
|
* Revert r267961, r267973:gjb2014-06-271-2/+5
| | | | | | | | | | These changes prevent sysctl(8) from returning proper output, such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifhselasky2014-06-271-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there is an environment variable which shall initialize the SYSCTL during early boot. This works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTL NODE type and SYSCTLs which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to be used in the case a tunable sysctl has a custom initialisation function allowing the sysctl to still be marked as a tunable. The kernel SYSCTL API is mostly the same, with a few exceptions for some special operations like iterating childrens of a static/extern SYSCTL node. This operation should probably be made into a factored out common macro, hence some device drivers use this. The reason for changing the SYSCTL API was the need for a SYSCTL parent OID pointer and not only the SYSCTL parent OID list pointer in order to quickly generate the sysctl path. The motivation behind this patch is to avoid parameter loading cludges inside the OFED driver subsystem. Instead of adding special code to the OFED driver subsystem to post-load tunables into dynamically created sysctls, we generalize this in the kernel. Other changes: - Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask" to "hw.pcic.intr_mask". - Removed redundant TUNABLE statements throughout the kernel. - Some minor code rewrites in connection to removing not needed TUNABLE statements. - Added a missing SYSCTL_DECL(). - Wrapped two very long lines. - Avoid malloc()/free() inside sysctl string handling, in case it is called to initialize a sysctl from a tunable, hence malloc()/free() is not ready when sysctls from the sysctl dataset are registered. - Bumped FreeBSD version to indicate SYSCTL API change. MFC after: 2 weeks Sponsored by: Mellanox Technologies
* Partially revert r259080. bde@ pointed out that there are a lot more style bugsjhibbits2013-12-081-1/+1
| | | | | | | | going on in here than can be fixed, and I introduced some of my own. Rather than fix the whole host of them, back out my bugs. Found by: bde X-MFC with: r259080
* Fix some integer signs. These unsigned integers should all be signed.jhibbits2013-12-071-1/+1
| | | | Found by: clang (powerpc64)
* When panicing due to the gjournal overflow, print the geom metadatakib2013-07-101-1/+3
| | | | | | | journal id. Requested by: Andreas Longwitz <longwitz@incore.de> MFC after: 1 week
* There are several code sequences likekib2013-07-091-1/+1
| | | | | | | | | | | | | | | | | | | vfs_busy(mp); vfs_write_suspend(mp); which are problematic if other thread starts unmount between two calls. The unmount starts a write, while vfs_write_suspend() drain writers. On the other hand, unmount drains busy references, causing the deadlock. Add a flag argument to vfs_write_suspend and require the callers of it to specify VS_SKIP_UNMOUNT flag, when the call is performed not in the mount path, i.e. the covered vnode is not locked. The suspension is not attempted if VS_SKIP_UNMOUNT is specified and unmount is in progress. Reported and tested by: Andreas Longwitz <longwitz@incore.de> Sponsored by: The FreeBSD Foundation MFC after: 3 weeks
* Add flags argument to vfs_write_resume() and removekib2013-01-111-1/+1
| | | | | | vfs_write_resume_flags(). Sponsored by: The FreeBSD Foundation
* Remove the support for using non-mpsafe filesystem modules.kib2012-10-221-8/+2
| | | | | | | | | | | | In particular, do not lock Giant conditionally when calling into the filesystem module, remove the VFS_LOCK_GIANT() and related macros. Stop handling buffers belonging to non-mpsafe filesystems. The VFS_VERSION is bumped to indicate the interface change which does not result in the interface signatures changes. Conducted and reviewed by: attilio Tested by: pho
* Current implementations of sync(2) and syncer vnode fsync() VOP useskib2012-02-061-10/+3
| | | | | | | | | | | | | | | | | | | | | | mnt_noasync counter to temporary remove MNTK_ASYNC mount option, which is needed to guarantee a synchronous completion of the initiated i/o before syscall or VOP return. Global removal of MNTK_ASYNC option is harmful because not only i/o started from corresponding thread becomes synchronous, but all i/o is synchronous on the filesystem which is initiated during sync(2) or syncer activity. Instead of removing MNTK_ASYNC from mnt_kern_flag, provide a local thread flag to disable async i/o for current thread only. Use the opportunity to move DOINGASYNC() macro into sys/vnode.h and consistently use it through places which tested for MNTK_ASYNC. Some testing demonstrated 60-70% improvements in run time for the metadata-intensive operations on async-mounted UFS volumes, but still with great deviation due to other reasons. Reviewed by: mckusick Tested by: scottl MFC after: 2 weeks
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.ed2011-11-071-3/+4
| | | | | | The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static.
* Removed KASSERT, g_new_providerf() can not fail.ae2011-05-041-1/+0
| | | | MFC after: 1 week
* Implement relaxed comparision for hardcoded provider names to make itmav2011-04-271-1/+2
| | | | | ignore adX/adaY difference in both directions to simplify migration to the CAM-based ATA or back.
* Add some FEATURE macros for various GEOM classes.netchild2011-02-251-0/+1
| | | | | | | | | | | No FreeBSD version bump, the userland application to query the features will be committed last and can serve as an indication of the availablility if needed. Sponsored by: Google Summer of Code 2010 Submitted by: kibab Reviewed by: silence on geom@ during 2 weeks X-MFC after: to be determined in last commit with code from this project
* Treat async buffer writes from the gjournal switcher thread the same askib2011-01-261-0/+1
| | | | | | | | from syncer. We shall not sleep on running buffer space when suspending. Reproduced and tested by: pho PR: kern/154228 MFC after: 1 week
* Make gjournal work with kernel compiled with "options DIAGNOSTIC".trasz2009-06-301-0/+1
| | | | | | | Previously, it would panic immediately. Reviewed by: pjd Approved by: re (kib)
* Remove the thread argument from the FSD (File-System Dependent) parts ofattilio2009-05-111-1/+1
| | | | | | | | | | | | | | | | | the VFS. Now all the VFS_* functions and relating parts don't want the context as long as it always refers to curthread. In some points, in particular when dealing with VOPs and functions living in the same namespace (eg. vflush) which still need to be converted, pass curthread explicitly in order to retain the old behaviour. Such loose ends will be fixed ASAP. While here fix a bug: now, UFS_EXTATTR can be compiled alone without the UFS_EXTATTR_AUTOSTART option. VFS KPI is heavilly changed by this commit so thirdy parts modules needs to be recompiled. Bump __FreeBSD_version in order to signal such situation.
* Revert r190676,190677thompsa2009-04-101-1/+1
| | | | | | | The geom and CAM changes for root_hold are the wrong solution for USB design quirks. Requested by: scottl
* Add a how argument to root_mount_hold() so it can be passed NOWAIT and be calledthompsa2009-04-031-1/+1
| | | | in situations where sleeping isnt allowed.
* Make it possible to use gjournal for the root filesystem. Previously,trasz2008-12-062-0/+18
| | | | | | | | | an unclean shutdown would make it impossible to mount rootfs at boot. PR: kern/128529 Reviewed by: pjd Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation
* Improve VFS locking:attilio2008-11-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Implement real draining for vfs consumers by not relying on the mnt_lock and using instead a refcount in order to keep track of lock requesters. - Due to the change above, remove the mnt_lock lockmgr because it is now useless. - Due to the change above, vfs_busy() is no more linked to a lockmgr. Change so its KPI by removing the interlock argument and defining 2 new flags for it: MBF_NOWAIT which basically replaces the LK_NOWAIT of the old version (which was unlinked from the lockmgr alredy) and MBF_MNTLSTLOCK which provides the ability to drop the mountlist_mtx once the mnt interlock is held (ability still desired by most consumers). - The stub used into vfs_mount_destroy(), that allows to override the mnt_ref if running for more than 3 seconds, make it totally useless. Remove it as it was thought to work into older versions. If a problem of "refcount held never going away" should appear, we will need to fix properly instead than trust on such hackish solution. - Fix a bug where returning (with an error) from dounmount() was still leaving the MNTK_MWAIT flag on even if it the waiters were actually woken up. Just a place in vfs_mount_destroy() is left because it is going to recycle the structure in any case, so it doesn't matter. - Remove the markercnt refcount as it is useless. This patch modifies VFS ABI and breaks KPI for vfs_busy() so manpages and __FreeBSD_version will be modified accordingly. Discussed with: kib Tested by: pho
* Decontextualize vfs_busy(), vfs_unbusy() and vfs_mount_alloc() functions.attilio2008-08-311-5/+4
| | | | | | Manpages are updated accordingly. Tested by: Diego Sardina <siarodx at gmail dot com>
* - Fix spelling errors.lulf2008-06-201-5/+5
| | | | | | Approved by: kib (mentor) PR: kern/124788 Submitted by: Hywel Mallett <Hywel -at- hmallett.co.uk>
* Rename the kthread_xxx (e.g. kthread_create()) callsjulian2007-10-201-4/+4
| | | | | | | | | | | to kproc_xxx as they actually make whole processes. Thos makes way for us to add REAL kthread_create() and friends that actually make theads. it turns out that most of these calls actually end up being moved back to the thread version when it's added. but we need to make this cosmetic change first. I'd LOVE to do this rename in 7.0 so that we can eventually MFC the new kthread_xxx() calls.
* Commit 14/14 of sched_lock decomposition.jeff2007-06-051-2/+2
| | | | | | | | | | | - Use thread_lock() rather than sched_lock for per-thread scheduling sychronization. - Use the per-process spinlock rather than the sched_lock for per-process scheduling synchronization. Tested by: kris, current@ Tested on: i386, amd64, ULE, 4BSD, libthr, libkse, PREEMPTION, etc. Discussed with: kris, attilio, kmacy, jhb, julian, bde (small parts each)
* Despite several examples in the kernel, the third argument ofdwmalone2007-06-041-3/+3
| | | | | | | | | | | | | sysctl_handle_int is not sizeof the int type you want to export. The type must always be an int or an unsigned int. Remove the instances where a sizeof(variable) is passed to stop people accidently cut and pasting these examples. In a few places this was sysctl_handle_int was being used on 64 bit types, which would truncate the value to be exported. In these cases use sysctl_handle_quad to export them and change the format to Q so that sysctl(1) can still print them.
* Sysctl description is not a format string, so one % is enough.pjd2007-04-061-1/+1
|
* Add missing \n.pjd2007-03-221-2/+2
|
* Softc may be NULL in g_journal_orphan(), so don't be surprised.pjd2006-12-021-3/+4
|
* Fix ia64 build breakage.pjd2006-11-021-0/+2
|
* - Use g_duplicate_bio() instead of g_clone_bio(), so there memory ispjd2006-11-021-5/+3
| | | | | | | | allocated with M_WAITOK flag. - Check 'buf' instead of 'error' so Prevent is not confused. CID: 1562, 1563 Found by: Coverity Prevent analysis tool
* Grr, fix one more build breakage.pjd2006-11-021-0/+1
|
* Change spaces to tabs where needed.pjd2006-11-011-1/+1
|
* Forgot to remove this line.pjd2006-11-011-1/+0
| | | | Reported by: maxim
* Update the code to the current sync(2) version:pjd2006-11-011-4/+12
| | | | | | | | - Do not modify mnt_flag without mount interlock held. - Do not touch MNT_ASYNC flag, as this can lead to a race with nmount(2). Pointed out by: tegge Reviewed by: tegge
* Remove debugging code I accidentally committed.pjd2006-11-011-35/+0
|
* Add gjournal GEOM class (kernel side), which implements block levelpjd2006-10-313-0/+3555
journaling and can be tought about marking file system as clean before doing journal switch, which easly allows to add journaling to file systems that don't have this feature. Sponsored by: home.pl
OpenPOWER on IntegriCloud