mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
Cleaning up uio headers
Making uio_impl.h the common header interface between Linux and FreeBSD so both OS's can share a common header file. This also helps reduce code duplication for zfs_uio_t for each OS. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Brian Atkinson <batkinson@lanl.gov> Closes #11622
This commit is contained in:
committed by
Tony Hutter
parent
0b1e6fcc3e
commit
d10c35b640
@@ -78,19 +78,14 @@ typedef struct zfs_uio {
|
||||
#define zfs_uio_rlimit_fsize(z, u) (0)
|
||||
#define zfs_uio_fault_move(p, n, rw, u) zfs_uiomove((p), (n), (rw), (u))
|
||||
|
||||
extern int zfs_uio_prefaultpages(ssize_t, zfs_uio_t *);
|
||||
|
||||
static inline void
|
||||
zfs_uio_setoffset(zfs_uio_t *uio, offset_t off)
|
||||
{
|
||||
uio->uio_loffset = off;
|
||||
}
|
||||
|
||||
static inline void
|
||||
zfs_uio_iov_at_index(zfs_uio_t *uio, uint_t idx, void **base, uint64_t *len)
|
||||
{
|
||||
*base = zfs_uio_iovbase(uio, idx);
|
||||
*len = zfs_uio_iovlen(uio, idx);
|
||||
}
|
||||
|
||||
static inline void
|
||||
zfs_uio_advance(zfs_uio_t *uio, size_t size)
|
||||
{
|
||||
@@ -98,19 +93,6 @@ zfs_uio_advance(zfs_uio_t *uio, size_t size)
|
||||
uio->uio_loffset += size;
|
||||
}
|
||||
|
||||
static inline offset_t
|
||||
zfs_uio_index_at_offset(zfs_uio_t *uio, offset_t off, uint_t *vec_idx)
|
||||
{
|
||||
*vec_idx = 0;
|
||||
while (*vec_idx < zfs_uio_iovcnt(uio) &&
|
||||
off >= zfs_uio_iovlen(uio, *vec_idx)) {
|
||||
off -= zfs_uio_iovlen(uio, *vec_idx);
|
||||
(*vec_idx)++;
|
||||
}
|
||||
|
||||
return (off);
|
||||
}
|
||||
|
||||
static inline void
|
||||
iov_iter_init_compat(struct iov_iter *iter, unsigned int dir,
|
||||
const struct iovec *iov, unsigned long nr_segs, size_t count)
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#ifndef ZFS_CONTEXT_OS_H
|
||||
#define ZFS_CONTEXT_OS_H
|
||||
|
||||
#include <sys/uio_impl.h>
|
||||
#include <linux/dcache_compat.h>
|
||||
#include <linux/utsname_compat.h>
|
||||
#include <linux/compiler_compat.h>
|
||||
|
||||
Reference in New Issue
Block a user