summaryrefslogtreecommitdiff
path: root/sys/src/9/port/chan.c
AgeCommit message (Collapse)Author
2016-04-01kernel: always clunk closed fids asynchronously, regardless of cachingcinap_lenrek
2015-08-25fix fuckupglenda
2015-08-25import E script from bell labsmischief
2015-08-09kernel: pgrpcpy(), simplify Mount structurecinap_lenrek
instead of ordering the source mount list, order the new destination list which has the advantage that we do not need to wlock the source namespace, so copying can be done in parallel and we do not need the copy forward pointer in the Mount structure. the Mhead back pointer in the Mount strcture was unused, removed.
2015-08-09kernel: fix Mheadachecinap_lenrek
there was a race between cunmount() and walk() on Mhead.from as Mhead.from was unconditionally freed when we cunmount(), but findmount might have already returned the Mhead in walk(). we have to ensure that Mhead.from is not freed before the Mhead itself (now done in putmhead() once the reference count of the Mhead drops to zero). the Mhead struct contained two unused locks, removing. no need to hold Pgrp.ns lock in closegrp() as nobody can get to it (refcount droped to zero). avoid cclose() and freemount() while holding Mhead.lock or Pgrp.ns locks as it might block on a hung up fileserver. remove the debug prints... cleanup: use nil for pointers, remove redundant nil checks before putmhead().
2015-08-06kernel: fix indention in validname0()cinap_lenrek
2015-08-06kernel: use Etoolong[] constant instead of string literal in validname0()cinap_lenrek
2015-07-28kernel: remove obsolete comment from namec()cinap_lenrek
2015-07-28kernel: export mntattach() from devmnt.c avoiding bogus struct passing and ↵cinap_lenrek
special case in namec() we already export mntauth() and mntversion(), so why not stop being sneaky and just export mntattach() so bindmount() and devshr can just call it directly with proper arguments being checked. we can also avoid handling #M attach specially in namec() by having the devmnt's attach function do error(Enoattach).
2015-07-22kernel: cleanup chan.c to consistenly use nil instead of 0 for pointerscinap_lenrek
2014-08-08kernel: more nil vs 0 cleanup in chan.ccinap_lenrek
2014-08-08kernel: use nil for pointers instead of 0, zero channel umc and dirrock in ↵cinap_lenrek
newchan()
2014-06-22kernel: new pagecache, remove Lock from page, use cmpswap for Ref instead of ↵cinap_lenrek
Lock make the Page stucture less than half its original size by getting rid of the Lock and the lru. The Lock was required to coordinate the unchaining of pages that where both cached and on the lru freelist. now pages have a single next pointer that is used for palloc.head freelist xor for page cache hash chains in Image.pghash[]. cached pages are not on the freelist anymore, but will be reclaimed from images by the pager when the freelist runs out of pages. each Image has its own 512 hash chains for cached page lookup. That is 2MB worth of pages and there should be no collisions for most text images. page reclaiming can be done without holding palloc.lock as the Image is the owner of the page hash chains protected by the Image's lock. reclaiming Image structures can be done quickly by only reclaiming pages from inactive images, that is images which are not currently in use by segments. the Ref structure has no Lock anymore. Only a single long that is atomically incremented or decremnted using cmpswap(). there are various other changes as a consequence code. and lots of pikeshedding, sorry.
2014-04-28devmnt: abandon fid on botched Tclunk or Tremovecinap_lenrek
if theres an error transmitting a Tclunk or Tremove request, we cannot assume the fid to be clunked. in case this was a transient error, reusing the fid on further requests will fail. as a work arround, we zero the channels fid and allocate a new fid before the chan is reused. this is not correct as we essentially leak the fid on the fileserver, but we will still be able to use the mount.
2014-01-20kernel: apply uintptr for ulong when a pointer is storedcinap_lenrek
this change is in preparation for amd64. the systab calling convention was also changed to return uintptr (as segattach returns a pointer) and the arguments are now passed as va_list which handles amd64 arguments properly (all arguments are passed in 64bit quantities on the stack, tho the upper part will not be initialized when the element is smaller than 8 bytes). this is partial. xalloc needs to be converted in the future.
2013-10-30fix devshr related panic caused by Mount.to being nil (thanks mischief!)cinap_lenrek
the shr mount is linked into the Mhead with m->to initially nil. only after the the server has been attached is m->to set. just check for it in createdir().
2013-10-25kernel: dont spawn closeprocs from closechanqcinap_lenrek
make closeproc() spawn more procs on demand insead of doing it from closechanq(). this avoids the palloc lock checks and simplifies the logic.
2013-10-25kernel: keep one closeproc arround in case we are unable to fork a new onecinap_lenrek
closechanq() is unable to fork a new closeproc when palloc is locked. so we spawn a closeproc early in chandevinit() and make sure theres always one process arround to handle the queue.
2013-09-22devproc: check for p->dot == nil, run closeproc with up->dot = up->slashcinap_lenrek
p->dot can be nil when process exits (see pexit()) set closeprocs dot to up->slash so it will show up right in devproc.
2013-05-27kernel: closechanq errorcinap_lenrek
catch potential interrupt error from kproc(). this can happen when we run out of processes, then newproc() will call rsrcwait() which does tsleep(). if the process gets a note, this might raise a interrupt error.
2013-05-01chan: fix potential path leak on clone in namec() (from erik quanstroms 9atom)cinap_lenrek
2012-11-07limit clunk queue length for cclose()cinap_lenrek
dont let the clunk queue grow too large if we are allowed to block (cclose) as the fileserver might run out of fids.
2012-10-11kernel: try to catch some (rare) mistakescinap_lenrek
kstrcpy() did not null terminate for < 4 byte buffers. fixed, but i dont think there is any case where this can happen in practice. always set malloctag in kstrdup(), cleanup. always use ERRMAX bounded kstrcpy() to set up->errstr, q->err and note[]->msg. paranoia. instead of silently truncating interface name in netifinit(), panic the kernel if interface name is too long as this case is clearly a mistake. panic kernel when filename is too long for addbootfile() in devroot. this might happen if your kernel configuration is messed up.
2012-10-10kenrel: simplify image cache by use of ccloseq()cinap_lenrek
2012-04-28avoid leaking up->dot into the closeproccinap_lenrek
2012-04-27fix missed clunkq wakeup racecinap_lenrek
2012-04-27async clunk for cached mounts, fix closeproc explosioncinap_lenrek
2012-03-28port/chan.c: fix locking issuecinap_lenrek
2011-12-22kernel: make mntcache effective, be carefullcinap_lenrek
2011-09-02chan: use chanpath() in chan DBG, do more checking in cclose and cclonecinap_lenrek
2011-08-17change definition of Chan.create to return a chan like opencinap_lenrek
2011-03-30Import sources from 2011-03-30 iso image - libTaru Karttunen
2011-03-30Import sources from 2011-03-30 iso imageTaru Karttunen