summaryrefslogtreecommitdiffstats
path: root/sys/sys
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2014-09-12 21:29:10 +0000
committerjhb <jhb@FreeBSD.org>2014-09-12 21:29:10 +0000
commit4cd91e9d81f8eee5a5ab7b6250d49c03383d1b96 (patch)
treefc1dbe779c09eb00d34cdab6782e26b3e78ede72 /sys/sys
parent94540ef6a561ec6b2ed88ec5b146d1a6a0b9a297 (diff)
downloadFreeBSD-src-4cd91e9d81f8eee5a5ab7b6250d49c03383d1b96.zip
FreeBSD-src-4cd91e9d81f8eee5a5ab7b6250d49c03383d1b96.tar.gz
Fix various issues with invalid file operations:
- Add invfo_rdwr() (for read and write), invfo_ioctl(), invfo_poll(), and invfo_kqfilter() for use by file types that do not support the respective operations. Home-grown versions of invfo_poll() were universally broken (they returned an errno value, invfo_poll() uses poll_no_poll() to return an appropriate event mask). Home-grown ioctl routines also tended to return an incorrect errno (invfo_ioctl returns ENOTTY). - Use the invfo_*() functions instead of local versions for unsupported file operations. - Reorder fileops members to match the order in the structure definition to make it easier to spot missing members. - Add several missing methods to linuxfileops used by the OFED shim layer: fo_write(), fo_truncate(), fo_kqfilter(), and fo_stat(). Most of these used invfo_*(), but a dummy fo_stat() implementation was added.
Diffstat (limited to 'sys/sys')
-rw-r--r--sys/sys/file.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/sys/file.h b/sys/sys/file.h
index 63072e0..92f125f 100644
--- a/sys/sys/file.h
+++ b/sys/sys/file.h
@@ -231,10 +231,14 @@ int fget_write(struct thread *td, int fd, cap_rights_t *rightsp,
struct file **fpp);
int _fdrop(struct file *fp, struct thread *td);
+fo_rdwr_t invfo_rdwr;
+fo_truncate_t invfo_truncate;
+fo_ioctl_t invfo_ioctl;
+fo_poll_t invfo_poll;
+fo_kqfilter_t invfo_kqfilter;
fo_chmod_t invfo_chmod;
fo_chown_t invfo_chown;
fo_sendfile_t invfo_sendfile;
-fo_truncate_t invfo_truncate;
fo_sendfile_t vn_sendfile;
fo_seek_t vn_seek;
OpenPOWER on IntegriCloud