]> git.proxmox.com Git - mirror_spl.git/commitdiff
Missing headers, more minor fixes
authorbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>
Sat, 15 Mar 2008 00:05:38 +0000 (00:05 +0000)
committerbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>
Sat, 15 Mar 2008 00:05:38 +0000 (00:05 +0000)
git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@48 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

include/dmu_config.h [new file with mode: 0644]
include/sys/cred.h
include/sys/mount.h [new file with mode: 0644]
include/sys/sdt.h [new file with mode: 0644]
include/sys/vfs.h
include/sys/vmsystm.h

diff --git a/include/dmu_config.h b/include/dmu_config.h
new file mode 100644 (file)
index 0000000..e69de29
index 5ed233b0ba6d57a09096a1d8929e2218ba2e7a2b..1e7d3b7c9fb1b324437479b9d344c0edd8677c77 100644 (file)
@@ -7,6 +7,7 @@ extern "C" {
 
 #include <linux/module.h>
 #include <sys/types.h>
+#include <sys/vfs.h>
 
 /* 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 (file)
index 0000000..435dd44
--- /dev/null
@@ -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 (file)
index 0000000..1f94f4a
--- /dev/null
@@ -0,0 +1,4 @@
+#ifndef _SPL_SDT_H
+#define _SPL_SDT_H
+
+#endif /* SPL_SDT_H */
index 6bc0a42ae4f1b105ff015643fa0cfae069dd42f2..e0044f771c2228da527ee8d7ac911c81947275ef 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef _SPL_ZFS_H
 #define _SPL_ZFS_H
 
-typedef struct vfs_s {
+typedef struct vfs {
        int foo;
 } vfs_t;
 
index 443c376c9ada20373e6f4a31734d787e419fd730..568cb3775ced35ac9deecd04f257948765f83213 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <linux/mm.h>
 #include <sys/types.h>
+#include <asm/uaccess.h>
 
 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 */