Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src convert to newstyle automagic rump compat syscalls



details:   https://anonhg.NetBSD.org/src/rev/bbef7177e612
branches:  trunk
changeset: 756484:bbef7177e612
user:      pooka <pooka%NetBSD.org@localhost>
date:      Mon Jul 19 15:35:38 2010 +0000

description:
convert to newstyle automagic rump compat syscalls

diffstat:

 lib/libukfs/ukfs.c        |  36 +++---------------------------------
 tests/fs/umapfs/t_basic.c |  11 ++---------
 tests/fs/vfs/t_vnops.c    |   7 +------
 3 files changed, 6 insertions(+), 48 deletions(-)

diffs (116 lines):

diff -r 7c08a6030ddf -r bbef7177e612 lib/libukfs/ukfs.c
--- a/lib/libukfs/ukfs.c        Mon Jul 19 15:33:16 2010 +0000
+++ b/lib/libukfs/ukfs.c        Mon Jul 19 15:35:38 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ukfs.c,v 1.51 2010/06/24 13:03:05 hannken Exp $        */
+/*     $NetBSD: ukfs.c,v 1.52 2010/07/19 15:35:38 pooka Exp $  */
 
 /*
  * Copyright (c) 2007, 2008, 2009  Antti Kantee.  All Rights Reserved.
@@ -1034,40 +1034,13 @@
        return rv;
 }
 
-/*
- * If we want to use post-time_t file systems on pre-time_t hosts,
- * we must translate the stat structure.  Since we don't currently
- * have a general method for making compat calls in rump, special-case
- * this one.
- *
- * Note that this does not allow making system calls to older rump
- * kernels from newer hosts.
- */
-#define VERS_TIMECHANGE 599000700
-
-static int
-needcompat(void)
-{
-
-#ifdef __NetBSD__
-       /*LINTED*/
-       return __NetBSD_Version__ < VERS_TIMECHANGE
-           && rump_pub_getversion() >= VERS_TIMECHANGE;
-#else
-       return 0;
-#endif
-}
-
 int
 ukfs_stat(struct ukfs *ukfs, const char *filename, struct stat *file_stat)
 {
        int rv;
 
        precall(ukfs);
-       if (needcompat())
-               rv = rump_pub_sys___stat30(filename, file_stat);
-       else
-               rv = rump_sys_stat(filename, file_stat);
+       rv = rump_sys_stat(filename, file_stat);
        postcall(ukfs);
 
        return rv;
@@ -1079,10 +1052,7 @@
        int rv;
 
        precall(ukfs);
-       if (needcompat())
-               rv = rump_pub_sys___lstat30(filename, file_stat);
-       else
-               rv = rump_sys_lstat(filename, file_stat);
+       rv = rump_sys_lstat(filename, file_stat);
        postcall(ukfs);
 
        return rv;
diff -r 7c08a6030ddf -r bbef7177e612 tests/fs/umapfs/t_basic.c
--- a/tests/fs/umapfs/t_basic.c Mon Jul 19 15:33:16 2010 +0000
+++ b/tests/fs/umapfs/t_basic.c Mon Jul 19 15:35:38 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_basic.c,v 1.3 2010/05/31 23:44:54 pooka Exp $        */
+/*     $NetBSD: t_basic.c,v 1.4 2010/07/19 15:35:39 pooka Exp $        */
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -28,13 +28,6 @@
        atf_tc_set_md_var(tc, "descr", "basic umapfs mapping");
 }
 
-/* deal with time_t change for running this on 5.0 */
-#if __NetBSD_Prereq__(5,99,7)
-#define statfn rump_sys_stat
-#else
-#define statfn rump_pub_sys___stat30
-#endif
-
 static void
 xtouch(const char *path)
 {
@@ -59,7 +52,7 @@
 {
        struct stat sb;
 
-       if (statfn(path, &sb) == -1)
+       if (rump_sys_stat(path, &sb) == -1)
                atf_tc_fail_errno("stat %s", path);
        if (uid != (uid_t)-1) {
                if (sb.st_uid != uid)
diff -r 7c08a6030ddf -r bbef7177e612 tests/fs/vfs/t_vnops.c
--- a/tests/fs/vfs/t_vnops.c    Mon Jul 19 15:33:16 2010 +0000
+++ b/tests/fs/vfs/t_vnops.c    Mon Jul 19 15:35:38 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_vnops.c,v 1.3 2010/07/16 19:16:41 pooka Exp $        */
+/*     $NetBSD: t_vnops.c,v 1.4 2010/07/19 15:35:39 pooka Exp $        */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -40,11 +40,6 @@
 #include "../common/h_fsmacros.h"
 #include "../../h_macros.h"
 
-/* make work when run with 5.0 userland */
-#if defined(__NetBSD_Version__) && (__NetBSD_Version__ < 599000700)
-#define rump_sys_stat rump_pub_sys___stat30
-#endif
-
 #define USES_DIRS \
     if (FSTYPE_SYSVBFS(tc)) atf_tc_skip("dirs not supported by file system")
 



Home | Main Index | Thread Index | Old Index