Commit Graph

229 Commits

Author SHA1 Message Date
riastradh 87fb32292e Make VOP_INACTIVE preserve vnode lock on return.
Discussed on tech-kern:
https://mail-index.netbsd.org/tech-kern/2017/04/01/msg021751.html

Ride 7.99.68, a bumpy bus of incremental vfs improvements!
2017-04-11 14:24:59 +00:00
hannken 0007fb2f2b Use spec_node_lookup_by_dev() and spec_node_getmountedfs() to
retrieve a mount by device.
2017-04-04 07:36:38 +00:00
hannken 326db3aaf6 Add generic genfs_suspendctl() and use it for all file systems.
Layered file systems need work.
2017-02-17 08:31:23 +00:00
hannken 7139aab724 Remove now obsolete operation vcache_remove().
Welcome to 7.99.36
2016-08-20 12:37:06 +00:00
msaitoh 8bc54e5be6 KNF. Remove extra spaces. No functional change. 2016-07-07 06:55:38 +00:00
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