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:
Matthew Macy
2020-10-31 09:40:08 -07:00
committed by GitHub
parent 2f94e8f09e
commit 8583540c6e
8 changed files with 112 additions and 188 deletions
+6
View File
@@ -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.
-2
View File
@@ -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,