Commit Graph

1380 Commits

Author SHA1 Message Date
pooka 835b0326c5 Using POOL_INIT here makes no sense, since file systems always have
an init method.  So get rid of it and #ifdef _LKM and just always
init in the init method.  Give malloc types the same treatment.
Makes file systems nicer to work with in linksetless environments
and fixes a few LKM discrepancies.
2007-06-30 09:37:53 +00:00
pooka e01e324216 remove redundant KASSERTs 2007-06-29 15:34:59 +00:00
hannken bed04c995a If a quota-enabled file system has 65536 active vnodes for one uid
the reference counter of the corresponding struct dquot will overflow.

Change the type of the reference counter from u_int16_t to u_int32_t and
add an assertion to check for overflow.

Observed and tested by Edgar Fuß.

Welcome to 4.99.21 (struct dquot and therefore struct inode changed layout)
2007-06-23 14:56:09 +00:00
yamt 7225d589de remove a duplicated definition of FFS_ITIMES. 2007-06-07 05:34:48 +00:00
yamt da51d139a4 improve post-ubc file overwrite performance in common cases.
ie. when it's safe, actually overwrite blocks rather than doing
read-modify-write.

also fixes PR/33152 and PR/36303.
2007-06-05 12:31:30 +00:00
tsutsui cd07663368 Fix inconsistent changes in rev 1.153 and 1.154:
Adjust fs->fs_maxfilesize instead of ump->um_maxfilesize
in ffs_oldfscompat_read() because the latter is overrided
by the former after ffs_oldfscompat_read() returned.

Fixes EFBIG errors on read(2) and "exec /sbin/init: error 8"
problem on mac68k after mountroot() on old 4.3BSD UFS created
by the Mkfs tool for MacOS (reported and confirmed on port-mac68k).
2007-05-29 11:30:17 +00:00
ad 1ae6657a7b Fix lock order inversion between vnode locks and ufs_hashlock. Addresses
kern/36331 (MP deadlock between ufs_ihashget() and VOP_LOOKUP()) for ffs,
other file systems to follow. Reported by perseant@, debugged by Sverre
Froyen, patch posted/tested by Blair Sadewitz.
2007-05-28 23:42:56 +00:00
hannken 64b7e5637e Fstrans_start() always returns zero, so change its type to void. 2007-05-17 07:26:21 +00:00
perseant 9234ba6fd8 Change references to SEGM_W_DIROPS to SEGM_CKP, and replace the logic that
formerly used SEGM_W_DIROPS in lfs_segwrite() appropriately.  This prevents
a problem in which processes could get stuck in "buffers" sleep forever.
2007-05-16 19:11:37 +00:00
tnn 4407197569 Add missing underscore to wchan name. 2007-05-15 14:35:29 +00:00
yamt d4bb61958b flush_inodedep_deps: fix access after free. PR/29724. 2007-05-07 11:13:01 +00:00
perseant 6a87e08daa Get rid of our own private copy of genfs_putpages, having adapted the real
genfs_putpages to suit our purposes.
2007-04-24 22:47:56 +00:00
yamt 337d052ee1 hold proclist_mutex when calling psignal(). 2007-04-19 11:05:14 +00:00
perseant 0549fd6148 Add/change a couple of comments about locking restrictions. 2007-04-18 00:50:06 +00:00
perseant 0d8a7af5d6 Remember to write dirops when the vnode we are trying to flush is a dirop. 2007-04-18 00:49:33 +00:00
perseant 72507061e4 Fix another locking protocol error in lfs_fsync(). 2007-04-17 20:30:28 +00:00
perseant 43d50ff956 Fix MP locking protocol violations introduced in my previous commit. 2007-04-17 06:49:40 +00:00
perseant 9be0ebd9da Install a new sysctl, vfs.lfs.ignore_lazy_sync, which causes LFS to ignore
the "smooth" syncer, as if vfs.sync.*delay = 0, but only for LFS.  The
default is "on", i.e., ignore lazy sync.

Reduce the amount of polling/busy-waiting done by lfs_putpages().  To
accomplish this, copied genfs_putpages() and modified it to indicate which
page it was that caused it to return with EDEADLK.  fsync()/fdatasync()
should no longer ever fail with EAGAIN, and should not consume huge
quantities of cpu.

Also, try to make dirops less likely to be written as the result of a
VOP_PUTPAGES(), while ensuring that they are written regularly.
2007-04-17 01:16:46 +00:00
pooka bc8224a1b3 fix comment: struct fid is in fstypes.h now 2007-04-09 12:21:24 +00:00
hannken fc6776f366 Remove now obsolete vn_start_write() and vn_finished_write() and
corresponding flags.

Revert softdep_trackbufs() to its state before vn_start_write() was added.

Remove from struct mount now unneeded flags IMNT_SUSPEND* and
members mnt_writeopcountupper, mnt_writeopcountlower and mnt_leaf.

Welcome to 4.99.17
2007-04-08 11:20:42 +00:00
hannken 11601689e7 Remove calls to now obsolete vn_start_write() and vn_finished_write(). 2007-04-07 14:21:52 +00:00
perseant b196644e3b correct comment for lfs_putpages 2007-04-05 17:44:18 +00:00
ad 4b1d78c00e Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
2007-03-13 02:11:28 +00:00
ad 59d979c5f1 Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
2007-03-12 18:18:22 +00:00
christos 53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
ad b89010bfa3 Destroy the hash locks on final unmount. 2007-02-27 16:11:51 +00:00
perseant d1d9b558a7 Reverse the order of searching the vnode list in lfs_writevnodes(). This
should speed up e.g. "chown -R" on LFS filesystems; e.g. it shows a 100%
increase in the 'seq_stat' column of bonnie++.
2007-02-23 23:16:03 +00:00
thorpej b3667ada6d TRUE -> true, FALSE -> false 2007-02-22 06:05:00 +00:00
thorpej 712239e366 Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 22:59:35 +00:00
pooka 5b38c61dd4 tyop in comment, fix it 2007-02-20 18:03:03 +00:00
pooka 7016942297 In readdir, in case cookies was already allocated but is later free'd
due to an error, reset value of cookies to NULL to avoid confusing
callers.

should fix kern/35728
2007-02-20 16:45:58 +00:00
ad adbb9ec2fa Call genfs_node_destroy() where appropriate. 2007-02-20 16:21:03 +00:00
ad d266042a07 Release ufs_hashlock before calling ungetnewvnode(). 2007-02-18 14:26:52 +00:00
pavel 934634a18c Change the process/lwp flags seen by userland via sysctl back to the
P_*/L_* naming convention, and rename the in-kernel flags to avoid
conflict. (P_ -> PK_, L_ -> LW_ ). Add back the (now unused) LSDEAD
constant.

Restores source compatibility with pre-newlock2 tools like ps or top.

Reviewed by Andrew Doran.
2007-02-17 22:31:36 +00:00
hannken 198beb0314 Make fstrans(9) the default helper for file system suspension.
Replaces the now obsolete vn_start_write()/vn_finished_write().
2007-02-16 17:23:53 +00:00
ad 93a5fa21eb Destroy the fraglock on unmount. 2007-02-15 17:47:56 +00:00
ad 9abeea588a Replace some uses of lockmgr() / simplelocks. 2007-02-15 15:40:50 +00:00
ad b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
elad 2ddc81b57b Add missing ')'. Noted by Paul Goyette. 2007-02-07 05:54:42 +00:00
bouyer 0ce1424e8f in ufs_dirremove swap ep->d_reclen before use if needed (affect UFS_DIRHASH
only).
While there remove an unneeded swap before compare against 0 in ufs_direnter().
Both pointed out by Pawel Jakub Dawidek on tech-kern@, thanks !
2007-02-06 20:49:20 +00:00
hannken 4d607243ba Change fstrans enum types to upper case.
No functional change.

From Antti Kantee <pooka@netbsd.org>
2007-01-29 15:42:50 +00:00
hubertf eda05c6413 Remove more duplicate headers.
Patch by Slava Semushin <slava.semushin@gmail.com>

Again, this was tested by comparing obj files from a pristine and a patched
source tree against an i386/ALL kernel, and also for src/sbin/fsck_ffs,
src/sbin/fsdb and src/usr.sbin/makefs. Only changes in assert() line numbers
were detected in 'objdump -d' output.
2007-01-29 01:52:43 +00:00
hannken 1b9c6382e3 New file system suspension API to replace vn_start_write and vn_finished_write.
The suspension helpers are now put into file system specific operations.
This means every file system not supporting these helpers cannot be suspended
and therefore snapshots are no longer possible.

Implemented for file systems of type ffs.

The new API is enabled on a kernel option NEWVNGATE.  This option is
not enabled by default in any kernel config.

Presented and discussed on tech-kern with much input from
Bill Studenmund <wrstuden@netbsd.org> and YAMAMOTO Takashi <yamt@netbsd.org>.

Welcome to 4.99.9 (new vfs op vfs_suspendctl).
2007-01-19 14:49:08 +00:00
isaki be241a0e51 Correct indent. 2007-01-07 09:33:18 +00:00
elad 1e70d64818 Consistent usage of KAUTH_GENERIC_ISSUSER. 2007-01-04 16:55:29 +00:00
perseant df25fd6968 Change VONWORKLST handling to better match its other uses; in particular,
check memq and clear VWRITEMAPDIRTY at the same time.
2007-01-03 02:42:23 +00:00
elad d4e1860d1a Add KAUTH_SYSTEM_CHSYSFLAGS so we can get rid of the last three
securelevel references (ufs, ext2fs, tmpfs).

Intentionally undocumented.
2007-01-02 11:18:56 +00:00
yamt 90b1120ae3 ufs_readdir: start from offsets known to be valid,
rather than assuming users feed us valid offsets.
2006-12-26 14:50:08 +00:00
yamt 8bf7662829 merge yamt-splraiseipl branch.
- finish implementing splraiseipl (and makeiplcookie).
	  http://mail-index.NetBSD.org/tech-kern/2006/07/01/0000.html
	- complete workqueue(9) and fix its ipl problem, which is reported
	  to cause audio skipping.
	- fix netbt (at least compilation problems) for some ports.
	- fix PR/33218.
2006-12-21 15:55:21 +00:00
chs 975004d9f1 several ext2fs fixes provided by Barry Bouwsma:
- set ip->i_e2fs_dtime to time_second, not time_uptime.
 - don't allow ipref to go negative
 - fs->e2fs.e2fs_icount is a valid inode number, allow it.
2006-12-09 22:07:48 +00:00