]> git.proxmox.com Git - mirror_spl-debian.git/commitdiff
Add copyin/copyout mapping
authorbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>
Wed, 12 Mar 2008 21:33:28 +0000 (21:33 +0000)
committerbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>
Wed, 12 Mar 2008 21:33:28 +0000 (21:33 +0000)
Fix some vnode types

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@40 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

include/sys/sysmacros.h
include/sys/vmsystm.h
include/sys/vnode.h
modules/spl/spl-generic.c
modules/spl/spl-vnode.c
modules/splat/splat-vnode.c

index 076f2678497ad70541ba129dbeaaa686087e6e4a..e0a3eec0c22cf50f0b8e8672d1c99c4281fb7bf0 100644 (file)
@@ -113,9 +113,12 @@ extern "C" {
 
 /* Missing globals */
 extern int p0;
+extern char hw_serial[11];
 
 /* Missing misc functions */
 extern int highbit(unsigned long i);
+extern int ddi_strtoul(const char *hw_serial, char **nptr,
+                      int base, unsigned long *result);
 
 #define makedevice(maj,min) makedev(maj,min)
 #define zone_dataset_visible(x, y)                     (1)
index e66872f0c0218eace74682da71a500fefb2de8b9..bb23da965b5f1315fd36b98be46f52d840a80182 100644 (file)
@@ -7,6 +7,9 @@
 #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)
+
 #if 0
 /* The approximate total number of free pages */
 #define freemem                                0
index 7583d04d428906980bba2209029a143a06064c95..0e5e401740bccc2584cc2e6339c598bfee3d27e6 100644 (file)
@@ -49,7 +49,8 @@
 #define AT_SEQ         0x08000
 #define AT_XVATTR      0x10000
 
-#define CRCREAT                0
+#define CRCREAT                0x01
+#define RMFILE         0x02
 
 typedef enum vtype {
        VNON            = 0,
@@ -132,11 +133,11 @@ extern int vn_openat(const char *path, int seg, int flags, int mode,
 extern int vn_rdwr(uio_rw_t uio, vnode_t *vp, void *addr, ssize_t len,
                   offset_t off, int seg, int x1, rlim64_t x2,
                   void *x3, ssize_t *residp);
-extern int vn_close(vnode_t *vp, int flags, int x1, int x2, int x3, int x4);
-extern int vn_remove(const char *path, int x1, int x2);
+extern int vn_close(vnode_t *vp, int flags, int x1, int x2, void *x3, void *x4);
+extern int vn_remove(const char *path, int seg, int flags);
 extern int vn_rename(const char *path1, const char *path2, int x1);
 extern int vn_getattr(vnode_t *vp, vattr_t *vap, int flags, int x3, void *x4);
-extern int vn_fsync(vnode_t *vp, int flags, int x3, int x4);
+extern int vn_fsync(vnode_t *vp, int flags, void *x3, void *x4);
 
 #define VOP_CLOSE                              vn_close
 #define VN_RELE(vp)
index 1f982f8bdcca1388b4d201318c64948ead732545..52d06b827a5c3465dffb38cf03ac51e6850d50b3 100644 (file)
@@ -8,6 +8,9 @@
 int p0 = 0;
 EXPORT_SYMBOL(p0);
 
+char hw_serial[11];
+EXPORT_SYMBOL(hw_serial);
+
 int
 highbit(unsigned long i)
 {
@@ -39,8 +42,17 @@ highbit(unsigned long i)
 }
 EXPORT_SYMBOL(highbit);
 
+int
+ddi_strtoul(const char *str, char **nptr, int base, unsigned long *result)
+{
+        char *end;
+        return (*result = simple_strtoul(str, &end, base));
+}
+EXPORT_SYMBOL(ddi_strtoul);
+
 static int __init spl_init(void)
 {
+       strcpy(hw_serial, "007f0100"); /* loopback */
         printk(KERN_INFO "spl: Loaded Solaris Porting Layer v%s\n", VERSION);
        return 0;
 }
index 9024909b8779ac41f4c017a3b023152bd570c79f..a1f6a680ea362a66e56c8b2a2d894e56b125d605 100644 (file)
@@ -159,7 +159,7 @@ vn_rdwr(uio_rw_t uio, vnode_t *vp, void *addr, ssize_t len, offset_t off,
 EXPORT_SYMBOL(vn_rdwr);
 
 int
-vn_close(vnode_t *vp, int flags, int x1, int x2, int x3, int x4)
+vn_close(vnode_t *vp, int flags, int x1, int x2, void *x3, void *x4)
 {
        int rc;
 
@@ -180,13 +180,16 @@ static struct dentry *lookup_hash(struct nameidata *nd)
 
 /* Modified do_unlinkat() from linux/fs/namei.c, only uses exported symbols */
 int
-vn_remove(const char *path, int x1, int x2)
+vn_remove(const char *path, int seg, int flags)
 {
         struct dentry *dentry;
         struct nameidata nd;
         struct inode *inode = NULL;
         int rc = 0;
 
+       BUG_ON(seg != UIO_SYSSPACE);
+       BUG_ON(flags != RMFILE);
+
         rc = path_lookup(path, LOOKUP_PARENT, &nd);
         if (rc)
                 goto exit;
@@ -348,7 +351,7 @@ vn_getattr(vnode_t *vp, vattr_t *vap, int flags, int x3, void *x4)
 }
 EXPORT_SYMBOL(vn_getattr);
 
-int vn_fsync(vnode_t *vp, int flags, int x3, int x4)
+int vn_fsync(vnode_t *vp, int flags, void *x3, void *x4)
 {
        BUG_ON(!vp);
        BUG_ON(!vp->v_fp);
index 188448db81778a6dc384aa80fc8c21f153285a7f..402872d6b9aa53ec0d012d57b59fbef3d2dba96b 100644 (file)
@@ -147,7 +147,7 @@ splat_vnode_test3(struct file *file, void *arg)
 out:
         VOP_CLOSE(vp, 0, 0, 0, 0, 0);
         VN_RELE(vp);
-       vn_remove(SPLAT_VNODE_TEST_FILE_RW, 0, 0);
+       vn_remove(SPLAT_VNODE_TEST_FILE_RW, UIO_SYSSPACE, RMFILE);
 
         return rc;
 } /* splat_vnode_test3() */
@@ -226,8 +226,8 @@ out2:
         VOP_CLOSE(vp, 0, 0, 0, 0, 0);
         VN_RELE(vp);
 out:
-       vn_remove(SPLAT_VNODE_TEST_FILE_RW1, 0, 0);
-       vn_remove(SPLAT_VNODE_TEST_FILE_RW2, 0, 0);
+       vn_remove(SPLAT_VNODE_TEST_FILE_RW1, UIO_SYSSPACE, RMFILE);
+       vn_remove(SPLAT_VNODE_TEST_FILE_RW2, UIO_SYSSPACE, RMFILE);
 
         return rc;
 } /* splat_vnode_test4() */
@@ -312,7 +312,7 @@ splat_vnode_test6(struct file *file, void *arg)
 out:
         VOP_CLOSE(vp, 0, 0, 0, 0, 0);
         VN_RELE(vp);
-       vn_remove(SPLAT_VNODE_TEST_FILE_RW, 0, 0);
+       vn_remove(SPLAT_VNODE_TEST_FILE_RW, UIO_SYSSPACE, RMFILE);
 
         return rc;
 } /* splat_vnode_test4() */