mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 02:44:41 +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
+20
-1
@@ -42,8 +42,27 @@
|
||||
#include <sys/uio.h>
|
||||
|
||||
extern int zfs_uiomove(void *, size_t, zfs_uio_rw_t, zfs_uio_t *);
|
||||
extern int zfs_uio_prefaultpages(ssize_t, zfs_uio_t *);
|
||||
extern int zfs_uiocopy(void *, size_t, zfs_uio_rw_t, zfs_uio_t *, size_t *);
|
||||
extern void zfs_uioskip(zfs_uio_t *, size_t);
|
||||
|
||||
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 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);
|
||||
}
|
||||
|
||||
#endif /* _SYS_UIO_IMPL_H */
|
||||
|
||||
@@ -72,6 +72,7 @@ extern "C" {
|
||||
#include <sys/trace.h>
|
||||
#include <sys/procfs_list.h>
|
||||
#include <sys/mod.h>
|
||||
#include <sys/uio_impl.h>
|
||||
#include <sys/zfs_context_os.h>
|
||||
#else /* _KERNEL || _STANDALONE */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user