mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
Share zfs_fsync, zfs_read, zfs_write, et al between Linux and FreeBSD
The zfs_fsync, zfs_read, and zfs_write function are almost identical between Linux and FreeBSD. With a little refactoring they can be moved to the common code which is what is done by this commit. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Matt Macy <mmacy@FreeBSD.org> Closes #11078
This commit is contained in:
@@ -53,4 +53,7 @@ struct opensolaris_utsname {
|
||||
|
||||
extern char hw_serial[11];
|
||||
|
||||
#define task_io_account_read(n)
|
||||
#define task_io_account_write(n)
|
||||
|
||||
#endif /* _OPENSOLARIS_SYS_MISC_H_ */
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <sys/vnode.h>
|
||||
struct mount;
|
||||
struct vattr;
|
||||
struct znode;
|
||||
|
||||
int secpolicy_nfs(cred_t *cr);
|
||||
int secpolicy_zfs(cred_t *crd);
|
||||
@@ -57,7 +58,7 @@ int secpolicy_vnode_setattr(cred_t *cr, vnode_t *vp, struct vattr *vap,
|
||||
int unlocked_access(void *, int, cred_t *), void *node);
|
||||
int secpolicy_vnode_create_gid(cred_t *cr);
|
||||
int secpolicy_vnode_setids_setgids(vnode_t *vp, cred_t *cr, gid_t gid);
|
||||
int secpolicy_vnode_setid_retain(vnode_t *vp, cred_t *cr,
|
||||
int secpolicy_vnode_setid_retain(struct znode *zp, cred_t *cr,
|
||||
boolean_t issuidroot);
|
||||
void secpolicy_setid_clear(struct vattr *vap, vnode_t *vp, cred_t *cr);
|
||||
int secpolicy_setid_setsticky_clear(vnode_t *vp, struct vattr *vap,
|
||||
|
||||
@@ -82,6 +82,7 @@ void uioskip(uio_t *uiop, size_t n);
|
||||
#define uio_iovcnt(uio) (uio)->uio_iovcnt
|
||||
#define uio_iovlen(uio, idx) (uio)->uio_iov[(idx)].iov_len
|
||||
#define uio_iovbase(uio, idx) (uio)->uio_iov[(idx)].iov_base
|
||||
#define uio_fault_disable(uio, set)
|
||||
|
||||
static inline void
|
||||
uio_iov_at_index(uio_t *uio, uint_t idx, void **base, uint64_t *len)
|
||||
|
||||
@@ -8,7 +8,7 @@ KERNEL_H = \
|
||||
zfs_dir.h \
|
||||
zfs_ioctl_compat.h \
|
||||
zfs_vfsops_os.h \
|
||||
zfs_vnops.h \
|
||||
zfs_vnops_os.h \
|
||||
zfs_znode_impl.h \
|
||||
zpl.h
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <linux/types.h>
|
||||
|
||||
#define cond_resched() kern_yield(PRI_USER)
|
||||
#define uio_prefaultpages(size, uio) (0)
|
||||
|
||||
#define taskq_create_sysdc(a, b, d, e, p, dc, f) \
|
||||
(taskq_create(a, b, maxclsyspri, d, e, f))
|
||||
|
||||
@@ -26,8 +26,9 @@
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef _SYS_ZFS_VNOPS_H_
|
||||
#define _SYS_ZFS_VNOPS_H_
|
||||
#ifndef _SYS_FS_ZFS_VNOPS_OS_H
|
||||
#define _SYS_FS_ZFS_VNOPS_OS_H
|
||||
|
||||
int dmu_write_pages(objset_t *os, uint64_t object, uint64_t offset,
|
||||
uint64_t size, struct vm_page **ppa, dmu_tx_t *tx);
|
||||
int dmu_read_pages(objset_t *os, uint64_t object, vm_page_t *ma, int count,
|
||||
@@ -39,6 +39,7 @@
|
||||
#include <sys/zfs_acl.h>
|
||||
#include <sys/zil.h>
|
||||
#include <sys/zfs_project.h>
|
||||
#include <vm/vm_object.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -113,7 +114,10 @@ extern minor_t zfsdev_minor_alloc(void);
|
||||
#define Z_ISBLK(type) ((type) == VBLK)
|
||||
#define Z_ISCHR(type) ((type) == VCHR)
|
||||
#define Z_ISLNK(type) ((type) == VLNK)
|
||||
#define Z_ISDIR(type) ((type) == VDIR)
|
||||
|
||||
#define zn_has_cached_data(zp) vn_has_cached_data(ZTOV(zp))
|
||||
#define zn_rlimit_fsize(zp, uio, td) vn_rlimit_fsize(ZTOV(zp), (uio), (td))
|
||||
|
||||
/* Called on entry to each ZFS vnode and vfs operation */
|
||||
#define ZFS_ENTER(zfsvfs) \
|
||||
@@ -175,7 +179,7 @@ extern int zfsfstype;
|
||||
|
||||
extern int zfs_znode_parent_and_name(struct znode *zp, struct znode **dzpp,
|
||||
char *buf);
|
||||
|
||||
extern void zfs_inode_update(struct znode *);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user