Commit Graph

224 Commits

Author SHA1 Message Date
dholland
1fbab01a93 More on PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers (I think) all the MI headers outside of external/ (and dist/).
2015-09-06 06:00:59 +00:00
christos
e7ae23fd9e include "ioconf.h" to get the 'void <driver>attach(int count);' prototype. 2015-08-20 14:40:16 +00:00
hannken
e10a32f7f7 Remove miscfs/syncfs and
- move the syncer into kern/vfs_subr.c.

- change the syncer to process the mountlist and VFS_SYNC as appropriate.

- use an API for mount points similiar to the API for vnodes:
  - vfs_syncer_add_to_worklist(struct mount *mp) to add
  - vfs_syncer_remove_from_worklist(struct mount *mp) to remove a mount.

No objections on tech-kern@
2015-05-06 15:57:07 +00:00
riastradh
46e71c7d57 Make VOP_LINK return directory still locked and referenced.
Ride 7.99.10 bump.
2015-04-20 22:59:19 +00:00
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