Commit Graph

417 Commits

Author SHA1 Message Date
manu 4f82f2460e From Evgeniy Ivanov: puffs_node_readdir() should set eofflag to one, when
end-of-directory is reached.
2011-06-27 12:06:19 +00:00
manu 503fb643db Commit fix for misc/45029.
Approved by pooka@
2011-06-24 16:59:29 +00:00
mrg 493d341048 various build fixes for gcc 4.5. from chuq. XXX i'm not sure all of
these work properly wtf pointer aliasing, but there are no casts at
least...

the lib/libpuffs/puffs_priv.h is definately a real bug fix.

from chuq.
2011-06-20 09:11:16 +00:00
manu 7f87f63c56 Call advlock method if supplied 2011-05-03 13:16:47 +00:00
manu 7a675e4eab In node_lookup() ops, pcn->pcn_nameiop contains a NAMEI_* constant, not
PUFFSLOOKUP_*
2011-04-19 10:35:24 +00:00
yamt 5c50d59d8b puffs__cc_destroy: clear PCC_HASCALLER. the caller info is not
necessarily relevant to the next life of the cc.  this also fixes
the failure of the assertion in the next line.
2011-03-04 09:47:47 +00:00
pooka aedd7db813 Support rest of file types in vtype -> s_ifmt 2011-02-17 17:55:36 +00:00
pooka 78bedf0f20 st_blocks is in units of DEV_BSIZE, not st_blksize.
from Derrik Pates
2011-02-17 15:41:34 +00:00
yamt 79d46db770 typo in a comment 2011-01-10 23:20:45 +00:00
pooka 33c6814d7a document abortop. part of PR kern/44208 2010-12-13 09:06:51 +00:00
pooka 248168affc Remove PUFFS_WITH_THREADS ifdef garbage, just use libc weak symbols. 2010-12-06 14:50:34 +00:00
pooka 65cdb57245 print to stderr instead of stdout 2010-08-20 16:35:05 +00:00
pooka 01e9b21900 Default f_namemax to MAXNAMLEN, mostly for initial statvfs struct
passed to kernel in mount.

XXX: there's currently no way for a file server to override the
one passed in mount.
2010-07-15 21:53:10 +00:00
pooka e894ab517b Export the opid -> opstr tables (for outside debugging use). 2010-07-11 12:29:08 +00:00
pooka 54aeac7f90 unwhine lint 2010-07-06 21:58:18 +00:00
pooka d8a0b8cdce stat mount target path only if we're actually goint to use it.
This avoids errors from the comfd case when the mount target does
not exist in our local namespace.
2010-07-06 18:22:20 +00:00
pooka a6b3b71bb8 set time_t compat where necessary 2010-07-06 18:01:14 +00:00
pooka afdc25dbdf When using the top secret PUFFS_COMFD model, write out size of the
puffs kernel args before the contents.  This allows parties which
have no clue about the contents to proxy the protocol easily.
2010-07-06 13:27:16 +00:00
pooka 0e05405bd1 Reenable pathconf now that the retval argument is register_t. 2010-06-07 11:22:36 +00:00
pooka a784ae74af Make retval argument for pathconf a register_t to match VOP_PATHCONF.
This makes the size the same on 64bit archs.  Don't bother bumping
any version, since you'd have explicitly had to jump through some
hoops to use pathconf before.
2010-06-07 11:21:31 +00:00
pooka a7bb34b4fd Actually, disable pathconf for a while longer: the retval needs a
little finetuning (not that everyone is jumping right to using it,
but fixing will have to wait until tomorrow, and who knows what
i'll forget during the night and how long it will eventually take).
2010-06-06 23:11:05 +00:00
pooka aef13c83d0 signal pathconf in the vector of supported ops 2010-06-06 22:44:54 +00:00
pooka 33b074be7e add option string for no attribute cache
(foreseeing the odd event I might actually implement one some day)
2010-05-21 11:29:42 +00:00
pooka 335bcd0d3c mention extended attribute ops 2010-05-21 11:20:50 +00:00
pooka c3be8a8cd5 * support extended attributes
* bump major due to structure growth
* add some spare space
* remove ABI sillyness
2010-05-21 10:50:52 +00:00
pooka 539062e7e1 adjust for protocol changes 2010-05-21 10:43:07 +00:00
pooka 651aab9fcd Don't try to print the names of messages we don't know about. 2010-05-21 08:46:14 +00:00
pooka 87467ad4b7 * fix typo
* fix "that's not supposed to be there" causing off-by-one in array
* make compile regardless of dev_t size
2010-05-20 13:07:28 +00:00
pooka f6e5cf7c15 remove three years out-of-date comment 2010-05-19 12:16:45 +00:00
pooka 69381b7a05 fix a few pastos 2010-04-01 09:57:00 +00:00
pooka b95be6c682 Add convenience routine puffs_unmountonsignal(), which does exactly that. 2010-01-12 18:42:38 +00:00
pooka ffe194d485 Use typecast instead of ULL for a less whiny lint on LP64. 2010-01-07 23:03:26 +00:00
pooka cf755ff393 Rewrite puffs_exit() in terms of the PUFFSOP_UNMOUNT kernel request.
Now server exit is a lot quite cleaner than previously.
2010-01-07 22:49:19 +00:00
pooka 0dd997522d Be slightly more forgiving about unknown operation types. 2010-01-07 22:46:11 +00:00
pooka b3cd880417 Set high bit on server->kernel requests to better differentiate
between the direction of the request.
2010-01-07 22:40:11 +00:00
pooka a63d44abdb Dump contents of struct vattr -- i never remember which members
the kernel passes when, so this helps tapping that info.
2010-01-07 20:47:47 +00:00
pooka d0f464047a * make indentation a little less ridiculous
* note that interfaces provided by <puffsdump.h> are not stable and
  are to be used only for debug builds
* remove a few unimplemented/used dump interfaces
2010-01-07 18:09:07 +00:00
pooka 304a850cb9 fix typography 2010-01-04 22:04:50 +00:00
pooka 7431f4f63d Add an error handler which syslogs but does not abort() and make it
the default.  Most servers just shovel bits from their backend to
the kernel without checking the contents and dumping core in case
the backend gives garbage is a bit harsh.
2009-12-05 20:54:10 +00:00
pooka 689551bfdb Remove suspension support from here too. 2009-12-05 12:13:08 +00:00
mbalmer 124961627e s/the the/the/ 2009-11-22 18:40:26 +00:00
pooka 2a93cba43c In getgroups(), copy only up to the number of supplementary groups
that actually exist.
2009-11-20 14:23:54 +00:00
pooka d33c69eb5f bump minor for puffs_setmntinfo() 2009-10-18 20:26:33 +00:00
pooka f0d8515717 include some headers we use 2009-10-18 20:14:06 +00:00
pooka 0f699dcf1d Make it possible to supply parameters to puffs_init() later (but
before puffs_mount()).
2009-10-18 19:09:20 +00:00
pooka 75008bfc31 Dispatch puffs_node_abortop().
Note: We use the storage of puffs_cache_write from puffs_ops for
this purpose.  It's not issued by the kernel and hence currently
unused, and this saves us from the trouble of bumping the lib major
version.
2009-10-17 23:19:52 +00:00
pooka eea7b3ade4 Add some comments on how to act when major is bumped the next time. 2009-10-17 21:36:02 +00:00
wiz 4dfd7ed6ff No Pp needed before El. 2009-05-13 22:42:31 +00:00
wiz 332088ae2e New sentence, new line. 2009-04-11 16:48:53 +00:00
joerg e112b60607 Fix markup. 2009-04-11 15:37:12 +00:00
joerg 326820b20c Fix missing quote. 2009-04-11 15:36:22 +00:00
pooka 9b83cef174 dump readdir offset 2009-04-06 20:47:17 +00:00
pooka afc5bcc1fa * dump op-specific return info before the generic one
* dump readdir response values
2009-04-06 14:45:11 +00:00
pooka 229bf1afc9 Remove the paragraph saying interfaces will change without warning.
Note that a stable version of puffs first appeared in NetBSD 5.0.
2009-02-20 14:26:56 +00:00
christos 46edb91e9f bump shared libraries. 2009-01-11 03:07:47 +00:00
lukem bbdbf3e294 fix some sign comparison warnings 2009-01-08 02:28:08 +00:00
lukem 5fcf39a9f8 Cast a value to time_t (not unsigned) when comparing to timespec tv_sec 2009-01-08 02:19:48 +00:00
christos 2d378f1d33 fix for dev_t 64 bits. 2008-12-28 22:45:05 +00:00
dsl e8915d2e05 Actually we need 'long int' to avoif a stupid 'truncating long to int'
warning.
2008-12-13 11:53:25 +00:00
dsl abd4a7f6d0 Change type of 'n' to 'int' so that it can be printed with %d.
The domain of the value is [-1..sizeof (int)] so a type of 'int' is fine.
2008-12-13 11:48:46 +00:00
pooka a75f7c7343 Close write-end of daemonpipe in reader to get EOF if the writer
goes awol.
2008-12-12 19:56:12 +00:00
pooka 33a0d776c1 Add puffs_cancel(), which allows to back down after puffs_init()
and before puffs_mount().
(this should actually be integrated with puffs_exit(), but that
routine is currently so non-sensible that I didn't bother now)
2008-12-12 19:45:16 +00:00
pooka 41f31dac6d add:
puffs_setspecific(pu, private)
	Can be used to set the specific data after the call to
	puffs_init().
2008-12-12 18:59:53 +00:00
pooka a947a86fee support:
a) readdir cookies and eofflag
b) file handle routines.

   File handle routines are REALLY ugly and are not stable, i.e.
   the file handle will be lost if the file server goes byebye.
   They probably should be redone to not use getfh(), but for nullfs
   I wanted to make them the same as when the file system is accessed
   without the null layer.  Well, turns out it doesn't pass anyway
   since the kernel adds the fsid tags for fhandle_t.  Anyway, it's
   useful for some limited hacking purposes, so I'll commit this
   since it works .. kinda.
2008-11-26 14:02:23 +00:00
pooka e61394a6b8 i'm almost certain that puffs_cooie_t is supposed to be puffs_cookie_t 2008-11-25 11:49:08 +00:00
pooka 462f2a64a0 note that puffs_daemon() must be called *before* puffs_mount() 2008-11-14 13:27:24 +00:00
pooka e489c3824a fix typographical snafu 2008-11-14 13:10:13 +00:00
wiz 91eff5cc84 Drop trailing whitespace. 2008-09-06 15:43:27 +00:00
pooka 8591ab211b Add AsiaBSDCon 2008 paper to SEE ALSO. 2008-09-06 12:39:49 +00:00
pooka 1acae5309f Fix double free when i/o descriptor is violently closed. Bug was
introduced in rev 1.27.

fix provided by Taylor R Campbell in lib/39353
2008-09-04 15:30:36 +00:00
pooka ff42332733 Replace void * by puffs_cookie_t where appropriate. No functional change. 2008-08-12 19:44:39 +00:00
pooka 71043aa4cb clear cached puffs_cc's in puffs_exit() 2008-08-11 16:23:37 +00:00
pooka 7602ecfa8f * make sure we come out of mainloop in the main context. otherwise in
certain cases the server would jump to hyperspace when unmounted
* sprinkle some debug prints
2008-08-11 15:59:01 +00:00
wiz 67ff3d242e Punctuation markup nit. 2008-05-25 19:38:21 +00:00
wiz 682d8063bf Remove trailing whitespace. 2008-05-25 19:38:14 +00:00
pooka 73bad8cbdb Reserve enough memory for ops which return more than they receive. 2008-03-20 15:28:03 +00:00
pooka 04973f7441 When reading a request from the kernel, only allocate as much memory
as needed to read a request instead of the maximum message size.
Insanely enough, this makes "cheap backend I/O" file systems such
dtfs and sysctlfs perform 10-30% better (depending on the average
size of incoming requests).
2008-01-29 14:54:08 +00:00
pooka 98d94502be whoops, bump date - pretty significant change 2008-01-29 10:15:50 +00:00
pooka be5ed87c1e Fix a weirdosity in the framebuf gotfb interface: hand buffer
ownership to the called routine instead of keeping it.  This means
that callees must now destroy the buffer once they are done with it.
2008-01-29 10:07:29 +00:00
pooka 704ded372f Don't add asserts between testing and commit - especially not
if you're going to write "assert(foo = 0)"
2008-01-28 18:51:03 +00:00
pooka 7c2ddc1d53 Bump version for lazy contexts (probably not necessary, but it's
been a long time since I bumbed the version ;)
2008-01-28 18:42:09 +00:00
pooka d1d05d65b9 Implement lazy contexts for file systems using puffs_mainloop().
Previously each request was executed on its own callcontext and
switched to every time the request was being processed.  Now requests
borrow the mainloop context and switch only if/when they yield.
This takes two context switches away from a file system request
bringing down the typical amounts 2->0 (e.g. dtfs) and 4->2 (e.g.
psshfs).

The interfaces for manually executing requests changed a bit:
puffs_dispatch_create() and puffs_dispatch_exec() must now be used.
They are not tested, as nothing in-tree wants them and I doubt
anyone else is really interested in them either.

Also do some misc code cleanup related to execution contexts.  The
"work-in-progress checkpoint" committed over a year ago was starting
to look slightly weed-infested.
2008-01-28 18:35:49 +00:00
pooka e9ff674b00 For operations with a target (remove, rmdir, link), print the
target cookie.
2008-01-27 00:29:24 +00:00
pooka c142350bc6 Fix fakecc case.
Noticed by Pavel Jirout on current-users
2008-01-17 17:43:14 +00:00
pooka 9f5abca72f Comment out the puffs_executor hacks for now, they have races.
The issue should be solved in another fashion anyway.
2008-01-16 23:17:43 +00:00
pooka 614c59fcb2 Cache a number of execution contexts instead of re-initializing
them every time.  Speeds up pure in-memory file systems such as
sysctlfs or dtfs quite a bit.  For actual I/O-workhorses the result
is of course less tasty.
2008-01-16 21:29:59 +00:00
pooka 3a433fe13b Use PROT_NONE page to protect bottom of stack from overrun 2008-01-16 00:29:42 +00:00
pooka d7412d56b1 Introduce PUFFS_STACKSIZE_MIN to avoid overloading 0 and getting
a warning from the library when really wanting to say "just the
minimum, please".
2008-01-14 13:57:26 +00:00
pooka 1309a27c5e liberate gas-huffin crack-puffin' assert 2008-01-08 00:22:31 +00:00
pooka cf16702d95 fix pasto 2008-01-02 18:11:01 +00:00
pooka b181a1a237 Also pass fromname in the "distributed" case. 2008-01-02 17:57:51 +00:00
pooka 636e495315 Provide some transparent "support" for "distributed" file systems.
If the env variable PUFFS_COMFD is set, the descriptor value
contained in it is used for communication instead of opening
/dev/puffs and doing mount(2).

This feature is obviously very undocumented and should not be used
without adult supervision.
2008-01-02 14:27:42 +00:00
pooka 38a05cc07d Flesh this out a bit more. Unfortunately it's still unfinished,
and I don't know when I'll get a chance to finish it.
2007-12-27 18:50:42 +00:00
pooka c3b193c57f Add a public interface for setting a cookie mapper. 2007-12-25 20:38:01 +00:00
pooka 80ecfb9fc9 * dump r/w return resid
* fix RV dump order to be more logical
2007-12-25 20:36:53 +00:00
pooka a8e13cb420 Add generic getattr routine. 2007-12-19 14:01:16 +00:00
pooka 08c7b6138e * nuke puffs_cc_get{specific,usermount} for good
* move prototypes for puffs_docc and puffs_dopufbuf into the
  public header, as they are should be exposed
2007-12-16 20:02:57 +00:00
pooka 369391b0a0 Clarify that link_target in node_symlink is null-terminated. 2007-12-16 19:10:58 +00:00
pooka 049d39b202 document puffs_dopufbuf 2007-12-15 20:11:38 +00:00
pooka 96294df307 update to match reality 2007-12-15 20:08:06 +00:00