summaryrefslogtreecommitdiffstats
path: root/sys/cddl
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Eliminate now-unused SUSER_ALLOWJAIL arguments to priv_check_cred(); inrwatson2007-06-121-17/+12
| | | | | | | | | | | | | | | some cases, move to priv_check() if it was an operation on a thread and no other flags were present. Eliminate caller-side jail exception checking (also now-unused); jail privilege exception code now goes solely in kern_jail.c. We can't yet eliminate suser() due to some cases in the KAME code where a privilege check is performed and then used in many different deferred paths. Do, however, move those prototypes to priv.h. Reviewed by: csjp Obtained from: TrustedBSD Project
* Add my copyright.marcel2007-06-081-0/+28
| | | | Requested by: pjd@
* - Reduce number of atomic operations needed to be implemented in asm bypjd2007-06-087-1707/+277
| | | | | | | 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.
* Missing atomic operations for ZFS/ia64.pjd2007-06-081-0/+54
| | | | Submitted by: marcel
* Despite several examples in the kernel, the third argument ofdwmalone2007-06-041-2/+2
| | | | | | | | | | | | | 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.
* Reimplement traverse() helper function:pjd2007-06-043-20/+23
| | | | | | | | | | | | 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.
* Revert UF_OPENING workaround for CURRENT.kib2007-05-312-2/+2
| | | | | | | | | Change the VOP_OPEN(), vn_open() vnode operation and d_fdopen() cdev operation argument from being file descriptor index into the pointer to struct file. Proposed and reviewed by: jhb Reviewed by: daichi (unionfs) Approved by: re (kensmith)
* 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.
* There are too many false positive LORs reported by WITNESS, so when ZFSpjd2007-05-262-2/+14
| | | | | | debug is turned off, initialize locks with NOWITNESS flag. At some point I'll get back to them, we would probably need BLESSING functionality, which is currently turned off by default.
* DNLC_NO_VNODE can't be NULL.pjd2007-05-241-1/+1
| | | | Reported by: ru
* 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>
* FreeBSD's namecache works quite well with ZFS, so remove DNLC.pjd2007-05-233-1075/+40
|
* All objects we create using GFS are directories, so initialize d_typepjd2007-05-231-2/+2
| | | | | properly, but add XXX comment saying that it can eventually change in the future.
* 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
|
* Share-lock a vnode where possible.pjd2007-05-023-4/+4
|
* When parent directory has to be unlocked, lock it back with the same lockpjd2007-05-021-2/+6
| | | | | type. Before this change, if directory was shared-locked, it was relocked exclusively.
* Lock vnode using cn_lkflags in case the caller wants the vnode to bepjd2007-05-021-1/+1
| | | | shared-locked.
* The getnewvnode() function sets LK_NOSHARE by default, so if we want topjd2007-05-021-3/+9
| | | | | support shared vnodes locking, we need to remove that flag. Also add LK_CANRECURSE flag as found in nfsclient.
* ZFS should update timestamps upon the creat() of an existing file.pjd2007-05-022-2/+5
| | | | | Obtained from: OpenSolaris Bug: http://bugs.opensolaris.org/view_bug.do?bug_id=6465105
* - Lock vnode with flags passed in as argument in zfs_vget() and zfs_root().pjd2007-05-021-2/+4
| | | | | | | Pointed out by: ups Also reported by: kris - Add comments where I'm not sure if LK_RETRY should be used.
* MFp4: Remove LK_RETRY flag when locking vnode in zfs_lookup, we don't wantpjd2007-05-011-1/+6
| | | | | | dead vnodes here. Suggested by: kib
* White space fixes.pjd2007-05-014-34/+34
|
* Add a comment explaining why we call dmu_write() unconditionally, even ifpjd2007-05-011-0/+9
| | | | | | | uiomove() fails, especially that it is different from what OpenSolaris does (I'm not entirely sure they are right). Suggested by: darrenr
* - Define d_type for ".", ".." and ".zfs" directories.pjd2007-04-292-0/+5
| | | | - Add a TODO comment where d_type is still noe defined.
* Oops, correct important typo in last commit.pjd2007-04-291-1/+1
|
* Avoid freeing NULL pointer in case of an error.pjd2007-04-291-1/+1
|
* Fix two use-after-free cases.pjd2007-04-291-2/+2
|
* MFp4: Optimize mappedwrite() and mappedread() functions to write/read as muchpjd2007-04-261-31/+58
| | | | | | | | | non-mapped data as possible at once and not page-by-page. Which this change we combain I/Os, but also saves many VM_OBJECT_UNLOCK()/VM_OBJECT_LOCK() operations. Simple 'fsx -l 33554432 -o 524288 -N 10000 /tank/fsx' test shows ~23% performance increase.
* - Always try to write one whole page at a time.pjd2007-04-261-7/+9
| | | | | | | | | | - vm_page_undirty() is enough (instead of vm_page_set_validclean()), but it has to be called before we write the data in case someone makes page dirty after our write, but before our vm_page_undirty() call. - Always dmu_write, not matter if uiomove() succeeded, because it could partially be ok and we would lose some changes. All good ideas from: ups
* MFV: Free znodes immediatelly, allowing the ARC to hold onto less memory.pjd2007-04-261-1/+1
| | | | Full description at: http://bugs.opensolaris.org/view_bug.do?bug_id=6543706
* MFV: Functions name change.pjd2007-04-261-4/+4
|
* ZIL (ZFS Intent Log) can be safely turned on and off at run time, becausepjd2007-04-241-1/+1
| | | | | it is only used when dataset is beeing mounted to decide if log should also be opened.
* MFp4: Now that ZFS can use FreeBSD's namecache, turn it off by default andpjd2007-04-241-0/+4
| | | | turn off DNLC, but don't remove DNLC yet just in case.
* MFp4: Rearange the code so vobject is destroyed from reclaim() method likepjd2007-04-242-21/+22
| | | | | | | | in all other file system on FreeBSD (instead from inactive() method). A nice side-effect of this change, except that it speedups file system when mmaped file are often open/closed, is that it makes FreeBSD's namecache work:)
* MFp4: Once page is written successfully, we should clear the dirty bits.pjd2007-04-241-0/+3
| | | | | | | | | This fixes slow operations on mmaped files, because without this fix, pages were written to disk multiple times. If one is looking for even greater speed up for such operation, he should disable ZIL (by setting vfs.zfs.zil_disable to 1 in /boot/loader.conf). Disabling ZIL makes fsx run ~9 times faster.
* MFp4: Reduce diff against vendor.pjd2007-04-243-2/+4
|
* MFp4: We have stronger 'lock already initialized' check now, so we canpjd2007-04-241-1/+0
| | | | reduce diff against the vendor by removing bzero of this mutex.
* Mostly-cosmetic fixes in low-memory warning messages:bmah2007-04-231-6/+7
| | | | | | | | | | | | o Fix linewrap issues. o Fix two typos (s/Recomended/Recommended/ and s/tunning/tuning/) o Remove a couple of extra instances of the word "of". o Update names of kmem_size variables. Approved by: pjd
* Too much diff reduction. 'cmd' has to be u_long.pjd2007-04-231-3/+3
| | | | Reported by: delphij
* MFp4: Reduce diff against vendor code:pjd2007-04-2312-474/+856
| | | | | | - Move FreeBSD-specific code to zfs_freebsd_*() functions in zfs_vnops.c and keep original functions as similar to vendor's code as possible. - Add various includes back, now that we have them.
* Fix 'zpool status -v'. To get object number we should use ZFS_DIRENT_OBJ()pjd2007-04-221-1/+2
| | | | | | | | | macro, as za_first_integer field also contains type. This should be fixed in ZFS itself, but this bug is not visible on Solaris, because there, type is not stored in za_first_integer. On the other hand it will be visible on MacOS X. Reported by: Barry Pederson <bp@barryp.org>
* Fix st_rdev handling (implement it, actually).pjd2007-04-222-2/+9
| | | | Reported by: gj
* MFp4:pjd2007-04-215-25/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | @118370 Correct typo. @118371 Integrate changes from vendor. @118491 Show backtrace on unexpected code paths. @118494 Integrate changes from vendor. @118504 Fix sendfile(2). I had two ways of fixing it: 1. Fixing sendfile(2) itself to use VOP_GETPAGES() instead of hacking around with vn_rdwr(UIO_NOCOPY), which was suggested by ups. 2. Modify ZFS behaviour to handle this special case. Although 1 is more correct, I've choosen 2, because hack from 1 have a side-effect of beeing faster - it reads ahead MAXBSIZE bytes instead of reading page by page. This is not easy to implement with VOP_GETPAGES(), at least not for me in this very moment. Reported by: Andrey V. Elsukov <bu7cher@yandex.ru> @118525 Reorganize the code to reduce diff. @118526 This code path is expected. It is simply when file is opened with O_FSYNC flag. Reported by: kris Reported by: Michal Suszko <dry@dry.pl>
OpenPOWER on IntegriCloud