@@ -501,16 +501,11 @@ interp = appfs_TclInterp(); if (interp == NULL) { return(-EIO); } - appfs_simulate_user_fs_enter(); - tcl_ret = appfs_Tcl_Eval(interp, 2, "::appfs::getattr", path); - - appfs_simulate_user_fs_leave(); - if (tcl_ret != TCL_OK) { APPFS_DEBUG("::appfs::getattr(%s) failed.", path); APPFS_DEBUG("Tcl Error is: %s", Tcl_GetStringResult(interp)); return(-ENOENT); @@ -783,16 +778,11 @@ } filler(buf, ".", NULL, 0); filler(buf, "..", NULL, 0); - appfs_simulate_user_fs_enter(); - tcl_ret = appfs_Tcl_Eval(interp, 2, "::appfs::getchildren", path); - - appfs_simulate_user_fs_leave(); - if (tcl_ret != TCL_OK) { APPFS_DEBUG("::appfs::getchildren(%s) failed.", path); APPFS_DEBUG("Tcl Error is: %s", Tcl_GetStringResult(interp)); return(0); @@ -851,35 +841,27 @@ interp = appfs_TclInterp(); if (interp == NULL) { return(-EIO); } - appfs_simulate_user_fs_enter(); - tcl_ret = appfs_Tcl_Eval(interp, 3, "::appfs::openpath", path, mode); if (tcl_ret != TCL_OK) { - appfs_simulate_user_fs_leave(); - APPFS_DEBUG("::appfs::openpath(%s, %s) failed.", path, mode); APPFS_DEBUG("Tcl Error is: %s", Tcl_GetStringResult(interp)); return(-EIO); } real_path = Tcl_GetStringResult(interp); if (real_path == NULL) { - appfs_simulate_user_fs_leave(); - return(-EIO); } APPFS_DEBUG("Translated request to open %s to opening %s (mode = \"%s\")", path, real_path, mode); fh = open(real_path, fi->flags, 0600); - appfs_simulate_user_fs_leave(); - if (fh < 0) { return(-EIO); } fi->fh = fh; @@ -942,18 +924,16 @@ if ((mode & S_IFBLK) == S_IFBLK) { return(-EPERM); } - appfs_simulate_user_fs_enter(); - real_path = appfs_prepare_to_create(path); if (real_path == NULL) { - appfs_simulate_user_fs_leave(); - return(-EIO); } + + appfs_simulate_user_fs_enter(); mknod_ret = mknod(real_path, mode, device); appfs_simulate_user_fs_leave(); @@ -978,18 +958,16 @@ if ((mode & S_IFBLK) == S_IFBLK) { return(-EPERM); } - appfs_simulate_user_fs_enter(); - real_path = appfs_prepare_to_create(path); if (real_path == NULL) { - appfs_simulate_user_fs_leave(); - return(-EIO); } + + appfs_simulate_user_fs_enter(); fd = creat(real_path, mode); appfs_simulate_user_fs_leave(); @@ -1039,16 +1017,11 @@ interp = appfs_TclInterp(); if (interp == NULL) { return(-EIO); } - appfs_simulate_user_fs_enter(); - tcl_ret = appfs_Tcl_Eval(interp, 2, "::appfs::unlinkpath", path); - - appfs_simulate_user_fs_leave(); - if (tcl_ret != TCL_OK) { APPFS_DEBUG("::appfs::unlinkpath(%s) failed.", path); APPFS_DEBUG("Tcl Error is: %s", Tcl_GetStringResult(interp)); return(-EIO); @@ -1061,18 +1034,17 @@ char *real_path; int mkdir_ret; APPFS_DEBUG("Enter (path = %s, ...)", path); - appfs_simulate_user_fs_enter(); real_path = appfs_prepare_to_create(path); if (real_path == NULL) { - appfs_simulate_user_fs_leave(); - return(-EIO); } + + appfs_simulate_user_fs_enter(); mkdir_ret = mkdir(real_path, mode); appfs_simulate_user_fs_leave(); @@ -1097,28 +1069,24 @@ interp = appfs_TclInterp(); if (interp == NULL) { return(-EIO); } - appfs_simulate_user_fs_enter(); - tcl_ret = appfs_Tcl_Eval(interp, 3, "::appfs::openpath", path, "write"); if (tcl_ret != TCL_OK) { - appfs_simulate_user_fs_leave(); - APPFS_DEBUG("::appfs::openpath(%s, %s) failed.", path, "write"); APPFS_DEBUG("Tcl Error is: %s", Tcl_GetStringResult(interp)); return(-EIO); } real_path = Tcl_GetStringResult(interp); if (real_path == NULL) { - appfs_simulate_user_fs_leave(); - return(-EIO); } + + appfs_simulate_user_fs_enter(); chmod_ret = chmod(real_path, mode); appfs_simulate_user_fs_leave();