Commit Graph

682 Commits

Author SHA1 Message Date
dsl 6210687bcf Remove the copyout() of the mount args from puffs_mount(), the buffer
supplied is a kernel address.
The puffs userspace code has been changed to do a 2nd call with
MNT_GETARGS to retrieve the information.
2007-07-14 16:06:53 +00:00
dsl 2721ab6c7b Change the VFS_MOUNT() interface so that the 'data' buffer passed to the
fs code is a kernel buffer, pass though the length of the buffer as well.
Since the length of the userspace buffer isn'it (yet) passed through the mount
system call, add a field to the vfsops structure containing the default length.
Split sys_mount() for calls from compat code.
Ride one of the recent kernel version changes - old fs LKMs will load, but
sys_mount() will reject any attempt to use them.
2007-07-12 19:35:32 +00:00
ad c21083c17f s/pagedaemon_lwp/pagedaemon_proc/ 2007-07-09 21:55:10 +00:00
ad 88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
pooka 4b8065ff1e mntflushbuf() cargo cult comment mania cleanup. there is no mntflushbuf(). 2007-07-09 00:01:42 +00:00
rumble 0bbb4e920d Clamp down tigher on the bound around 'numextents'. Add a few comments
to make it clearer what we're tracking.
2007-07-04 20:20:30 +00:00
rumble 0aef936cbe Additional fixes/enhancements:
1) Comply with the way buffercache(9) is intended to be used. Now we
       read in single blocks of EFS_BB_SIZE, never taking in variable
       length extents with a single bread() call.

    2) Handle symlinks with more than one extent. There's no reason for
       this to ever happen, but it's handled now.

    3) Finally, add a hint to our iteration initialiser so we can start
       from the desired offset, rather than naively looping through from
       the beginning each time. Since we can binary search the correct
       location quickly, this improves large sequential reads by about
       40% with 128MB files. Improvement should increase with file size.
2007-07-04 19:24:09 +00:00
rumble 1798f1d8df Fix a significant performance bug in efs_read:
When reading a file, we would erroneously iterate to the next extent
before having filled the entire uio request. This lead to unnecessary
extent iteration and excessive calls to efs_read.

Sequential read performance has doubled in the uncached case and
quadrupled when data is buffered.
2007-07-04 18:40:18 +00:00
pooka 84684ff767 check for invalid vtype 2007-07-02 21:14:00 +00:00
pooka ea1108ce11 support turning REQUIREDIR off and extra consume in lookup 2007-07-02 18:25:36 +00:00
pooka df6f052d2f Get rid of the "int *refs" parameter to inactive: the same can be
accomplished now with puffs_setbacks.
2007-07-02 10:24:17 +00:00
pooka 25285a0f9c loosen KASSERT: we can also fail due to ENOMEM 2007-07-01 23:30:42 +00:00
pooka d410664985 Give the file server to ability to request the entire pathname buffer
under lookup by using PUFFS_KFLAG_LOOKUP_FULLPNBUF instead just the
current component.
2007-07-01 22:54:16 +00:00
pooka ffe0a01441 Instead of supplying a plain pid, supply an abstract struct puffs_cid *,
which can currently be used to query the pid and lwpid.
2007-07-01 17:22:13 +00:00
pooka 438f52d212 make puffs_cred an opaque type 2007-07-01 15:30:15 +00:00
rumble 1b3d6b0053 Remove a superfluous pasted structure definition, permitting ALL to
build again.

Caught by Hisashi T Fujinaka.
2007-07-01 01:09:05 +00:00
pooka 6b0a9db09f Fix logic flaw in KASSERT. Seems like my lkm wasn't compiled with
DIAGNOSTIC ...
2007-06-30 16:28:14 +00:00
rumble 6bb85b28da Additional documentation on extents and some artificial limitations SGI
has introduced (and changed in backwards-incompatible ways) over the years.
2007-06-30 15:56:16 +00:00
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
rumble 6912898dc8 Add read-only support for SGI's Extent File System.
Reviewed by pooka@.
2007-06-29 23:30:16 +00:00
tsutsui 4a838a2458 Fix mnt_dev_bshift value. Pointed out by rumble@.
I'm not sure how mnt_dev_bshift is used and
whether BFS_BSHIFT is correct for it, but as rumble
said shifting BFS_BSIZE (==512) seems completly wrong.
2007-06-28 12:33:18 +00:00
pooka f055736150 Simplify code, mainly vop_strategy. No functional change 2007-06-26 12:50:49 +00:00
pooka 53a4105885 Actually, keep PUFFS_KFLAG_NOCACHE and -o cache around as shorthand
to neither page- nor namecache.
2007-06-24 22:25:49 +00:00
pooka df01a64b7a Split the NOCACHE option in twain: NOCACHE_NAME & NOCACHE_PAGE. 2007-06-24 22:16:03 +00:00
pooka e601546393 Refactor the pnode2vnode translation slightly so that VFS_ROOT
can use it directly.
2007-06-21 14:54:49 +00:00
pooka 41df8e0fed Reorganize how the root vnode is fetched so that it doesn't always
go through VFS_ROOT() and allow to fetch it without locking it.
This allows us to call the cache flush operations also for the root
vnode and most notably fixes e.g. a "No such file or directory"
for a psshfs root directory ls -l when a file was locally deleted
and remotely re-created.

Also fix some sloppy programming in root node fetch (mostly cosmetic).
2007-06-21 14:11:34 +00:00
pooka f8326bf98e Move puffs to a two clause license where it already isn't so. And
as agc pointed out, even files with the third clause were already
effectively two clause because of a slight bug in the language...
2007-06-06 01:54:59 +00:00
pooka e2819ad1be In very verbose debug mode, print also return values for operations
(well, at least for those that go through checkop()).
2007-06-06 01:33:10 +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
yamt 7e6f80a234 \xa0 -> space. 2007-06-01 15:59:37 +00:00
pooka 68568e7a22 forgot to commit this with puffs_vnops.c 1.72:
Actually, we do need separate "no references in file server" and
"noref + inactive" flags if we wish to correctly support unix open
file semantics and optimize away pre-reclaim cache flushes.  So,
add PNODE_DYING which stands for norefs + inactive.
2007-05-19 16:50:49 +00:00
pooka 121b6fb7b3 Actually, we do need separate "no references in file server" and
"noref + inactive" flags if we wish to correctly support unix open
file semantics and optimize away pre-reclaim cache flushes.  So,
add PNODE_DYING which stands for norefs + inactive.
2007-05-19 16:35:01 +00:00
pooka e99cb62bcc Introduce noref setbacks, which the file server can use to signal
the kernel it has 0 references to the node in question.  In other
words, this can be used to avoid inactive(), or, if the file server
does not implement inactive, prompt reclaim for removed nodes.
2007-05-18 15:46:09 +00:00
pooka 93dd832918 selrecord() before calling userspace to avoid (very theoretical) race
where selinfo contains uninitialized garbage
2007-05-18 14:25:30 +00:00
pooka 9d9f624f97 Support VOP_POLL. This requires some acrobatics on the puffs_node,
as we give a reference to userspace for the puffs_node for the
duration of the poll call.  So reference count puffs_node separately
from the parent vnode.  vref()/vrele() is not possible due to a possible
surprise visit from VOP_INACTIVE.
2007-05-18 13:53:08 +00:00
pooka 339652951e Make it possible for the file server to specify the root vnode type
and other information instead of always using VDIR.  To make this
possible without races, require all root node information already
in puffs_mount() and nuke puffs_start2() and the associated start
operation completely.

requested/inspired by Tobias Nygren
2007-05-17 13:59:22 +00:00
pooka d79dbd3583 In case strategy memory allocation for B_ASYNC|B_READ fails,
make sure to release the buf.
2007-05-15 12:48:48 +00:00
pooka a6b1636499 Adventures in file systems, part (u_quad_t)-1: we can't use the
file system value for the size of device special files, as that
comes from specfs instead of the "host" file system.  Therefore,
take care that getattr doesn't override the value of vp->v_size.
2007-05-08 21:39:03 +00:00
pooka 4537434d57 If the op was interrupted, decrease ops waiting for fetch from the
file server only if the op was still waiting for fetch (as opposed
to waiting for the response).  Also, properly flag the possible
following inactive as an op for which we do not want to wait for
the response from the file server.
2007-05-08 21:16:55 +00:00
pooka 151ee075e9 Introduce puffs "setbacks", which can be used to set certain flags
for nodes upon return from the userspace.  Currently it can be used
to indicate that the file server should be notified of "inactive"
in case the file server has opted to not receive inactive every
time the reference count for a vnode drops to zero.  (inactive is
a common event, almost never requires any action and must be executed
sychronously, so it is wasteful).

While doing this, cleanup the release-relock nonsense from the
vntouser*() arguments.  It was never enabled and the whole LOCKEDVP()
concept was very broken to begin with.
2007-05-07 17:14:54 +00:00
pooka b5aae3d4e3 If setattr is called explicitly, use that as the sign to flush out
all metadata info cached in the kernel while we're setattr'ing in
any case.  Solves problems such as truncate (via extend-by-write)
+ chmod resulting in EPERM because the file was already read-only
when the actual truncate was flushed out of the kernel in fsync.
2007-05-06 19:43:14 +00:00
pooka 6ffefad6ef Fix a problem introduced when I converted puffs to use newlock2:
when unmounting the file system in case of a certain timing (and
possibly some other conditions), a thread would wait on a condition
variable, while another thread broadcast the cv and immediately
proceeded to destroy it.  The result was a system frozen completely
solid shorly after the process waiting for the cv woke up.  So
introduce reference counting to synchronize destruction of the
resources in unmount.

I was able to repeat the problem only on my laptop in some special
cases, so I do not know how common it was.  Ironically, killing
the file server process violently instead of unmount() didn't have
this problem because it never entered the unmount path from two
directions.
2007-05-01 12:18:40 +00:00
msaitoh 8ce1f4fff2 fix typos 2007-04-29 20:23:34 +00:00
pooka b474c785b7 If ubc style write fails, do not extend the file by zero-padding
it.  It might be that the file server is either crashing or just
returning consistent errors.  uiomove() would handle the error,
but if the pages weren't faulted in, memset() to the unfaultable
ubc window would cause a kernel page fault.
2007-04-24 16:29:29 +00:00
pooka c25fa1208b remember to flag park as done when we're done with it 2007-04-24 09:44:57 +00:00
pooka 8689b1a6b2 Now that puffs_park is allocated from the heap and actually freed
by the userdead routine, don't do a TAILQ_FOREACH but rather an
honest for loop.
2007-04-22 21:52:37 +00:00
pooka 6770f9f87e Issue close to the file server asynchronously. We're not interested
in the return value.
2007-04-22 18:50:28 +00:00
pooka bc38632c58 define PUFFS_KFLAG_WTCACHE, which makes the page cache write-through 2007-04-22 18:02:05 +00:00
pooka e4526ed3a0 Take care not to access park->park_preq if the waiter is gone, as
that memory is no longer available.
2007-04-21 10:36:59 +00:00
pooka 1de42023d1 don't mutex_enter() manually, we've already park_reference()d a few
lines earlier for entering the same mutex
2007-04-20 21:35:31 +00:00