summaryrefslogtreecommitdiffstats
path: root/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Commit message (Collapse)AuthorAgeFilesLines
* Update ZFS from version 6 to 13 and bring some FreeBSD-specific changes.pjd2008-11-17108-9337/+27333
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bring huge amount of changes, I'll enumerate only user-visible changes: - Delegated Administration Allows regular users to perform ZFS operations, like file system creation, snapshot creation, etc. - L2ARC Level 2 cache for ZFS - allows to use additional disks for cache. Huge performance improvements mostly for random read of mostly static content. - slog Allow to use additional disks for ZFS Intent Log to speed up operations like fsync(2). - vfs.zfs.super_owner Allows regular users to perform privileged operations on files stored on ZFS file systems owned by him. Very careful with this one. - chflags(2) Not all the flags are supported. This still needs work. - ZFSBoot Support to boot off of ZFS pool. Not finished, AFAIK. Submitted by: dfr - Snapshot properties - New failure modes Before if write requested failed, system paniced. Now one can select from one of three failure modes: - panic - panic on write error - wait - wait for disk to reappear - continue - serve read requests if possible, block write requests - Refquota, refreservation properties Just quota and reservation properties, but don't count space consumed by children file systems, clones and snapshots. - Sparse volumes ZVOLs that don't reserve space in the pool. - External attributes Compatible with extattr(2). - NFSv4-ACLs Not sure about the status, might not be complete yet. Submitted by: trasz - Creation-time properties - Regression tests for zpool(8) command. Obtained from: OpenSolaris
* Require write access on a directory being moved from one parenttrasz2008-11-081-0/+8
| | | | | | directory to another in ZFS. Approved by: rwatson (mentor), pjd
* Backoff the last patch. It was overly restrictive - we want to checktrasz2008-11-061-7/+0
| | | | | | | for write permission on target only when moving the target between two directories. Approved by: rwatson (mentor)
* Change ZFS behaviour to match UFS: when moving (rename(2)) a subdirectorytrasz2008-11-061-0/+7
| | | | | | | from one parent directory to another, in addition to the usual access checks one also needs write access to the subdirectory being moved. Approved by: rwatson (mentor), pjd
* Introduce accmode_t. This is required for NFSv4 ACLs - it will be neccessarytrasz2008-10-282-5/+5
| | | | | | | to add more V* constants, and the variables changed by this patch were often being assigned to mode_t variables, which is 16 bit. Approved by: rwatson (mentor)
* Remove the struct thread unuseful argument from bufobj interface.attilio2008-10-101-1/+1
| | | | | | | | | | | | | | | | | | | | | In particular following functions KPI results modified: - bufobj_invalbuf() - bufsync() and BO_SYNC() "virtual method" of the buffer objects set. Main consumers of bufobj functions are affected by this change too and, in particular, functions which changed their KPI are: - vinvalbuf() - g_vfs_close() Due to the KPI breakage, __FreeBSD_version will be bumped in a later commit. As a side note, please consider just temporary the 'curthread' argument passing to VOP_SYNC() (in bufsync()) as it will be axed out ASAP Reviewed by: kib Tested by: Giovanni Trematerra <giovanni dot trematerra at gmail dot com>
* Add missing ZFS_EXIT().pjd2008-09-151-0/+1
| | | | | PR: kern/124899 Submitted by: Masakazu Asama <m-asama@ginzado.ne.jp>
* Remove VSVTX, VSGID and VSUID. This should be a no-op,trasz2008-09-101-2/+2
| | | | | | as VSVTX == S_ISVTX, VSGID == S_ISGID and VSUID == S_ISUID. Approved by: rwatson (mentor)
* Initialize vp, so we don't call VOP_UNLOCK() with NULL vnode pointer.pjd2008-09-071-1/+2
| | | | Confirmed by: marcus
* Lock vnode exclusively around insmntque().pjd2008-09-062-10/+7
|
* Catch up after last insmntque() changes:pjd2008-09-052-0/+8
| | | | | | | | | | - The vnode has to be locked exclusively before calling insmntque(). - Until I find a way to handle insmntque() failures use VV_FORCEINSMQ flag to force insmntque() to always succeed. Reported by: kris, trasz, des, others Suggested by: kib Tested by: trasz
* Decontextualize the couplet VOP_GETATTR / VOP_SETATTR as the passed threadattilio2008-08-284-11/+7
| | | | | | was always curthread and totally unuseful. Tested by: Giovanni Trematerra <giovanni dot trematerra at gmail dot com>
* We want to use LBOLT instead of lbolt on FreeBSD.pjd2008-07-211-3/+3
| | | | | | I've this already fixed in p4, but the fix was never integrated into HEAD. Reported by: ed
* Remove the $FreeBSD$ tag again, now I know fbsd:nokeywords exists.ed2008-06-121-2/+0
| | | | | Requested by: pjd Approved by: philip (mentor)
* Turn dev2unit(), minor(), unit2minor() and minor2unit() into macro's.ed2008-06-121-7/+3
| | | | | | | | | | | | | Now that we got rid of the minor-to-unit conversion and the constraints on device minor numbers, we can convert the functions that operate on minor and unit numbers to simple macro's. The unit2minor() and minor2unit() macro's are now no-ops. The ZFS code als defined a macro named `minor'. Change the ZFS code to use umajor() and uminor() here, as it is the correct approach to do this. Also add $FreeBSD$ to keep SVN happy. Approved by: philip (mentor), pjd
* Fix namespace collision after src/sys/sys/file.h:1.78.pjd2008-05-253-4/+5
|
* Make the zfs module depend on the opensolaris module in preparation for itjb2008-05-241-0/+1
| | | | to shared stuff with the DTrace modules.
* Move the head of byte-level advisory lock list from thekib2008-04-163-41/+0
| | | | | | | | | | | | | | | | | | | | | | filesystem-specific vnode data to the struct vnode. Provide the default implementation for the vop_advlock and vop_advlockasync. Purge the locks on the vnode reclaim by using the lf_purgelocks(). The default implementation is augmented for the nfs and smbfs. In the nfs_advlock, push the Giant inside the nfs_dolock. Before the change, the vop_advlock and vop_advlockasync have taken the unlocked vnode and dereferenced the fs-private inode data, racing with with the vnode reclamation due to forced unmount. Now, the vop_getattr under the shared vnode lock is used to obtain the inode size, and later, in the lf_advlockasync, after locking the vnode interlock, the VI_DOOMED flag is checked to prevent an operation on the doomed vnode. The implementation of the lf_purgelocks() is submitted by dfr. Reported by: kris Tested by: kris, pho Discussed with: jeff, dfr MFC after: 2 weeks
* Add the new kernel-mode NFS Lock Manager. To use it instead of thedfr2008-03-261-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | user-mode lock manager, build a kernel with the NFSLOCKD option and add '-k' to 'rpc_lockd_flags' in rc.conf. Highlights include: * Thread-safe kernel RPC client - many threads can use the same RPC client handle safely with replies being de-multiplexed at the socket upcall (typically driven directly by the NIC interrupt) and handed off to whichever thread matches the reply. For UDP sockets, many RPC clients can share the same socket. This allows the use of a single privileged UDP port number to talk to an arbitrary number of remote hosts. * Single-threaded kernel RPC server. Adding support for multi-threaded server would be relatively straightforward and would follow approximately the Solaris KPI. A single thread should be sufficient for the NLM since it should rarely block in normal operation. * Kernel mode NLM server supporting cancel requests and granted callbacks. I've tested the NLM server reasonably extensively - it passes both my own tests and the NFS Connectathon locking tests running on Solaris, Mac OS X and Ubuntu Linux. * Userland NLM client supported. While the NLM server doesn't have support for the local NFS client's locking needs, it does have to field async replies and granted callbacks from remote NLMs that the local client has contacted. We relay these replies to the userland rpc.lockd over a local domain RPC socket. * Robust deadlock detection for the local lock manager. In particular it will detect deadlocks caused by a lock request that covers more than one blocking request. As required by the NLM protocol, all deadlock detection happens synchronously - a user is guaranteed that if a lock request isn't rejected immediately, the lock will eventually be granted. The old system allowed for a 'deferred deadlock' condition where a blocked lock request could wake up and find that some other deadlock-causing lock owner had beaten them to the lock. * Since both local and remote locks are managed by the same kernel locking code, local and remote processes can safely use file locks for mutual exclusion. Local processes have no fairness advantage compared to remote processes when contending to lock a region that has just been unlocked - the local lock manager enforces a strict first-come first-served model for both local and remote lockers. Sponsored by: Isilon Systems PR: 95247 107555 115524 116679 MFC after: 2 weeks
* Fix mmap(2) on ZFS after some changes in VM subsystem.pjd2008-03-151-0/+4
| | | | | | | Submitted by: alc Reported by: kris (originally) and many others Tested with: fsx MFC after: 1 week
* Axe the 'thread' argument from VOP_ISLOCKED() and lockstatus() as it isattilio2008-02-251-3/+3
| | | | | | | | | always curthread. As KPI gets broken by this patch, manpages and __FreeBSD_version will be updated by further commits. Tested by: Andrea Barberio <insomniac at slackware dot it>
* Introduce some functions in the vnode locks namespace and in the ffsattilio2008-02-241-4/+4
| | | | | | | | | | | | | | | namespace in order to handle lockmgr fields in a controlled way instead than spreading all around bogus stubs: - VN_LOCK_AREC() allows lock recursion for a specified vnode - VN_LOCK_ASHARE() allows lock sharing for a specified vnode In FFS land: - BUF_AREC() allows lock recursion for a specified buffer lock - BUF_NOREC() disallows recursion for a specified buffer lock Side note: union_subr.c::unionfs_node_update() is the only other function directly handling lockmgr fields. As this is not simple to fix, it has been left behind as "sole" exception.
* - Reduce how much ZFS caches by default. This is another change to mitigatepjd2008-01-241-4/+5
| | | | | | | 'kmem_map too small panics'. - Print two warnings if there is not enough memory and not enough address space. - Improve comment.
* VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used inattilio2008-01-134-14/+14
| | | | | | | | | | | conjuction with 'thread' argument passing which is always curthread. Remove the unuseful extra-argument and pass explicitly curthread to lower layer functions, when necessary. KPI results broken by this change, which should affect several ports, so version bumping and manpage update will be further committed. Tested by: kris, pho, Diego Sardina <siarodx at gmail dot com>
* vn_lock() is currently only used with the 'curthread' passed as argument.attilio2008-01-105-20/+20
| | | | | | | | | | | | | | | | Remove this argument and pass curthread directly to underlying VOP_LOCK1() VFS method. This modify makes the code cleaner and in particular remove an annoying dependence helping next lockmgr() cleanup. KPI results, obviously, changed. Manpage and FreeBSD_version will be updated through further commits. As a side note, would be valuable to say that next commits will address a similar cleanup about VFS methods, in particular vop_lock1 and vop_unlock. Tested by: Diego Sardina <siarodx at gmail dot com>, Andrea Di Pasquale <whyx dot it at gmail dot com>
* * Check endianness the FreeBSD way.jb2007-11-286-19/+19
| | | | | * Use LBOLT rather than lbolt to avoid a clash with a FreeBSD global variable.
* Warn if kmem_map size is set to less than 512MB. Previous warning was a bitpjd2007-11-071-5/+5
| | | | | | | pointless, because default is set to something around 300MB and also insufficient. MFC after: 3 days
* If setting a state to anything but open state, close access to vdev.pjd2007-11-051-0/+11
| | | | | | | This fixes replacing drive in place, eg. zpool replace tank da1 da1. Before it complained that device is already open. MFC after: 1 week
* - Add sysctl for sizeof(znode_t), which will be used by fstat(1).lulf2007-11-021-0/+4
| | | | Approved by: pjd (mentor)
* Call zil_commit() (if ZIL is not disabled) after every non-read requestpjd2007-11-011-11/+11
| | | | | | | | (BIO_WRITE and BIO_FLUSH) as it is done is Solaris. The difference is that Solaris calls it only for sync requests, but we can't say in GEOM is the request is sync or async, so we do it for every request. MFC after: 1 week
* Rename the kthread_xxx (e.g. kthread_create()) callsjulian2007-10-202-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.
* ZFS_LOG adds a newline by itself.thompsa2007-10-141-1/+1
| | | | Pointed out by: pjd
* Print the ZFS ereport to the console if vfs.zfs.debug is set to help diagnosethompsa2007-10-141-0/+1
| | | | | | problems with zfs-on-root since devd isnt running yet. Reviewed by: pjd
* Fix lock leak leading to the 'System call <name> returning with 1 locks held'pjd2007-10-041-0/+2
| | | | | | | panic. Reported by: kris Approved by: re (kensmith)
* Reduce the limit of vnodes on i386 when ZFS is loaded to 3/4 of the originalpjd2007-09-101-0/+41
| | | | | | | | | | | | | value, so we don't run out of KVA. The default vnodes limit fits better for UFS, but ZFS allocated more file system specific memory for a vnode than UFS. Don't touch vnodes limit if we detect it was tuned by system administrator and restore original value when ZFS is unloaded. This isn't final fix, but before we implement something better, this will help to stabilize ZFS under heavy load on i386. Approved by: re (bmah)
* After dfr@ vnode leak fix, we can allow ARC to consume more memory.pjd2007-09-101-2/+2
| | | | | Tested by: kris Approved by: re (bmah)
* Use CTLFLAG_RDTUN for tunable sysctls.pjd2007-09-011-2/+2
| | | | Approved by: re (bmah)
* Update assertion after revision 1.23.pjd2007-07-241-1/+1
| | | | | Reviewed by: dfr Approved by: re (rwatson)
* Correct a reference-counting mistake in the ZFS code which led to abnormaldfr2007-07-092-3/+1
| | | | | | | memory usage and pessimal cache performance. Reviewed by: pjd Approved by: re (rwatson)
* In zfs_vget, if we fail to translate an inode number to the correspondingdfr2007-06-271-1/+1
| | | | | | | vnode, make sure we return an error code to the caller. Reviewed by: pjd Approved by: re
* - Reduce number of atomic operations needed to be implemented in asm bypjd2007-06-081-3/+0
| | | | | | | implementing some of them using existing ones. - Allow to compile ZFS on all archs and use atomic operations surrounded by global mutex on archs we don't have or can't have all atomic operations needed by ZFS.
* Reimplement traverse() helper function:pjd2007-06-041-10/+9
| | | | | | | | | | | | 1. Pass locking flags to VFS_ROOT(). 2. Check v_mountedhere while the vnode is locked. 3. Always return locked vnode on success. Change 1 fixes problem reported by Stephen M. Rumble - after zfs_vfsops.c,1.9 change, zfs_root() no longer locks the vnode unconditionally and traverse() didn't pass right lock type to VFS_ROOT(). The result was that kernel paniced when .zfs/ directory was accessed via NFS.
* Adjust va_mask for setattr. FreeBSD doesn't have va_mask, so we initialize itpjd2007-05-281-0/+1
| | | | | | | | based on individual fields beeing set. This doesn't work for setattr replay, because va_type is set there, so we add AT_TYPE flag to va_mask, which won't be accepted by zfs_setattr(). Reported by: kris
* Because we allocate componentname structures on stack, bzero() them beforepjd2007-05-281-0/+3
| | | | use just in case.
* Initialize ZFS a bit earlier and block root mounting untilpjd2007-05-241-1/+4
| | | | | | | | initialization is complete. This fixes some root-on-ZFS configurations. Reported by: Bruno Damour <freebsd.ruomad@free.fr> Tested by: Bruno Damour <freebsd.ruomad@free.fr>
* Lock vnode on lookup. This fixes ZIL replay for rmdir/unlink/rename.pjd2007-05-221-0/+3
| | | | Reported by: des
* Increase debug level - this message is not that important.pjd2007-05-091-1/+1
|
* - Add missing lock destruction and remove duplicate initializations.pjd2007-05-066-5/+14
| | | | | | With this change it is possible to unload zfs.ko module from WITNESS-enabled kernel. - Remove bogus comment.
* Use provider's ident to handle situations when disks are moved aroundpjd2007-05-061-10/+161
| | | | | | | and show up with different names: first try to open provider using remembered name and compare its ident, if equal, this is our provider, if not equal or there is no provider with such name, find provider with remembered ident and don't care about the name.
* MFp4: We don't need to cover vnode_pager_setsize() with the z_map_lock.pjd2007-05-061-1/+2
|
OpenPOWER on IntegriCloud