Diff

Differences From Artifact [405b834b47]:

To Artifact [1dcdd9bb28]:


   499    499   	int tcl_ret;
   500    500   
   501    501   	interp = appfs_TclInterp();
   502    502   	if (interp == NULL) {
   503    503   		return(-EIO);
   504    504   	}
   505    505   
   506         -	appfs_simulate_user_fs_enter();
   507         -
   508    506   	tcl_ret = appfs_Tcl_Eval(interp, 2, "::appfs::getattr", path);
   509         -
   510         -	appfs_simulate_user_fs_leave();
   511         -
   512    507   	if (tcl_ret != TCL_OK) {
   513    508   		APPFS_DEBUG("::appfs::getattr(%s) failed.", path);
   514    509   		APPFS_DEBUG("Tcl Error is: %s", Tcl_GetStringResult(interp));
   515    510   
   516    511   		return(-ENOENT);
   517    512   	}
   518    513   
................................................................................
   781    776   	if (interp == NULL) {
   782    777   		return(0);
   783    778   	}
   784    779   
   785    780   	filler(buf, ".", NULL, 0);
   786    781   	filler(buf, "..", NULL, 0);
   787    782   
   788         -	appfs_simulate_user_fs_enter();
   789         -
   790    783   	tcl_ret = appfs_Tcl_Eval(interp, 2, "::appfs::getchildren", path);
   791         -
   792         -	appfs_simulate_user_fs_leave();
   793         -
   794    784   	if (tcl_ret != TCL_OK) {
   795    785   		APPFS_DEBUG("::appfs::getchildren(%s) failed.", path);
   796    786   		APPFS_DEBUG("Tcl Error is: %s", Tcl_GetStringResult(interp));
   797    787   
   798    788   		return(0);
   799    789   	}
   800    790   
................................................................................
   849    839   	}
   850    840   
   851    841   	interp = appfs_TclInterp();
   852    842   	if (interp == NULL) {
   853    843   		return(-EIO);
   854    844   	}
   855    845   
   856         -	appfs_simulate_user_fs_enter();
   857         -
   858    846   	tcl_ret = appfs_Tcl_Eval(interp, 3, "::appfs::openpath", path, mode);
   859    847   	if (tcl_ret != TCL_OK) {
   860         -		appfs_simulate_user_fs_leave();
   861         -
   862    848   		APPFS_DEBUG("::appfs::openpath(%s, %s) failed.", path, mode);
   863    849   		APPFS_DEBUG("Tcl Error is: %s", Tcl_GetStringResult(interp));
   864    850   
   865    851   		return(-EIO);
   866    852   	}
   867    853   
   868    854   	real_path = Tcl_GetStringResult(interp);
   869    855   	if (real_path == NULL) {
   870         -		appfs_simulate_user_fs_leave();
   871         -
   872    856   		return(-EIO);
   873    857   	}
   874    858   
   875    859   	APPFS_DEBUG("Translated request to open %s to opening %s (mode = \"%s\")", path, real_path, mode);
   876    860   
   877    861   	fh = open(real_path, fi->flags, 0600);
   878    862   
   879         -	appfs_simulate_user_fs_leave();
   880         -
   881    863   	if (fh < 0) {
   882    864   		return(-EIO);
   883    865   	}
   884    866   
   885    867   	fi->fh = fh;
   886    868   
   887    869   	return(0);
................................................................................
   940    922   		return(-EPERM);
   941    923   	}
   942    924   
   943    925   	if ((mode & S_IFBLK) == S_IFBLK) {
   944    926   		return(-EPERM);
   945    927   	}
   946    928   
   947         -	appfs_simulate_user_fs_enter();
   948         -
   949    929   	real_path = appfs_prepare_to_create(path);
   950    930   	if (real_path == NULL) {
   951         -		appfs_simulate_user_fs_leave();
   952         -
   953    931   		return(-EIO);
   954    932   	}
          933  +
          934  +	appfs_simulate_user_fs_enter();
   955    935   
   956    936   	mknod_ret = mknod(real_path, mode, device);
   957    937   
   958    938   	appfs_simulate_user_fs_leave();
   959    939   
   960    940   	free(real_path);
   961    941   
................................................................................
   976    956   		return(-EPERM);
   977    957   	}
   978    958   
   979    959   	if ((mode & S_IFBLK) == S_IFBLK) {
   980    960   		return(-EPERM);
   981    961   	}
   982    962   
   983         -	appfs_simulate_user_fs_enter();
   984         -
   985    963   	real_path = appfs_prepare_to_create(path);
   986    964   	if (real_path == NULL) {
   987         -		appfs_simulate_user_fs_leave();
   988         -
   989    965   		return(-EIO);
   990    966   	}
          967  +
          968  +	appfs_simulate_user_fs_enter();
   991    969   
   992    970   	fd = creat(real_path, mode);
   993    971   
   994    972   	appfs_simulate_user_fs_leave();
   995    973   
   996    974   	free(real_path);
   997    975   
................................................................................
  1037   1015   	APPFS_DEBUG("Enter (path = %s, ...)", path);
  1038   1016   
  1039   1017   	interp = appfs_TclInterp();
  1040   1018   	if (interp == NULL) {
  1041   1019   		return(-EIO);
  1042   1020   	}
  1043   1021   
  1044         -	appfs_simulate_user_fs_enter();
  1045         -
  1046   1022   	tcl_ret = appfs_Tcl_Eval(interp, 2, "::appfs::unlinkpath", path);
  1047         -
  1048         -	appfs_simulate_user_fs_leave();
  1049         -
  1050   1023   	if (tcl_ret != TCL_OK) {
  1051   1024   		APPFS_DEBUG("::appfs::unlinkpath(%s) failed.", path);
  1052   1025   		APPFS_DEBUG("Tcl Error is: %s", Tcl_GetStringResult(interp));
  1053   1026   
  1054   1027   		return(-EIO);
  1055   1028   	}
  1056   1029   
................................................................................
  1059   1032   
  1060   1033   static int appfs_fuse_mkdir(const char *path, mode_t mode) {
  1061   1034   	char *real_path;
  1062   1035   	int mkdir_ret;
  1063   1036   
  1064   1037   	APPFS_DEBUG("Enter (path = %s, ...)", path);
  1065   1038   
  1066         -	appfs_simulate_user_fs_enter();
  1067   1039   
  1068   1040   	real_path = appfs_prepare_to_create(path);
  1069   1041   	if (real_path == NULL) {
  1070         -		appfs_simulate_user_fs_leave();
  1071         -
  1072   1042   		return(-EIO);
  1073   1043   	}
         1044  +
         1045  +	appfs_simulate_user_fs_enter();
  1074   1046   
  1075   1047   	mkdir_ret = mkdir(real_path, mode);
  1076   1048   
  1077   1049   	appfs_simulate_user_fs_leave();
  1078   1050   
  1079   1051   	free(real_path);
  1080   1052   
................................................................................
  1095   1067   	APPFS_DEBUG("Enter (path = %s, ...)", path);
  1096   1068   
  1097   1069   	interp = appfs_TclInterp();
  1098   1070   	if (interp == NULL) {
  1099   1071   		return(-EIO);
  1100   1072   	}
  1101   1073   
  1102         -	appfs_simulate_user_fs_enter();
  1103         -
  1104   1074   	tcl_ret = appfs_Tcl_Eval(interp, 3, "::appfs::openpath", path, "write");
  1105   1075   	if (tcl_ret != TCL_OK) {
  1106         -		appfs_simulate_user_fs_leave();
  1107         -
  1108   1076   		APPFS_DEBUG("::appfs::openpath(%s, %s) failed.", path, "write");
  1109   1077   		APPFS_DEBUG("Tcl Error is: %s", Tcl_GetStringResult(interp));
  1110   1078   
  1111   1079   		return(-EIO);
  1112   1080   	}
  1113   1081   
  1114   1082   	real_path = Tcl_GetStringResult(interp);
  1115   1083   	if (real_path == NULL) {
  1116         -		appfs_simulate_user_fs_leave();
  1117         -
  1118   1084   		return(-EIO);
  1119   1085   	}
         1086  +
         1087  +	appfs_simulate_user_fs_enter();
  1120   1088   
  1121   1089   	chmod_ret = chmod(real_path, mode);
  1122   1090   
  1123   1091   	appfs_simulate_user_fs_leave();
  1124   1092   
  1125   1093   	return(chmod_ret);
  1126   1094   }