Commit Graph

220 Commits

Author SHA1 Message Date
hannken 392dc36056 Add missing vrele() and vfs_vnode_iterator_destroy() to coda_cacheprint(). 2015-01-06 11:24:46 +00:00
hannken a36fad8a57 Change coda from hashlist to vcache.
- Replace all hash list crawlers with vfs_vnode_iterator.
2014-12-13 15:59:30 +00:00
hannken 19b229940c Remove cnodes from coda_reclaim(), not from coda_inactive(). 2014-12-13 15:59:03 +00:00
hannken 58ab4a9584 Move the definition of NVCODA and CODA_COMPAT_5 to coda.h,
remove them from coda_vfsops.c and coda_psdev.c.
2014-12-13 15:58:39 +00:00
hannken b0c8ff749a Remove unused definitions (C_WANTED, C_LOCKED). 2014-12-13 15:58:13 +00:00
hannken beee9a5eb0 Attach the control object vnode to the coda mount and release it
on unmount.  Initialize special files with NODEV.
2014-12-13 15:57:46 +00:00
snj f0a7346d21 src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
2014-10-18 08:33:23 +00:00
dholland 05d075b3ae Add VOP_FALLOCATE and VOP_FDISCARD to every vnode ops table I can
find.

The filesystem ones all call genfs_eopnotsupp - right now I am only
implementing the plumbing and we can implement fallocate and/or
fdiscard for files later.

The device ones call spec_fallocate (which is also genfs_eopnotsupp)
and spec_fdiscard, which dispatches to the device-level op.

The fifo ones all call vn_fifo_bypass, which also ends up being
EOPNOTSUPP.
2014-07-25 08:20:51 +00:00
dholland f9228f4225 Add d_discard to all struct cdevsw instances I could find.
All have been set to "nodiscard"; some should get a real implementation.
2014-07-25 08:10:31 +00:00
maxv 23f76b6d00 An (un)privileged user can easily make the kernel dereference a NULL
pointer.

The kernel allows 'data' to be NULL; it's the fs's responsibility to
ensure that it isn't NULL (if the fs actually needs data).

ok christos@
2014-04-16 18:55:17 +00:00
hannken 6d285189fb Change all vfsops to use C99 designated initializers.
No functional changes intended.
2014-03-23 15:21:15 +00:00
skrll 8f2cde0556 Mechanically replace simplelock with kmutex_t. 2014-03-20 06:48:54 +00:00
dholland a68f9396b6 Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
2014-03-16 05:20:22 +00:00
hannken 2b6ec89863 The current implementation of vn_lock() is racy. Modification of
the vnode operations vector for active vnodes is unsafe because it
is not known whether deadfs or the original file system will be
called.

- Pass down LK_RETRY to the lock operation (hint for deadfs only).

- Change deadfs lock operation to return ENOENT if LK_RETRY is unset.

- Change all other lock operations to check for dead vnode once
  the vnode is locked and unlock and return ENOENT in this case.

With these changes in place vnode lock operations will never succeed
after vclean() has marked the vnode as VI_XLOCK and before vclean()
has changed the operations vector.

Adresses PR kern/37706 (Forced unmount of file systems is unsafe)

Discussed on tech-kern.

Welcome to 6.99.33
2014-02-27 16:51:37 +00:00
pooka 4f6fb3bf35 Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.
2014-02-25 18:30:08 +00:00
hannken 97834f7ba0 Change vnode operation lookup to return the resulting vnode *vpp unlocked.
Change cache_lookup() to return an unlocked vnode.

Discussed on tech-kern@

Welcome to 6.99.31
2014-02-07 15:29:20 +00:00
hannken 04c776e5c8 Change vnode operations create, mknod, mkdir and symlink to return
the resulting vnode *vpp unlocked.

Discussed on tech-kern@

Welcome to 6.99.30
2014-01-23 10:13:55 +00:00
hannken 1139274440 Change vnode operations create, mknod, mkdir and symlink to keep the
directory node dvp locked on return.

Discussed on tech-kern@

Welcome to 6.99.29
2014-01-17 10:55:01 +00:00
christos 9d605174d9 Change the queue.3 *_END(&head) macros to NULL. Since we don't have CIRCLEQ
anymore, all the macros expand to NULL anyway, so this improves readability.
Requested by rmind@
2013-11-27 17:24:43 +00:00
christos 5ab798df60 tuck in code inside the mutex 2013-11-23 23:14:55 +00:00
christos c82871218e replace open-coded scan with macro; fix locking 2013-11-23 17:57:23 +00:00
riz 4d884f3fb4 Since mountlist is now a TAILQ, convert some missed usages
so things build again.
2013-11-23 16:15:24 +00:00
riz 65fba94655 C requires a statement after a label, and a declaration is not a
statement, so create a block using {}.  From christos.
2013-10-18 00:03:35 +00:00
christos 9263de029f remove unused code from macro 2013-10-17 20:56:02 +00:00
christos 641eff3991 remove unused code. 2013-10-17 20:55:30 +00:00
christos 289bc9f713 move module code inside module ifdef 2013-10-17 20:54:24 +00:00
christos 912592a638 mention current status 2012-08-04 12:47:00 +00:00
christos 0c222dcdd0 Don't increment the mount reference count here. Otherwise we are left with
refcount of one when we unmount, and vfs_destroy does not... Who is expected
to decrement this anyway?!?!
2012-08-04 12:31:57 +00:00
christos 020a6ad2d4 - move debugging functions to vcoda so modules with -DDEBUG link
- fix writing to coda files. this is probably not the right way to do
  this, but it satisfies the locking protocol:
	1. Sometimes coda_open() is called with an unlocked vnode which
	   does not satisfy the locking protocol. Lock it for now. We
	   need to find out why this happens
	2. VFS_VGET sometimes returns the container vnode unlocked. What
	   is the locking protocol for VFS_VGET? We also lock it here.
2012-08-02 16:06:58 +00:00
matt 10543b2146 -fno-common fallout. 2012-07-28 00:10:22 +00:00
christos 4af0aec9a5 comment out debugging printfs 2012-05-04 17:57:22 +00:00
christos b01ba4dca4 depend on "vcoda" since it has symbols we need. 2012-05-04 02:06:27 +00:00
christos b6690e266f fix locking in getpages when running executables. 2012-05-04 01:40:13 +00:00
christos 89fb5ce609 remove variable names from prototypes. 2012-05-04 01:38:56 +00:00
christos b43ddeabe0 move the assert after the locked case. 2012-05-03 14:26:42 +00:00
christos e4d18b9bd2 Instead of sharing the coda vnode lock with the ffs vnode lock, share the
ffs vnode lock with coda.
2012-05-02 16:51:01 +00:00
christos bc2122f164 cosmetic only: __func__, vnode_t 2012-04-28 20:15:07 +00:00
christos ee12655fb3 Fixes from get/putpages from rmind.
In grab vnode, share the lock of the coda vnode with the underlying vnode,
so that the locking protocol works.
2012-04-28 20:01:09 +00:00
christos a28e849d3a remove multiple definitions. 2012-04-26 17:18:33 +00:00
christos 704aca390d re-arrange things so that vcoda does not depend on coda. 2012-04-26 03:04:54 +00:00
christos c51fe45f15 use CODA_MAXNAMLEN instead of bogus MAXNAMLEN 2011-09-27 00:54:47 +00:00
gdt bcb68cbe5c Reduce verbosity of semi-debug coda_inactive printf.
Rather than print if the usecount is > 0, only print if it is greater
than 1.  It seems 1 is normal.
2011-09-13 19:34:27 +00:00
plunky 7f3d4048d7 NULL does not need a cast 2011-08-31 18:31:02 +00:00
rmind e225b7bd09 Welcome to 5.99.53! Merge rmind-uvmplock branch:
- Reorganize locking in UVM and provide extra serialisation for pmap(9).
  New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
  the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
  Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
  kernel-lock on some ports).  Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.
2011-06-12 03:35:36 +00:00
rmind 4a4e52516e Remove cache_purge(9) calls from reclamation routines in the file systems,
as vclean(9) performs it for us since Lite2 merge.
2011-05-19 03:11:55 +00:00
dholland 14402d0ff1 Abolish the SAVENAME and HASBUF flags. There is now always a buffer,
so the path in a struct componentname is now always valid during VOP
calls.
2010-11-30 10:43:01 +00:00
dholland d4eb05390d Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.
2010-11-30 10:29:57 +00:00
christos 0882e5d877 Fix incorrect comments about the buffer size being 2K; it is really 8K now.
From Robert Watson.
2010-08-07 20:39:33 +00:00
christos 014333fdb8 Correct incomplete size checks for the coda ioctls. From Dan Rosenberg. 2010-07-20 17:26:03 +00:00
hannken 245651a23d Remove vlockmgr(). Generic vnode lock operations now use a rwlock located
in the vnode.  All LK_* flags move from sys/lock.h to sys/vnode.h.  Calls
to vlockmgr() in file systems get replaced with VOP_LOCK() or VOP_UNLOCK().

Welcome to 5.99.34.

Discussed on tech-kern.
2010-07-01 13:00:54 +00:00