Commit Graph

853 Commits

Author SHA1 Message Date
pjd
bb45a1006d Increase debug level - this message is not that important. 2007-05-09 22:32:49 +00:00
pjd
e719d97469 - Add missing lock destruction and remove duplicate initializations.
With this change it is possible to unload zfs.ko module from
  WITNESS-enabled kernel.
- Remove bogus comment.
2007-05-06 19:05:37 +00:00
pjd
1effa32b66 Use provider's ident to handle situations when disks are moved around
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.
2007-05-06 01:39:39 +00:00
pjd
a360ad79b0 MFp4: We don't need to cover vnode_pager_setsize() with the z_map_lock. 2007-05-06 01:27:54 +00:00
pjd
de2973eb6e Share-lock a vnode where possible. 2007-05-02 01:03:10 +00:00
pjd
61f69851ce When parent directory has to be unlocked, lock it back with the same lock
type. Before this change, if directory was shared-locked, it was relocked
exclusively.
2007-05-02 00:41:44 +00:00
pjd
c228d77c51 Lock vnode using cn_lkflags in case the caller wants the vnode to be
shared-locked.
2007-05-02 00:39:52 +00:00
pjd
fa150c55a8 The getnewvnode() function sets LK_NOSHARE by default, so if we want to
support shared vnodes locking, we need to remove that flag.
Also add LK_CANRECURSE flag as found in nfsclient.
2007-05-02 00:22:12 +00:00
pjd
3e897aef92 ZFS should update timestamps upon the creat() of an existing file.
Obtained from:	OpenSolaris
Bug:		http://bugs.opensolaris.org/view_bug.do?bug_id=6465105
2007-05-02 00:18:22 +00:00
pjd
b7da9e60c9 - Lock vnode with flags passed in as argument in zfs_vget() and zfs_root().
Pointed out by:	ups
  Also reported by:	kris

- Add comments where I'm not sure if LK_RETRY should be used.
2007-05-02 00:09:34 +00:00
pjd
e136828161 MFp4: Remove LK_RETRY flag when locking vnode in zfs_lookup, we don't want
dead vnodes here.

Suggested by:	kib
2007-05-01 13:58:56 +00:00
pjd
1f22d95a28 White space fixes. 2007-05-01 13:32:22 +00:00
pjd
f7ee62e6cc Add a comment explaining why we call dmu_write() unconditionally, even if
uiomove() fails, especially that it is different from what OpenSolaris
does (I'm not entirely sure they are right).

Suggested by:	darrenr
2007-05-01 12:09:45 +00:00
pjd
142746f314 - Define d_type for ".", ".." and ".zfs" directories.
- Add a TODO comment where d_type is still noe defined.
2007-04-29 23:28:07 +00:00
pjd
066350de07 Oops, correct important typo in last commit. 2007-04-29 23:12:00 +00:00
pjd
a41b18df0d Avoid freeing NULL pointer in case of an error. 2007-04-29 23:08:24 +00:00
pjd
a50bed8070 Fix two use-after-free cases. 2007-04-29 00:41:29 +00:00
pjd
3323c598b1 MFp4: Optimize mappedwrite() and mappedread() functions to write/read as much
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.
2007-04-26 17:07:50 +00:00
pjd
f3cd86d548 - Always try to write one whole page at a time.
- 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
2007-04-26 12:58:17 +00:00
pjd
c594b14282 MFV: Free znodes immediatelly, allowing the ARC to hold onto less memory.
Full description at:	http://bugs.opensolaris.org/view_bug.do?bug_id=6543706
2007-04-26 10:08:54 +00:00
pjd
38af4e262c MFV: Functions name change. 2007-04-26 09:38:20 +00:00
pjd
9ff5fd9d6a ZIL (ZFS Intent Log) can be safely turned on and off at run time, because
it is only used when dataset is beeing mounted to decide if log should also
be opened.
2007-04-24 19:02:51 +00:00
pjd
f57a8259ea MFp4: Now that ZFS can use FreeBSD's namecache, turn it off by default and
turn off DNLC, but don't remove DNLC yet just in case.
2007-04-24 16:59:20 +00:00
pjd
732835bdb2 MFp4: Rearange the code so vobject is destroyed from reclaim() method like
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:)
2007-04-24 16:57:53 +00:00
pjd
e68258363d MFp4: Once page is written successfully, we should clear the dirty bits.
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.
2007-04-24 16:53:01 +00:00
pjd
81f4f72307 MFp4: Reduce diff against vendor. 2007-04-24 16:49:01 +00:00
pjd
c5bca60838 MFp4: We have stronger 'lock already initialized' check now, so we can
reduce diff against the vendor by removing bzero of this mutex.
2007-04-24 16:45:42 +00:00
bmah
3094ba1201 Mostly-cosmetic fixes in low-memory warning messages:
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
2007-04-23 21:52:14 +00:00
pjd
f32e047ea9 Too much diff reduction. 'cmd' has to be u_long.
Reported by:	delphij
2007-04-23 13:47:49 +00:00
pjd
2063f01374 MFp4: Reduce diff against vendor code:
- 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.
2007-04-23 00:52:07 +00:00
pjd
328ad8c39b Fix 'zpool status -v'. To get object number we should use ZFS_DIRENT_OBJ()
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>
2007-04-22 21:18:40 +00:00
pjd
6af3e59793 Fix st_rdev handling (implement it, actually).
Reported by:	gj
2007-04-22 21:16:15 +00:00
pjd
24d4489802 MFp4:
@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>
2007-04-21 12:02:57 +00:00
pjd
20ada39949 MFp4: We check for PRIV_VFS_MOUNT already in mount(2) syscall and we don't
want to do the check when snapshot is automatically mounted by an
      unprivileged user doing lookup on a snapshot directory.
2007-04-18 15:22:07 +00:00
pjd
0372a5c167 Simplify. 2007-04-17 21:58:34 +00:00
pjd
934b1fc38b Ignore hostid check for root-on-ZFS configurations. Making hostid available
before the root is mounted is tricky and having it in /boot/ is not really
desire.

Reported by:	Zephiris <zephiris@gmail.com>
2007-04-17 17:57:34 +00:00
pjd
33ebe8ecb6 Uncomment forgotten check. Without this check in-place, ZFS will panic on
unload instead of returning EBUSY. This check tells if there are mounted
ZFS file systems or not. We can't unload if there are mounted file systems.

Reported by:	Andrey V. Elsukov <bu7cher@yandex.ru>
2007-04-16 10:23:24 +00:00
pjd
1e51d3c721 MFp4: Start DNLC after desiredvnodes variable is initialized.
Before this change if zfs.ko was loaded by the loader, DNLC was
      automatically disabled.

Reported by:	Zephiris <zephiris@gmail.com>
2007-04-15 09:10:17 +00:00
pjd
1c12f58815 Fix RAID-Z resilvering.
Obtained from:	OpenSolaris
2007-04-14 20:50:14 +00:00
pjd
92c90b193d MFp4: Hmm, it seems to work now. 2007-04-14 15:01:50 +00:00
pjd
7379980465 MFp4: Use max_ncpus, which is used in other places in the code. 2007-04-14 12:33:47 +00:00
pjd
d1eb6afd2d MFp4: Add more debug, so we can see if zpool.cache was loaded or why it
wasn't loaded.
2007-04-14 12:23:03 +00:00
pjd
5f8b118000 MFp4: Allow to tune vfs.zfs.debug from loader.conf. 2007-04-14 12:21:06 +00:00
pjd
9a4164a0bb MFp4: - Allow to tune number of spa_zio_* threads.
- Reduce default number of spa_zio_* threads to N*spa_zio_issue
	  plus N*spa_zio_intr threads per ZIO type, where N is the number
	  of CPUs.
	- Put ZIO type number in thread's name.
2007-04-14 12:20:06 +00:00
bms
dff4ea292c In member interface detach event handler, do not attempt to free state
which has already been freed by in_ifdetach(). With this cumulative change,
the removal of a member interface will not cause a panic in pfsync(4).

Requested by:	yar
PR:		86848
2007-04-14 01:01:46 +00:00
pjd
07cc016152 Fix overflow, which was causing endless loops when 32bit machine had more
than 2GB of RAM. This was because our physmem is long and 'physmem*PAGESIZE'
can be negative for more than 2GB of memory.

Reported by:	Andrey V. Elsukov <bu7cher@yandex.ru>

It is not yet tested by Andrey, so there can be other problems, but this
was definiately a bug, so I'm committing a fix now.
2007-04-13 18:50:03 +00:00
pjd
aa9e6582b9 Fix vnodes starvation caused by DNLC (ZFS name cache):
- Tune number of namecache entires better (based on desiredvnodes).
- Handle vfs_lowvnodes event by releasing requested number of name cache
  entries, but no less than 5%.

Reported by:	simokawa
2007-04-13 08:42:01 +00:00
pjd
f2c622ab52 MFp4: Synchronize with vendor (mostly 'zfs rename -r'). 2007-04-12 23:16:02 +00:00
pjd
52f379b390 MFp4: Bring back comments.
Requested by:	jhb
2007-04-12 23:14:25 +00:00
ru
24d57a95f8 This commit was generated by cvs2svn to compensate for changes in r168616,
which included commits to RCS files with non-trunk default branches.
2007-04-11 11:09:18 +00:00