Commit Graph

50 Commits

Author SHA1 Message Date
joerg
bec77c5f43 Use __dead 2011-08-31 13:32:36 +00:00
mrg
33c01d32fc remove some always true if () checks GCC 4.5.3 picks up. 2011-06-22 04:03:23 +00:00
lukem
d877c4c3c0 Enable WARNS=4 by default, except for:
cpuctl  dumplfs  hprop  ipf  iprop-log  kadmin  kcm  kdc  kdigest
	kimpersonate  kstash  ktutil  makefs  ndbootd  ntp  pppd  quot
	racoon  racoonctl  rtadvd  sntp  sup  tcpdchk  tcpdmatch  tcpdump
	traceroute  traceroute6  user  veriexecgen  wsmoused  zic
(Mostly third-party applications)
2009-04-22 15:23:01 +00:00
lukem
3cafe960ea fix -Wsign-compare issues 2009-01-18 10:10:47 +00:00
pooka
e8a1f963a5 fix tyop in error message, no functional change 2008-08-24 18:26:05 +00:00
pooka
30c29b1b53 * Apparently u9fs returns the inode number as the unique qidpath.
This is fairly annoying if browsing a hierarchy with multiple file
  systems mounted, since at least inode 2 is fairly common.  Compensate
  by comparing modification time also.  Not perfect, but ....
* Don't loop eternally if we attempt to read at or past EOF.  Fixes
  reading files on a non-cached mount.
2008-08-22 17:44:14 +00:00
wiz
9fbc5e2b76 Sort options. 2007-12-02 21:03:39 +00:00
wiz
c50e337e51 Nits. Sort options. 2007-12-02 21:03:32 +00:00
pooka
21913eabe5 Rototill.
Ok, ok, a few more words about it: stop holding puffs_cc as a holy
value and passing it around to almost every possible place (popquiz:
which kernel variable does this remind you of?).  Instead, pass
the natural choice, puffs_usermount, and fetch puffs_cc via
puffs_cc_getcc() only in routines which actually need it.  This
not only simplifies code, but (thanks to the introduction of
puffs_cc_getcc()) enables constructs which weren't previously sanely
possible, say layering as a curious example.

There's still a little to do on this front, but this was the major
fs interface blast.
2007-11-30 19:02:28 +00:00
pooka
6a3d9a187d Remove "puffs_cid" from the puffs interface following l-removal
from the kernel vfs interfaces.  puffs_cc_getcaller(pcc) can be
used now should the same information be desired.
2007-11-27 11:31:17 +00:00
pooka
4462e9454f use puffs_daemon() instead of daemon() 2007-11-16 18:39:01 +00:00
pooka
a02fe51bef Open the kernel descriptor as part of mount(), not init(). Then
it doesn't matter if someone fork()s or does other tricks between
init() and mount() (and besides, now it's where it logically should be).
2007-11-06 15:09:07 +00:00
pooka
ec865a5b29 Actually, daemonize the file servers before mounting. I might require
at some point that the local protocol handler does not change after
the file system has been mounted.
2007-11-05 17:54:31 +00:00
pooka
4b0f2948e2 Pull the daemonizing code out of the library mainloop into the file
servers.  Calling daemon() (i.e. fork()ing) inside a library can
cause nice surprises for e.g. threaded programs.  As discussed with
Greg Oster & others.
2007-11-05 17:48:17 +00:00
pooka
1b050f3a07 update usage to match reality. caught by jmcneill 2007-10-15 17:28:13 +00:00
pooka
6360ca31ab Execute getattr in lookup to get file size. The kernel doesn't
anymore do this if we fail to set size.

The whole lookup procedure should be done in a smarter fashion,
but this is the quickie fix to get things working again.
2007-10-13 17:21:39 +00:00
pooka
08386a8ca4 adapt to new cmpfb signature 2007-09-06 16:09:09 +00:00
pooka
9336b1ca30 Adapt to new puffs_framev_init() signature - gotfb. 2007-09-01 16:43:10 +00:00
pooka
d8a510556e get rid of DBG= 2007-07-18 22:38:58 +00:00
pooka
08db7d7534 * add mntfromname parameter to puffs_init()
* set it in file servers
2007-07-17 11:34:51 +00:00
pooka
90ba17c197 support standard user@host:path mount argument 2007-07-17 10:06:03 +00:00
pooka
5e1b81c1b5 Accept user as a flag. This way the usage is fstab-compliant:
mount_9p argument mountpoint
2007-07-08 16:29:29 +00:00
pooka
bfecc30afc adapt to puffs_framebuf changes 2007-07-07 21:14:26 +00:00
pooka
58457f2209 adapt: inactive no longer comes with int *refcount (not that it was
used except for setting the default here anyway)
2007-07-02 10:26:50 +00:00
pooka
6596e0c995 adapt: **newnode etc. pointers -> struct puffs_newinfo 2007-07-01 18:40:15 +00:00
pooka
fe7bbdec69 adapt: pid -> const struct puffs_cid * 2007-07-01 17:23:44 +00:00
pooka
91629617de Call puffs_pn_remove() just in case the file server happens to be
quick with recycling qids.
2007-06-24 19:13:39 +00:00
pooka
7c537b89eb Change the signature of puffs_respcmp to return -1,0,1 for smaller,
equal, larger, respectively instead of 0/1 for non/equal.  This
will allow sorting the buffers for faster matching in libpuffs.
While here, change the name from respcmp to framecmp, as that better
reflects the purpose.

NOTE!  there is no obvious way to make compilation fail for file
systems which may already be using this feature (although I don't
think there are any outside our tree, as the feature is two weeks
old).  Nevertheless, non-updated file systems will fail very quickly.
2007-05-20 16:24:37 +00:00
pooka
b283afddec support reclaim. set noref setback when removing a node to prompt
immediate reclaim.
2007-05-19 10:38:23 +00:00
pooka
c8b0a89198 reflect changes in fs mount: use puffs_mount() instead of
puffs_domount() & puffs_start()
2007-05-17 14:13:04 +00:00
pooka
0b0e609b9b Enhance the GETRESPONSE, JUSTSEND and SENDCB macros to process the
return value from the network layer.
2007-05-16 09:57:21 +00:00
pooka
ddf4b3708e * free framebuf after use (even in the common path ;)
* simplify a loop
2007-05-15 17:08:34 +00:00
pooka
8427494a96 don't leak memory if getting data from the buffer fails
CID 4485
2007-05-15 14:22:58 +00:00
pooka
9fec81140f In case we counter a protocol error while parsing the readdir response,
completely release our directory cookie - it's unlike we'll be coming
back to it.  And if we do, it'll just be autogenerated.

CID 4487
2007-05-15 14:12:41 +00:00
pooka
5252a3b094 free name from proto_getstat() after use
CID 4488
2007-05-15 13:56:00 +00:00
pooka
e3468dbcce adapt to "step 3" of puffs_framebuf changes 2007-05-15 13:46:47 +00:00
pooka
3a7dcceb40 use puffs_mainloop(); puffs_framebuf_eventloop() is a goner 2007-05-11 21:27:45 +00:00
pooka
5069b5df0c adapt to puffs_framebuf changes 2007-05-11 16:23:00 +00:00
pooka
a2b224da1f Error with rtagid instead of tagid. caught by Dan's compiler flags. 2007-05-11 11:43:08 +00:00
pooka
dca252d8a0 Use inactive-on-demand, set inactive request in open() to close
file handles when last reference is removed from the kernel.
2007-05-07 17:20:58 +00:00
pooka
3ac2e6b4df If mode is set, the uppermost byte specifying the type must be
correctly, otherwise the file server will attempt a conversion.
Specifically, if the directory bit is not set when changing the
permissions for a directory, a conversion from directory to regular
file would be attempted and naturally it being unsupported the
whole chmod would fail.  So supply the file type as part of the
file mode.
2007-05-06 22:17:50 +00:00
pooka
afa0f0e278 Close file handles in inactive instead of close - a memory mapping
may still be active after a vnode is closed
2007-05-06 21:58:24 +00:00
pooka
d34b752303 use puffs_framebuf_remaining() 2007-05-06 10:54:55 +00:00
pooka
cfd2c55859 adapt to puffs_framebuf_eventloop signature change 2007-05-06 10:51:19 +00:00
pooka
0e7bdfc146 Adapt to use puffs_framebuf. This gets rid of most of the duplicated
code between mount_psshfs and mount_9p and clarifies the code
structure.
2007-05-05 15:49:51 +00:00
pooka
ff4087e2ce Fix a couple of gotchas left after AUTOVAR() started creating the
network buffers.

CID 4477, 4478, 4479, 4480
2007-05-04 18:17:34 +00:00
pooka
6784b33211 free uid and gid strings after use
CID 4474, 4475
2007-05-04 18:12:25 +00:00
pooka
9c16b5e434 For consistency destroy kernel request putbuffers also when
escaping event loop (the process is going to exit anyway, but ...)
2007-05-02 18:50:30 +00:00
pooka
436cfd0df4 Alter the strategy for reading/writing a bit. First of all, use
PUFFS_KFLAG_WTCACHE.  Second, create separate fids for reading and
writing.  If opening for read, open a read-only fid and for write
a write-only fid; use these for reading and writing.  When the
open-count for a node drops to zero, clunk both.  This avoids hitting
the fid limit when accessing large directory hierarchies.

Two problems remain:
* does not take credentials into account, although we can only mount
  the remote 9P file server with one set of credentials, so not a
  huge worry
* doesn't work for the open/mmap/close/access_memory_window case, but
  that will require some further kernel changes
2007-04-22 18:10:48 +00:00
pooka
e73a712f80 mount_9p: mount a file server using the Plan9 file sharing protocol
Works, but lots of little things to nibble on:
* fix permissions to work better
* limit the amount of open files required
* do constant folding with psshfs code
* support authentication
etcetc.
2007-04-21 14:21:42 +00:00