summaryrefslogtreecommitdiffstats
path: root/sys/sys/file.h
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2013-08-21 17:36:01 +0000
committerkib <kib@FreeBSD.org>2013-08-21 17:36:01 +0000
commit6a459eb27c6a215b645e8673b5275f94003510a4 (patch)
tree6d3150c62239e19e8c4f26b32d07e284cd50fd1d /sys/sys/file.h
parenta3e8f2c6dc03b8fa8727dd48f5055f20459d8b18 (diff)
downloadFreeBSD-src-6a459eb27c6a215b645e8673b5275f94003510a4.zip
FreeBSD-src-6a459eb27c6a215b645e8673b5275f94003510a4.tar.gz
Make the seek a method of the struct fileops.
Tested by: pho Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/sys/file.h')
-rw-r--r--sys/sys/file.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/sys/file.h b/sys/sys/file.h
index cc4e900..72c512f 100644
--- a/sys/sys/file.h
+++ b/sys/sys/file.h
@@ -108,6 +108,8 @@ typedef int fo_chown_t(struct file *fp, uid_t uid, gid_t gid,
typedef int fo_sendfile_t(struct file *fp, int sockfd, struct uio *hdr_uio,
struct uio *trl_uio, off_t offset, size_t nbytes,
off_t *sent, int flags, int kflags, struct thread *td);
+typedef int fo_seek_t(struct file *fp, off_t offset, int whence,
+ struct thread *td);
typedef int fo_flags_t;
struct fileops {
@@ -122,6 +124,7 @@ struct fileops {
fo_chmod_t *fo_chmod;
fo_chown_t *fo_chown;
fo_sendfile_t *fo_sendfile;
+ fo_seek_t *fo_seek;
fo_flags_t fo_flags; /* DFLAG_* below */
};
@@ -242,6 +245,7 @@ fo_chown_t invfo_chown;
fo_sendfile_t invfo_sendfile;
fo_sendfile_t vn_sendfile;
+fo_seek_t vn_seek;
void finit(struct file *, u_int, short, void *, struct fileops *);
int fgetvp(struct thread *td, int fd, cap_rights_t rights, struct vnode **vpp);
@@ -370,6 +374,13 @@ fo_sendfile(struct file *fp, int sockfd, struct uio *hdr_uio,
nbytes, sent, flags, kflags, td));
}
+static __inline int
+fo_seek(struct file *fp, off_t offset, int whence, struct thread *td)
+{
+
+ return ((*fp->f_ops->fo_seek)(fp, offset, whence, td));
+}
+
#endif /* _KERNEL */
#endif /* !SYS_FILE_H */
OpenPOWER on IntegriCloud