Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/file.h
Show All 29 Lines | |||||
* | * | ||||
* @(#)file.h 8.3 (Berkeley) 1/9/95 | * @(#)file.h 8.3 (Berkeley) 1/9/95 | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _SYS_FILE_H_ | #ifndef _SYS_FILE_H_ | ||||
#define _SYS_FILE_H_ | #define _SYS_FILE_H_ | ||||
#include "sys/fcntl.h" | |||||
kib: What? | |||||
#ifndef _KERNEL | #ifndef _KERNEL | ||||
#include <sys/types.h> /* XXX */ | #include <sys/types.h> /* XXX */ | ||||
#include <sys/fcntl.h> | #include <sys/fcntl.h> | ||||
#include <sys/unistd.h> | #include <sys/unistd.h> | ||||
#else | #else | ||||
#include <sys/queue.h> | #include <sys/queue.h> | ||||
#include <sys/refcount.h> | #include <sys/refcount.h> | ||||
#include <sys/_lock.h> | #include <sys/_lock.h> | ||||
▲ Show 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | |||||
typedef int fo_mmap_t(struct file *fp, vm_map_t map, vm_offset_t *addr, | typedef int fo_mmap_t(struct file *fp, vm_map_t map, vm_offset_t *addr, | ||||
vm_size_t size, vm_prot_t prot, vm_prot_t cap_maxprot, | vm_size_t size, vm_prot_t prot, vm_prot_t cap_maxprot, | ||||
int flags, vm_ooffset_t foff, struct thread *td); | int flags, vm_ooffset_t foff, struct thread *td); | ||||
typedef int fo_aio_queue_t(struct file *fp, struct kaiocb *job); | typedef int fo_aio_queue_t(struct file *fp, struct kaiocb *job); | ||||
typedef int fo_add_seals_t(struct file *fp, int flags); | typedef int fo_add_seals_t(struct file *fp, int flags); | ||||
typedef int fo_get_seals_t(struct file *fp, int *flags); | typedef int fo_get_seals_t(struct file *fp, int *flags); | ||||
typedef int fo_fallocate_t(struct file *fp, off_t offset, off_t len, | typedef int fo_fallocate_t(struct file *fp, off_t offset, off_t len, | ||||
struct thread *td); | struct thread *td); | ||||
typedef int fo_fspacectl_t(struct file *fp, int cmd, | |||||
off_t offset, off_t len, int flags, | |||||
struct ucred *active_cred, struct thread *td); | |||||
typedef int fo_flags_t; | typedef int fo_flags_t; | ||||
struct fileops { | struct fileops { | ||||
fo_rdwr_t *fo_read; | fo_rdwr_t *fo_read; | ||||
fo_rdwr_t *fo_write; | fo_rdwr_t *fo_write; | ||||
fo_truncate_t *fo_truncate; | fo_truncate_t *fo_truncate; | ||||
fo_ioctl_t *fo_ioctl; | fo_ioctl_t *fo_ioctl; | ||||
fo_poll_t *fo_poll; | fo_poll_t *fo_poll; | ||||
fo_kqfilter_t *fo_kqfilter; | fo_kqfilter_t *fo_kqfilter; | ||||
fo_stat_t *fo_stat; | fo_stat_t *fo_stat; | ||||
fo_close_t *fo_close; | fo_close_t *fo_close; | ||||
fo_chmod_t *fo_chmod; | fo_chmod_t *fo_chmod; | ||||
fo_chown_t *fo_chown; | fo_chown_t *fo_chown; | ||||
fo_sendfile_t *fo_sendfile; | fo_sendfile_t *fo_sendfile; | ||||
fo_seek_t *fo_seek; | fo_seek_t *fo_seek; | ||||
fo_fill_kinfo_t *fo_fill_kinfo; | fo_fill_kinfo_t *fo_fill_kinfo; | ||||
fo_mmap_t *fo_mmap; | fo_mmap_t *fo_mmap; | ||||
fo_aio_queue_t *fo_aio_queue; | fo_aio_queue_t *fo_aio_queue; | ||||
fo_add_seals_t *fo_add_seals; | fo_add_seals_t *fo_add_seals; | ||||
fo_get_seals_t *fo_get_seals; | fo_get_seals_t *fo_get_seals; | ||||
fo_fallocate_t *fo_fallocate; | fo_fallocate_t *fo_fallocate; | ||||
fo_fspacectl_t *fo_fspacectl; | |||||
fo_flags_t fo_flags; /* DFLAG_* below */ | fo_flags_t fo_flags; /* DFLAG_* below */ | ||||
}; | }; | ||||
#define DFLAG_PASSABLE 0x01 /* may be passed via unix sockets. */ | #define DFLAG_PASSABLE 0x01 /* may be passed via unix sockets. */ | ||||
#define DFLAG_SEEKABLE 0x02 /* seekable / nonsequential */ | #define DFLAG_SEEKABLE 0x02 /* seekable / nonsequential */ | ||||
#endif /* _KERNEL */ | #endif /* _KERNEL */ | ||||
#if defined(_KERNEL) || defined(_WANT_FILE) | #if defined(_KERNEL) || defined(_WANT_FILE) | ||||
▲ Show 20 Lines • Show All 303 Lines • ▼ Show 20 Lines | |||||
static __inline int | static __inline int | ||||
fo_fallocate(struct file *fp, off_t offset, off_t len, struct thread *td) | fo_fallocate(struct file *fp, off_t offset, off_t len, struct thread *td) | ||||
{ | { | ||||
if (fp->f_ops->fo_fallocate == NULL) | if (fp->f_ops->fo_fallocate == NULL) | ||||
return (ENODEV); | return (ENODEV); | ||||
return ((*fp->f_ops->fo_fallocate)(fp, offset, len, td)); | return ((*fp->f_ops->fo_fallocate)(fp, offset, len, td)); | ||||
} | } | ||||
static __inline int fo_fspacectl(struct file *fp, int cmd, off_t offset, | |||||
off_t len, int flags, struct ucred *active_cred, struct thread *td) | |||||
{ | |||||
if (fp->f_ops->fo_fspacectl == NULL) | |||||
return (ENODEV); | |||||
return ((*fp->f_ops->fo_fspacectl)(fp, cmd, offset, len, flags, | |||||
active_cred, td)); | |||||
} | |||||
#endif /* _KERNEL */ | #endif /* _KERNEL */ | ||||
#endif /* !SYS_FILE_H */ | #endif /* !SYS_FILE_H */ |
What?