mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
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 <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Matt Macy <mmacy@FreeBSD.org> Closes #11125
This commit is contained in:
committed by
Tony Hutter
parent
073f3c7826
commit
a909190683
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 *);
|
||||
|
||||
Reference in New Issue
Block a user