summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2003-08-01 22:54:07 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2003-08-01 22:54:07 +0000
commit02c53351e5780dad7037e1b60ec826987b28f231 (patch)
treef3e83cb8a87b41f73d7882e92575c2840c0cf923 /sys
parentaaf2ea778011805413a4efe8fafae8212af7cfdb (diff)
move fileops out of file, and make it pretty. ok deraadt@ millert@
Diffstat (limited to 'sys')
-rw-r--r--sys/sys/file.h33
1 files changed, 15 insertions, 18 deletions
diff --git a/sys/sys/file.h b/sys/sys/file.h
index aa6fbd31339..6ab14a6b7ff 100644
--- a/sys/sys/file.h
+++ b/sys/sys/file.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.h,v 1.20 2003/07/18 23:02:58 tedu Exp $ */
+/* $OpenBSD: file.h,v 1.21 2003/08/01 22:54:06 tedu Exp $ */
/* $NetBSD: file.h,v 1.11 1995/03/26 20:24:13 jtc Exp $ */
/*
@@ -43,6 +43,19 @@ struct uio;
struct knote;
struct stat;
+struct fileops {
+ int (*fo_read)(struct file *, off_t *, struct uio *,
+ struct ucred *);
+ int (*fo_write)(struct file *, off_t *, struct uio *,
+ struct ucred *);
+ int (*fo_ioctl)(struct file *, u_long, caddr_t,
+ struct proc *);
+ int (*fo_select)(struct file *, int, struct proc *);
+ int (*fo_kqfilter)(struct file *, struct knote *);
+ int (*fo_stat)(struct file *, struct stat *, struct proc *);
+ int (*fo_close)(struct file *, struct proc *);
+};
+
/*
* Kernel descriptor table.
* One entry for each open kernel vnode and socket.
@@ -60,23 +73,7 @@ struct file {
long f_count; /* reference count */
long f_msgcount; /* references from message queue */
struct ucred *f_cred; /* credentials associated with descriptor */
- struct fileops {
- int (*fo_read)(struct file *fp, off_t *,
- struct uio *uio,
- struct ucred *cred);
- int (*fo_write)(struct file *fp, off_t *,
- struct uio *uio,
- struct ucred *cred);
- int (*fo_ioctl)(struct file *fp, u_long com,
- caddr_t data, struct proc *p);
- int (*fo_select)(struct file *fp, int which,
- struct proc *p);
- int (*fo_kqfilter)(struct file *fp,
- struct knote *kn);
- int (*fo_stat)(struct file *fp, struct stat *sb,
- struct proc *p);
- int (*fo_close)(struct file *fp, struct proc *p);
- } *f_ops;
+ struct fileops *f_ops;
off_t f_offset;
void *f_data; /* private data */
int f_iflags; /* internal flags */