MPSAFE - Add read() and write() path MPSAFE support, and more.
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 14 Jul 2009 03:41:30 +0000 (20:41 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 14 Jul 2009 03:41:30 +0000 (20:41 -0700)
commitc0885fab015851c4716c393c27efdbfc37a7cd67
treec3bb6b2778ed7c41241b16439d3d82f753354130
parent2aff48715ec8dd6c22f60f0c19578a15fe6a67e4
MPSAFE - Add read() and write() path MPSAFE support, and more.

* Add sysctl vfs.read_mpsafe, vfs.write_mpsafe, and vfs.getattr_mpsafe.
  Only vfs.read_mpsafe is currently implemented, and only for HAMMER
  filesystems.

* read() and write() will now call VOP_READ()/VOP_WRITE() without the
  MP lock if the vnode->v_flag says it is ok to do so.

* read() and write() now serialize reads and writes which depend on the
  file offset stored in the fp, when the concurrent operations share the
  same fp.

* Add vnode flags VMP_READ, VMP_WRITE, VMP_GETATTR.

* Add vnode flag VNOTSEEKABLE indicating that fp->f_offset will never be
  used and no serialization is needed (which e.g. can mess up read()'s
  blocking devices such as ttys).

* Correct bug in FIONREAD related to the data field being too small.
sys/kern/vfs_bio.c
sys/kern/vfs_vnops.c
sys/sys/buf.h
sys/sys/device.h
sys/sys/fcntl.h
sys/sys/vnode.h
sys/vfs/fifofs/fifo_vnops.c
sys/vfs/specfs/spec_vnops.c