Commit Graph

546 Commits

Author SHA1 Message Date
cbiere b70ba117e6 * Added missing cast in isonum_712().
* Added const-qualifiers.
 * Removed unnecessary duplicate prototypes.
 * Use the endian conversion functions from <sys/endian.h>.
2007-01-27 07:20:31 +00:00
cbiere 0108d79ceb Use the endian conversion functions from sys/endian.h. 2007-01-27 07:18:10 +00:00
pooka 0eaa3c5c67 We don't handle fsync in checkop anymore, so direct the fifoop fsync
also to a place less panicy, namely fifo_fsync (because currently the
metadata information is update when the node is changed.  This will
probably change soon, though).
2007-01-26 23:25:56 +00:00
pooka d2595d03c5 Initial attempt at suspend/snapshot support for userspace file
servers.  This is still pretty much on the level "if it breaks ...".
It should work for single-threaded servers which handle one operation
from start to finish in one go.  Also, it does not yet totally
correctly synchronize metadata and data in some cases.  So needless
to say, it needs improvement, but it is possible that will have to
wait for some lock revampage.
2007-01-26 22:59:49 +00:00
pooka 61ffb7330d if strategy fails, set bp->b_error and B_ERROR 2007-01-25 23:43:57 +00:00
pooka 2dcf5f359a don't hold spinlocks (except vnode interlock) when doing vget() 2007-01-25 17:43:56 +00:00
pooka 7fa4b7d96a fix comment (no functional change) 2007-01-23 18:27:50 +00:00
reinoud be6d76ac92 Fix typo
-                * assoicated with this mount point, start over.
+                * associated with this mount point, start over.
2007-01-22 16:07:33 +00:00
pooka 2874c0e4be optimize a bit: don't flush pages for vnodes which have no references
in the kernel or links in the backend
2007-01-21 16:29:31 +00:00
pooka 092746dfb6 remove diagnostic printf 2007-01-21 14:52:20 +00:00
christos 6b98a17401 - If the filesystem lives on a wedge, then we try to get wedge information
since DIOCGPART is going to fail. Unfortunately there is no way to get the
  geometry information we need from the wedge; it would be nice for wedges
  to support a geometry ioctl. The values we cannot retrieve are marked with
  XXX.
- Add a lot more debugging.
2007-01-20 23:34:09 +00:00
christos 226df6aaef only change atime on access. 2007-01-19 20:10:36 +00:00
pooka 7f8363fa95 hannken noted that the latest gcc (?) complains about uninitialized
variable use in puffs_strategy() for "dowritefaf" (incorrectly)
and "error" (correctly, although the function is practically of
type void)
2007-01-19 17:52:01 +00:00
pooka b2a7b240df In case the fs server is in the kernel doing an operation on a
completely different file system, we still might re-enter the same
puffs fs in case we execute something on the other file system,
which wants to get a new vnode and ends up recycling a puffs vnode
for the purpose.  In this case the fs server will sleep in the
kernel until it itself handles the operation .... which of course
is a slightly unlikely event.

After analyzing the path from getcleanvnode() to the vnode cemetary,
identify that fsync and putpages (strategy) are the ones in danger
of striking a deadlock deal.  Abuse the vnode flag VXLOCK to tell
them "this vnode is irreversably going to meet its maker, don't
care about user server return values" (failure is not acceptable
down the vgonel() path) and issue the respective operations as
Fire-And-Forget (FAF) operations.  no wait -> no deadlock.

This of course is a "fix" skating on thin ice.  A better, more
generic solution is already in sight, but will take more effort to
implement.
2007-01-19 14:59:50 +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
pooka 2a1cb9e956 debug print requests going into the queue 2007-01-19 13:01:15 +00:00
reinoud a6abe0260b Fix important directory lookup bug that could result in an endless loop. It
fixes the case where a directory lookup is done in a directory has never
been visted/listed; the search optimalisation that searches the directory
from where it left behind the last time would never reach the initial
offset of zero since it would always have at least processed one entry.
2007-01-17 13:02:44 +00:00
reinoud 3c9b632bb2 Use the generic clock_ymdhms_to_secs() instead of home-brewn version to
translate UDF timestamps to timespec.
2007-01-17 12:49:01 +00:00
pooka fb784fec83 g/c revoke msg structure 2007-01-16 22:38:19 +00:00
pooka acd0be5c12 * don't wait for the answer of VOP_RECLAIM, just fire-and-forget
* revoke puffs_revoke.  we can deal with it just by calling genfs_revoke
2007-01-16 21:58:49 +00:00
pooka 84906bc20f Store puffs_node's on lists hashed with the cookie value instead
of just one flat list.
2007-01-15 23:29:08 +00:00
pooka a18a275954 * do not accept the directory cookie as the result of a lookup (otherwise
we'd be locking against ourselves)
* do not accept duplicate cookies when creating new nodes
2007-01-15 20:40:29 +00:00
pooka 5b381d2cab Since fsync is really putpages + fsync, check for both separately
instead of using just putpages to decide the op's faith.

And the real beef in this commit is of course a tyop fix in a comment.
2007-01-11 16:08:58 +00:00
pooka a96ba7013e In vfs_sync(), call VOP_PUTPAGES() for dirty vnodes directly instead
of rolling around VOP_FSYNC().  The user server will be given the
VFS_SYNC instruction and it can do its own equivalent of VOP_FSYNC()
if it pleases, no need for the kernel to explicitly issue #{vnodes}
FSYNCs.
2007-01-09 23:10:23 +00:00
pooka 5959243a1b comment out flushmulti for now, it's not done and kdump will complain
as mjf noted
2007-01-09 21:59:05 +00:00
pooka 8d142a9d0c Introduce flush operations, which the fs server can use to control
kernel caching.  Currently supported are only flushing the name
cache for a directory or flushing the name cache for the entire fs.

Also, get rid of PNODE_INACTIVE status, since it was racy and
essentially didn't work.  All this on top of being useless in the
first place ....
2007-01-09 18:14:31 +00:00
pooka a0fc370456 in vfs_sync flush page cache only for vnodes with dirty pages, not for
vnodes with pages (dirty or otherwise)
2007-01-09 18:01:05 +00:00
pooka 7ed9318946 vfs sync, flushes regular file data only (user server can take care of
flushing any metadata it might have hidden away)
2007-01-07 19:28:48 +00:00
pooka 8456438f43 getcwd wants eofflag - set eofflag in readdir if amount of data is 0 2007-01-07 00:53:13 +00:00
elad 1e70d64818 Consistent usage of KAUTH_GENERIC_ISSUSER. 2007-01-04 16:55:29 +00:00
elad faad322a82 Consistent usage of KAUTH_GENERIC_ISSUSER. 2007-01-04 15:42:37 +00:00
reinoud f77d911f26 Forgot one place for UDF_ICB_FILETYPE_RANDOMACCESS. 2007-01-04 04:18:00 +00:00
reinoud 1d48d18121 Add UDF_ICB_FILETYPE_REALTIME type as found on UDF 2.50 discs. Also revert
a multiplication order to enforce 64 bit math.
2007-01-04 04:15:43 +00:00
reinoud 636b044677 Fix compilation issue when specifying different flags or compiling with a
different compiler. Thanks to Jared for noting.
2007-01-04 02:42:19 +00:00
reinoud e54e795b0d Implement read-only access to UDF 2.50 and UDF 2.60 discs that use metadata
partition mappings. This brings the NetBSD implementation to read all discs
upto date and will read all discs currently defined by OSTA.
2007-01-04 02:02:40 +00:00
pooka b613212772 * check userspace version and prevent incompatible mount
* some general maintenance
2007-01-02 15:51:21 +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
pooka 4f931d80b2 * fix locking gotchas when trying to unlink "."
* return standard EPERM when trying to unlink a directory
* reorder some checks in rmdir avoid problems if trying to rmdir ".."

jmmv ok
2007-01-02 11:02:19 +00:00
pooka 4040720335 In rename, tdvp == tvp holds if we are renaming a directory to "."
(XXX: for all the sense that makes).  Deal with it gracefully here
for now.
2007-01-02 00:14:15 +00:00
pooka ab88ea8145 remove r/o mount check done also in vfs lookup() 2007-01-01 23:07:36 +00:00
pooka b4b651b5e3 async update node metadata for spec- and fifoops 2007-01-01 20:16:36 +00:00
pooka 76ac7d114d properly handle VOP_REMOVE case where vp == dvp 2007-01-01 20:14:36 +00:00
pooka 06ebafad63 explicitly disable ioctl and fcntl for now - support has bitrotted 2007-01-01 14:41:21 +00:00
pooka 7983048ec7 * use PUFFS_KFLAG_NOCACHE to also signal that we don't want the namecache
* enter files into the namecache immediately when new nodes are created
  (if it's a caching mount, of course)
2006-12-30 01:29:03 +00:00
elad a220cee1c3 Remove support for immutable and append-only flags on ptyfs. 2006-12-29 18:05:17 +00:00
pooka 99c833023e rename the kernel-provided componentname to puffs_kcn; libpuffs now
provides puffs_cn built on top of it
2006-12-29 15:38:37 +00:00
pooka 73f96ea2e7 Don't allow calls to be queued while MOUNTING. We don't make any
kernel->server calls at that time and it allows a window where
operations use an incorrect root node cookie.

XXX: there's still a (very much smaller and biglock safe) race, but
that's going to be solved by some more thorough restructuring
2006-12-29 01:37:11 +00:00
wiz 3ed1aa9185 Spell "separate" correctly. From Zafer Aydogan. 2006-12-25 18:39:47 +00:00
wiz 19c7b24184 Spell "schedule" correctly. From Zafer Aydogan. 2006-12-25 18:36:05 +00:00
wiz cc67b3a29f Spell "algorithm" correctly. From Zafer Aydogan. 2006-12-25 18:32:16 +00:00