Commit Graph

728 Commits

Author SHA1 Message Date
pooka 947c4b9f60 Allow to set non-blocking mode for transport fd even if the file
system is not yet mounted.
2007-04-16 14:09:00 +00:00
pooka f2cea5c791 Sanity-check & possibly adjust number of hash buckets already before
returning the mount argument structure to userspace.
2007-04-16 13:54:07 +00:00
pooka 96fd5059d7 catch invalid size file handles already in the kernel 2007-04-16 13:24:35 +00:00
pooka 4ccbce8168 Give the file server the ability to specify the file handle length
instead of defining a static length file handle on the framework-level.
2007-04-16 13:03:26 +00:00
chs aba740b225 define a pager flag PGO_RECLAIM, similar to FSYNC_RECLAIM, and use it
to skip unnecessary flushing when layered file system vnodes are recycled.
this also prevents a deadlock with the dodgy LFS putpages routine.
fixes the non-LFS part of PR 36150.
2007-04-16 05:14:54 +00:00
xtraeme 8d9be19250 size_t is unsigned, so use zu rather than zd which is for ssize_t,
as Matt Thomas pointed out.
2007-04-14 16:52:22 +00:00
xtraeme 6465fceffd Use zd to printf size_t. 2007-04-14 16:13:18 +00:00
pooka 0c3748498f Allow file servers to request the number of hash cookie buckets for
pnode -> vnode reverse lookup.
2007-04-13 15:25:35 +00:00
pooka 4e4ce72bb3 * add fhlen to kernel argument structure
* rename it to puffs_kargs instead of puffs_args
2007-04-13 13:31:11 +00:00
reinoud 1adc8479ba Some rogue implementations use random physical partion numbers just to
break other implementations so lookup the physical number instead of
indexing it. Choosing random numbers here is legal according to the specs,
but not a logical choice and most likely done as a wierd kind of copy
protection.

Rogue implementation found to use this
	*Microsoft CDIMAGE UDF
2007-04-12 01:56:36 +00:00
pooka f50d2a26f2 * support VFS_FHTOVP and VFS_VPTOFH
* support cookies in for VOP_READDIR

nfs exporting puffs file systems works now
2007-04-11 21:03:05 +00:00
pooka c634885e0f make overspammy debug printf less overspammy 2007-04-11 09:43:19 +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 e956461048 Remove calls to now obsolete vn_start_write() and vn_finished_write(). 2007-04-07 15:06:53 +00:00
pooka 43c6ec1a06 support flushing pagecache 2007-04-06 17:48:44 +00:00
pooka 13fa815486 actually, we don't need a separate op for flushing the whole page cache
of a node, just use the range op with endoff = 0
2007-04-06 17:05:34 +00:00
pooka bd8d0a2ae0 * enable PUFFS_INVAL_PAGECACHE_NODE_RANGE
* add input parameter validation
2007-04-06 16:37:02 +00:00
pooka 3651f3e73b Fix one more bug from today's commit: don't remove the op for which
getops runs out of file server buffer space from the request queue.
Otherwise that operation silently vanishes and things go, well, quite
wrong.
2007-04-04 21:02:30 +00:00
pooka a0d5166093 fix two loop mutex botches in previous 2007-04-04 20:22:47 +00:00
pooka fa71b0706d Make it possible to interrupt waiters for fs operation completion
again.  This is useful until locking is further developed and basically
any deadlocks can be solved by killing appropriate processes.

Thanks especially to Tommi Kyntola and Antti Louko for sitting down
with me and discussing resource ownership and locking strategies
in implementing this.
2007-04-04 16:13:51 +00:00
pooka ad018126a3 s/ppark/park/ to make all the variable names consistent - park is
always a pointer now.  no functional change
2007-04-04 15:50:56 +00:00
rmind 523c1fc3e1 filecore_mountfs: Remove the dead code - fcmp cannot be non-zero here.
CID: 714
2007-04-04 02:00:58 +00:00
pooka 9cc76110cd In sync, skip vnodes which have a null v_data pointer. This is a
workaround for the problem analyzed more deeply in kern/30831.  In
short, the problem is keeping the vnode on the mount point vnode
list during reclaim.  If reclaim happens to sleep (as is a possibility
with smbfs due to calling vrele() and therefore possibly VOP_INACTIVE),
code going through the entire mountpoint vnode list will hit
half-reclaimed vnodes.
2007-04-03 14:18:19 +00:00
pooka de976b706d g/c some commented ltsleep calls accidentally left from newlock2 adaptation 2007-03-30 18:25:02 +00:00
pooka 115fa924ee * abstract ASYNCBIOREAD and let callers freely issue a callback called
from putop.  even though there's only one user currently, makes code
  more readable
* move "delta" to a standard parameter in vntouser and get rid of the
  specialcase vntouser_delta
2007-03-30 17:48:57 +00:00
pooka 78762a532d in userdead assign waiter return value only if there is a waiter for
a particular request
2007-03-29 22:11:43 +00:00
pooka 6ce49d93c1 convert to MALLOC_JUSTDEFINE 2007-03-29 16:30:07 +00:00
pooka 78693816f2 Convert spinlocks & sleep/wakeup to newlock2 locking stuff. Fix a
bunch of bugs.

* park structures are now always allocated from a pool instead of a
  mixed stack/malloc allocation
* get rid of the whole adjbuf concept, always just alloc the maximal
  amount of memory to satisfy a request
* little regression: don't allow interrupting wait from file system
  to userspace; this had problems already before, but now the problems
  really started to shine through.  I'll try to make this work again
  some day.
* fix bmap to return a sensible value in runp
2007-03-29 16:04:26 +00:00
dillo 41627b2c38 Add support for HFS Wrapper (HFS+ volume inside an HFS volume).
Remove offset argument, we should now find an HFS+ volume in any
of its standard places.

Based on work from and test image provided by Pelle Johansson.
2007-03-22 13:21:28 +00:00
dillo 30f474b9e1 Add support for HFS Wrapper (HFS+ volume inside an HFS volume).
Remove offset argument, we should now find an HFS+ volume in any
of its standard places.
2007-03-22 13:21:27 +00:00
dillo 081267c306 Add a few. 2007-03-22 13:20:13 +00:00
pooka 2bddbed0e0 export puffs version of namei ISLASTCN macro to userspace 2007-03-20 18:28:49 +00:00
tsutsui c55df5782d Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
2007-03-20 11:27:48 +00:00
pooka 8d9c021816 * rework the page cache interaction a bit: cache metadata in the
kernel and flush it out all at once instead of continuous updating
* add support for delivering notifications to the file server about
  when a page was written to (but disabled by default for now).  the
  file server can use this to request flushing or invalidating the
  kernel page cache
2007-03-20 10:21:58 +00:00
dillo 0fb2977031 args.path is in UIO_USERSPACE too.
Fixes statvfs on macppc and PR kern/36012.
Thanks to Magnus Henoch for testing.
2007-03-19 09:16:22 +00:00
pooka 040eb2fb48 Support B_READ|B_ASYNC in strategy by calling biodone() directly
when the file server puts the result.
2007-03-14 12:13:58 +00:00
ad 297c1212be Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
2007-03-13 14:16:07 +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 86ed875648 Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
2007-03-13 01:34:21 +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
dillo e100c48afd Fix PR kern/35953 by mange at freemail dot hu (panic on mount):
(hfslib_open_volume) We are only interested in the catalgo and
extents header, so read the first 512 bytes, not the whole first
extent.  Also makes mounting a lot faster.
2007-03-09 22:14:09 +00:00
dillo d0c955805c Remove hfsp directories, they have been reimported as hfs. 2007-03-06 11:31:21 +00:00
dillo 56c3e41252 Complete rename of hfsp to hfs, requested by thorpej. 2007-03-06 11:28:44 +00:00
dillo 25e99827c3 Rename files from hfsp to hfs. 2007-03-06 00:22:04 +00:00
dillo d3fee42230 Temporarily readd, until rename is complete -- renaming the directory
is not enough.

(I need sleep, will clean this up tomorrow.  Sorry for the mess.)
2007-03-06 00:15:50 +00:00
dillo 601515c0d6 Renamed to HFS. 2007-03-06 00:11:38 +00:00
dillo 4f1d6e612e nitial import of (experimental read-only) implementation of Apple
HFS+ file system.

Originally developed for Google Summer of Code 2005 by Yevgeny Binder,
updated and enhanced by me.
2007-03-06 00:10:34 +00:00
dillo 9274a5c0f1 Integrate apmlabel and HFS+ file system. 2007-03-05 23:18:01 +00:00
dillo 9cf283f2a5 Initial import of (experimental read-only) implementation of Apple
HFS+ file system.

Originally developed for Google Summer of Code 2005 by Yevgeny Binder,
updated and enhanced by me.
2007-03-05 23:01:06 +00:00
jnemeth 5e186a4bae yet more caddr_t -> void * fallout 2007-03-04 21:36:38 +00:00
jnemeth 8b8caa1a52 more caddr_t -> void * fallout 2007-03-04 21:18:08 +00:00
yamt 731acd91f9 fix fallout from caddr_t changes. 2007-03-04 15:41:02 +00:00
yamt 7f8abc50b4 fix fallout from caddr_t changes. 2007-03-04 14:53:09 +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
pooka 81bb031653 Make wait for the user file server PCATCHable. This makes it
possible to recover the system by just killing processes in case
a file server manages to recurse into itself either by fault of
file server implementation or by pilot error.  The downside is that
the code is extremely hard to follow and practically screams out
for newlock2 (in addition to screaming "bug here").  The whole
PCATCH nonsense and induced megacomplexity can hopefully be avoided
in the future by tweaking other parts of the implementation.
2007-02-27 23:43:23 +00:00
ad b89010bfa3 Destroy the hash locks on final unmount. 2007-02-27 16:11:51 +00:00
drochner 33ac0de1eb -add __unused declarations to make it possible to use only half of it
-fix a bitmask (harmless) and remove two unnecessary ones
We should find a better location for that code!
2007-02-26 12:33:08 +00:00
thorpej 4f3d5a9cc0 TRUE -> true, FALSE -> false 2007-02-22 06:34:42 +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 8f09e1c196 Properly fix rev 1.44: limit error values from the file server to
positive values of errno and 0.  Otherwise it can return internal values
such as EJUSTRETURN and screw things up.

thanks to Bill for reminding me to revisit this
2007-02-20 19:45:37 +00:00
ad adbb9ec2fa Call genfs_node_destroy() where appropriate. 2007-02-20 16:21:03 +00:00
kochi 2794f98855 fix the problem reported in kern/35457, "cant mount msdosfs on floppy".
Since 1.40, which introduced support for non-DEV_BSIZE media,
mounting msdos floppy returned ENOTTY.

This is because floppy driver does not support DIOCGPART or DIOCWEDGEINFO
ioctl.

Those ioctls should not be a requirement for mounting msdosfs.

This patch is made by Christian Biere.
2007-02-17 18:39:15 +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
pooka ddd5ed5765 Check against root node cookie when fetching a new vnode and invoke
VFS_ROOT() if the cookies match.  Without this fix, if the root
vnode was reclaimed, doing lookups for dotdot from the root vnode
was possible.  In practice this occured only through getcwd.
2007-02-16 16:37:55 +00:00
pooka cd12688f17 Sanity-check linklen returned from file server in READLINK. 2007-02-15 19:50:54 +00:00
ad f918a311cb Fix error in previous. 2007-02-15 16:18:23 +00:00
ad 9abeea588a Replace some uses of lockmgr() / simplelocks. 2007-02-15 15:40:50 +00:00
pooka c1b906f44a Hide the debug prints behind PUFFSDEBUG instead of DEBUG. Make the
latter define the former.
2007-02-15 12:14:34 +00:00
pooka cd66766e1a * in write, do sync pageflush for the ubc case every 64k, otherwise
the user file server can't really keep up and just writing and writing
  may result in kernel memory exhaustion.  this lossage is also partially
  due to the stupid way mtime + size info is handled currently, but that
  should change soon (*knock knock* ;)
* score a few debug printfs
2007-02-10 13:12:43 +00:00
ad b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
pooka b2668f252f honor B_ASYNC 2007-02-09 08:53:51 +00:00
pooka 95700e9a12 assign value for strategy output parameter b_resid instead of decreasing it 2007-02-09 08:15:41 +00:00
pooka 692448474d If the file server doesn't support write, don't use genfs_null_putpages
for putpages, as it assumes a vnode doesn't have any pages.  For
mounts using the page cache this is simply not true.  Rather,
prevent opening a regular file in write-mode.  That way a vnode
can never have dirty pages which would need to be flushed (i.e.
written).
2007-02-08 22:55:06 +00:00
pooka 82b88def96 chuq shone arcane wisdom on me: b_bcount comes in, b_resid goes out 2007-02-08 05:09:25 +00:00
pooka b7a2d4ecbb Don't block and wait for file server response in case strategy is
run in pagedaemon context: it gives the file server way more control
over the fate of the entire kernel than what we're comfortable with.
2007-02-08 04:52:23 +00:00
pooka ebfeab6747 Limit errors from puffs_lookup to 0, EJUSTRETURN and ENOENT, as
that's what namei/lookup expects.
2007-02-06 01:53:11 +00:00
chs 0507747213 more fixes for the new vnode locking scheme:
- don't use SAVESTART in calls to relookup() from unionfs,
   just vref() the desired vnode when we need to.
 - fix locking and refcounting in the unionfs EEXIST error cases.
 - release any vnode locks before calling VFS_ROOT(), vfs_busy() is enough.
   this allows us to simplify union_root() and fix PR 3006.
 - union_lock() doesn't handle shared lock requests correctly,
   so convert them to exclusive instead.  fixes PR 34775.
 - in relookup(), avoid reusing "dp" for different purposes,
   the error handling wasn't right.  (actually just get rid of dp.)
   also, change relookup() to ignore LOCKLEAF and always return the
   vnode locked since the callers already expect this.
2007-02-04 15:03:20 +00:00
pooka 3f280a11a4 fstrans owner automatically gets a normal lock, don't need to lazy lock
pointed out by hannken
2007-02-03 16:29:05 +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
pooka 842f8f2a8a don't need pi_lock for struct member access, so don't take it 2007-01-28 00:27:33 +00:00
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
pooka 349f1154dd Don't return EWOULDBLOCK in case we have delivered some requests
even if we are operating on a nonblocking descriptor.
2006-12-10 23:53:51 +00:00
pooka 411590432c * free puffs_instance structure in all cases when closing the descriptor
* comment, rcsid & kassert police
2006-12-10 23:43:55 +00:00
pooka 5d1ddd3277 PCATCH in tsleep while waiting for operations in getop. Otherwise
we could end up in an unkillable deadlock if GETOP was called when
an operation that had locked the root vnode was already in userspace.
2006-12-10 22:37:04 +00:00
pooka 84295069e0 Fix a race condition that would cause the mountpoint to be cleaned
from under someone waiting for the fs server response in puffs_unmount()
if the descriptor was closed during the response wait (such as bug
leading to a crash in fs implementation unmount()).
2006-12-10 22:33:31 +00:00
chs c398ae9734 a smorgasbord of improvements to vnode locking and path lookup:
- LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
   these now always return the parent vnode locked.  namei() works as before.
   lookup() and various other paths no longer acquire vnode locks in the
   wrong order via vrele().  fixes PR 32535.
   as a nice side effect, path lookup is also up to 25% faster.
 - the above allows us to get rid of PDIRUNLOCK.
 - also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
 - remove an assumption in layer_node_find() that all file systems implement
   a recursive VOP_LOCK() (unionfs doesn't).
 - require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
   fill in eopnotsupp() for file systems that don't support being exported
   and remove the checks for NULL.  (layerfs calls these without checking.)
 - in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
   adjust which vnode is locked.  fixes PR 33374.
 - apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().
2006-12-09 16:11:50 +00:00
enami 7edaf87909 The function wget() is always responsible to maintain length of component
not yet compared.  Otherwise pathname lookup fails on certain condition.
2006-12-08 22:04:56 +00:00
pooka 2911d34706 In case of an error, return an error. Otherwise the worst case was
that dostatvfs() wrote to a recently deceased struct mount.
2006-12-07 22:06:02 +00:00
pooka 251d9ef9df let implementation ultimately decide if mmap is supported - pass
VOP_MMAP to fs server
2006-12-07 16:58:39 +00:00
pooka 997d4f41fa shuffle functions around a bit: move the transport (/dev/puffs) to
a different file from the messaging (request contents).  no functional
change
2006-12-05 23:41:24 +00:00
pooka a966070d38 adjust file size in write only if file grows. but since this change is
in the "never use ubc" branch, I don't think it matters except for cosmetics.
2006-12-05 23:07:42 +00:00
pooka 0435bcee31 Allow multiple requests to be transferred in each GET/PUTOP. For
a single request, the performance is still the same.
2006-12-05 23:03:28 +00:00
pooka ca5da47950 prefix kernel flags with PUFFS_KFLAG to have a separate namespace
from the library flags
2006-12-01 12:48:31 +00:00
pooka 74baaf5c7d don't call the fs server for all operations, only those it has told
us that it implements
2006-12-01 12:37:41 +00:00
christos 8c4a6d7ec4 PR/35151: Christian Groessler: file size reported incorrectly for files > 2GB
on a FAT32 file system on a 64bit host
2006-11-30 15:59:23 +00:00
pooka 898c6532b4 don't allow mmap if operating uncached 2006-11-28 13:20:03 +00:00
christos 9f1ff68ee1 fix missing initializer 2006-11-25 17:43:58 +00:00
scw 4f0ca2726e Support FAT filesystems on non-DEV_BSIZE media.
Based on the patches provided in PR kern/17398 by Trevin Beattie.
2006-11-25 12:17:30 +00:00
pooka 99eb16cb3c if we are going to bail due to the mountpoint being gone from under
us while waiting for syncer lock, release the newly acquired syncer
lock prior to bailing
2006-11-21 01:53:33 +00:00