diff options
author | Matthew Macy <[email protected]> | 2020-10-31 09:40:08 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2020-10-31 09:40:08 -0700 |
commit | 8583540c6e04135626fe301ace8aa51212826965 (patch) | |
tree | e2004d3fc24cff6de6f7e6caac3b6bfc08320db6 /include | |
parent | 2f94e8f09ee37e83d9e74332e125c02841364639 (diff) |
Consolidate zfs_holey and zfs_access
The zfs_holey() and zfs_access() functions can be made common
to both FreeBSD and Linux.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: Matt Macy <[email protected]>
Closes #11125
Diffstat (limited to 'include')
-rw-r--r-- | include/os/freebsd/spl/sys/misc.h | 5 | ||||
-rw-r--r-- | include/os/linux/spl/sys/vnode.h | 6 | ||||
-rw-r--r-- | include/os/linux/zfs/sys/zfs_vnops_os.h | 2 | ||||
-rw-r--r-- | include/sys/zfs_vnops.h | 7 |
4 files changed, 14 insertions, 6 deletions
diff --git a/include/os/freebsd/spl/sys/misc.h b/include/os/freebsd/spl/sys/misc.h index f2dcdbb9f..3481507d2 100644 --- a/include/os/freebsd/spl/sys/misc.h +++ b/include/os/freebsd/spl/sys/misc.h @@ -30,6 +30,7 @@ #define _OPENSOLARIS_SYS_MISC_H_ #include <sys/limits.h> +#include <sys/filio.h> #define MAXUID UID_MAX @@ -40,8 +41,8 @@ #define _FIOGDIO (INT_MIN+1) #define _FIOSDIO (INT_MIN+2) -#define _FIO_SEEK_DATA FIOSEEKDATA -#define _FIO_SEEK_HOLE FIOSEEKHOLE +#define F_SEEK_DATA FIOSEEKDATA +#define F_SEEK_HOLE FIOSEEKHOLE struct opensolaris_utsname { char *sysname; diff --git a/include/os/linux/spl/sys/vnode.h b/include/os/linux/spl/sys/vnode.h index 6f17db89f..64c270650 100644 --- a/include/os/linux/spl/sys/vnode.h +++ b/include/os/linux/spl/sys/vnode.h @@ -52,6 +52,12 @@ #define F_FREESP 11 /* Free file space */ + +#if defined(SEEK_HOLE) && defined(SEEK_DATA) +#define F_SEEK_DATA SEEK_DATA +#define F_SEEK_HOLE SEEK_HOLE +#endif + /* * The vnode AT_ flags are mapped to the Linux ATTR_* flags. * This allows them to be used safely with an iattr structure. diff --git a/include/os/linux/zfs/sys/zfs_vnops_os.h b/include/os/linux/zfs/sys/zfs_vnops_os.h index 1c9cdf7bf..df307fc03 100644 --- a/include/os/linux/zfs/sys/zfs_vnops_os.h +++ b/include/os/linux/zfs/sys/zfs_vnops_os.h @@ -40,10 +40,8 @@ extern "C" { extern int zfs_open(struct inode *ip, int mode, int flag, cred_t *cr); extern int zfs_close(struct inode *ip, int flag, cred_t *cr); -extern int zfs_holey(struct inode *ip, int cmd, loff_t *off); extern int zfs_write_simple(znode_t *zp, const void *data, size_t len, loff_t pos, size_t *resid); -extern int zfs_access(struct inode *ip, int mode, int flag, cred_t *cr); extern int zfs_lookup(znode_t *dzp, char *nm, znode_t **zpp, int flags, cred_t *cr, int *direntflags, pathname_t *realpnp); extern int zfs_create(znode_t *dzp, char *name, vattr_t *vap, int excl, diff --git a/include/sys/zfs_vnops.h b/include/sys/zfs_vnops.h index e59925342..b2767cb0e 100644 --- a/include/sys/zfs_vnops.h +++ b/include/sys/zfs_vnops.h @@ -29,8 +29,11 @@ extern int zfs_fsync(znode_t *, int, cred_t *); extern int zfs_read(znode_t *, uio_t *, int, cred_t *); extern int zfs_write(znode_t *, uio_t *, int, cred_t *); -extern int zfs_getsecattr(znode_t *zp, vsecattr_t *vsecp, int flag, cred_t *cr); -extern int zfs_setsecattr(znode_t *zp, vsecattr_t *vsecp, int flag, cred_t *cr); +extern int zfs_holey(znode_t *, ulong_t, loff_t *); +extern int zfs_access(znode_t *, int, int, cred_t *); + +extern int zfs_getsecattr(znode_t *, vsecattr_t *, int, cred_t *); +extern int zfs_setsecattr(znode_t *, vsecattr_t *, int, cred_t *); extern int mappedread(znode_t *, int, uio_t *); extern int mappedread_sf(znode_t *, int, uio_t *); |