diff --git a/include/dmu_config.h b/include/dmu_config.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/include/sys/cred.h b/include/sys/cred.h index 5ed233b0ba..1e7d3b7c9f 100644 --- a/include/sys/cred.h +++ b/include/sys/cred.h @@ -7,6 +7,7 @@ extern "C" { #include #include +#include /* XXX - Portions commented out because we really just want to have the type * defined and the contents aren't nearly so important at the moment. */ diff --git a/include/sys/mount.h b/include/sys/mount.h new file mode 100644 index 0000000000..435dd44c42 --- /dev/null +++ b/include/sys/mount.h @@ -0,0 +1,4 @@ +#ifndef _SPL_MOUNT_H +#define _SPL_MOUNT_H + +#endif /* SPL_MOUNT_H */ diff --git a/include/sys/sdt.h b/include/sys/sdt.h new file mode 100644 index 0000000000..1f94f4a1d3 --- /dev/null +++ b/include/sys/sdt.h @@ -0,0 +1,4 @@ +#ifndef _SPL_SDT_H +#define _SPL_SDT_H + +#endif /* SPL_SDT_H */ diff --git a/include/sys/vfs.h b/include/sys/vfs.h index 6bc0a42ae4..e0044f771c 100644 --- a/include/sys/vfs.h +++ b/include/sys/vfs.h @@ -1,7 +1,7 @@ #ifndef _SPL_ZFS_H #define _SPL_ZFS_H -typedef struct vfs_s { +typedef struct vfs { int foo; } vfs_t; diff --git a/include/sys/vmsystm.h b/include/sys/vmsystm.h index 443c376c9a..568cb3775c 100644 --- a/include/sys/vmsystm.h +++ b/include/sys/vmsystm.h @@ -3,6 +3,7 @@ #include #include +#include extern vmem_t *zio_alloc_arena; /* arena for zio caches */ @@ -10,8 +11,45 @@ extern vmem_t *zio_alloc_arena; /* arena for zio caches */ #define ptob(pages) (pages * PAGE_SIZE) #define membar_producer() smp_wmb() -#define copyin(from, to, size) copy_from_user(to, from, size) -#define copyout(from, to, size) copy_to_user(to, from, size) +#define xcopyin(from, to, size) copy_from_user(to, from, size) +#define xcopyout(from, to, size) copy_to_user(to, from, size) + +static __inline__ int +copyin(const void *from, void *to, size_t len) +{ + /* On error copyin routine returns -1 */ + if (xcopyin(from, to, len)) + return -1; + + return 0; +} + +static __inline__ int +copyout(const void *from, void *to, size_t len) +{ + /* On error copyout routine returns -1 */ + if (xcopyout(from, to, len)) + return -1; + + return 0; +} + +static __inline__ int +copyinstr(const void *from, void *to, size_t len, size_t *done) +{ + if (len == 0) + return -ENAMETOOLONG; + + if (len < 0) + return -EFAULT; + + /* XXX: Should return ENAMETOOLONG if 'strlen(from) > len' */ + + memset(to, 0, len); + *done = copyin(from, to, len - 1); + + return 0; +} #if 0 /* The approximate total number of free pages */