Overview
Comment: | Improved server mode to register all of //xvfs:/ |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
f1d16a395838a54ef57088a86c2d4a05 |
User & Date: | rkeene on 2019-09-17 01:53:07 |
Other Links: | manifest | tags |
Context
2019-09-17
| ||
01:55 | xvfs_perror -> xvfs_strerror, which is what it should have been named check-in: cf56967f97 user: rkeene tags: trunk | |
01:53 | Improved server mode to register all of //xvfs:/ check-in: f1d16a3958 user: rkeene tags: trunk | |
2019-09-16
| ||
22:22 | First implementation of the Server mode of XVFS check-in: 0e05b2a8c7 user: rkeene tags: trunk | |
Changes
Modified Makefile from [d1e12905cd] to [ba72f8ca71].
︙ | |||
13 14 15 16 17 18 19 | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | - + | example.o: example.c xvfs-core.h xvfs-core.c Makefile $(CC) $(CPPFLAGS) -DXVFS_MODE_FLEXIBLE $(CFLAGS) -o example.o -c example.c example.so: example.o Makefile $(CC) $(CFLAGS) $(LDFLAGS) -shared -o example.so example.o $(LIBS) example-client.o: example.c xvfs-core.h Makefile |
︙ |
Modified xvfs-core.c from [15909aa1a5] to [9a0cfd6536].
︙ | |||
515 516 517 518 519 520 521 522 523 524 525 526 527 528 | 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 | + + + | path = xvfs_absolutePath(path); pathStr = xvfs_relativePath(path, instanceInfo); retval = instanceInfo->fsInfo->getStatProc(pathStr, statBuf); if (retval < 0) { XVFS_DEBUG_PRINTF("... failed: %s", xvfs_perror(retval)); Tcl_SetErrno(xvfs_errorToErrno(retval)); retval = -1; } else { XVFS_DEBUG_PUTS("... ok"); } Tcl_DecrRefCount(path); |
︙ | |||
930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 | 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 | + + + + + + + + + + + + - + - - - - + - + + + + + + + + + + + + + + + + + + + + + + + + + | #if defined(XVFS_MODE_FLEXIBLE) static int xvfs_flexible_register(Tcl_Interp *interp, struct Xvfs_FSInfo *fsInfo) { ClientData fsHandlerDataRaw; struct xvfs_tclfs_server_info *fsHandlerData; const Tcl_Filesystem *fsHandler; int (*xvfs_register)(Tcl_Interp *interp, struct Xvfs_FSInfo *fsInfo); Tcl_Obj *rootPathObj; XVFS_DEBUG_ENTER; xvfs_register = &xvfs_standalone_register; rootPathObj = Tcl_NewStringObj(XVFS_ROOT_MOUNTPOINT, -1); if (!rootPathObj) { XVFS_DEBUG_LEAVE; return(xvfs_register(interp, fsInfo)); } Tcl_IncrRefCount(rootPathObj); fsHandler = Tcl_FSGetFileSystemForPath(rootPathObj); Tcl_DecrRefCount(rootPathObj); if (!fsHandler) { XVFS_DEBUG_LEAVE; return(xvfs_register(interp, fsInfo)); } fsHandlerDataRaw = Tcl_FSData(fsHandler); if (!fsHandlerDataRaw) { XVFS_DEBUG_LEAVE; return(xvfs_register(interp, fsInfo)); } fsHandlerData = (struct xvfs_tclfs_server_info *) fsHandlerDataRaw; /* * XXX:TODO: What is the chance that the handler for //xvfs:/ hold * client data smaller than XVFS_INTERNAL_SERVER_MAGIC_LEN ? */ if (memcmp(fsHandlerData->magic, XVFS_INTERNAL_SERVER_MAGIC, sizeof(fsHandlerData->magic)) == 0) { XVFS_DEBUG_PUTS("Found a server handler"); xvfs_register = fsHandlerData->registerProc; } XVFS_DEBUG_LEAVE; return(xvfs_register(interp, fsInfo)); } #endif /* XVFS_MODE_FLEXIBLE */ #if defined(XVFS_MODE_SERVER) static Tcl_Filesystem xvfs_tclfs_dispatch_fs; static Tcl_HashTable xvfs_tclfs_dispatch_map; static struct xvfs_tclfs_server_info xvfs_tclfs_dispatch_fsdata; |
︙ | |||
1025 1026 1027 1028 1029 1030 1031 | 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 | - - - - - - - - - - - - + + + - + - + - + - + - + | XVFS_DEBUG_PUTS("... found no registered filesystem."); } XVFS_DEBUG_LEAVE; return(retval); } |
︙ | |||
1122 1123 1124 1125 1126 1127 1128 | 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 | + - + + + | xvfs_tclfs_dispatch_fs.renameFileProc = NULL; xvfs_tclfs_dispatch_fs.copyDirectoryProc = NULL; xvfs_tclfs_dispatch_fs.lstatProc = NULL; xvfs_tclfs_dispatch_fs.loadFileProc = NULL; xvfs_tclfs_dispatch_fs.getCwdProc = NULL; xvfs_tclfs_dispatch_fs.chdirProc = NULL; memcpy(xvfs_tclfs_dispatch_fsdata.magic, XVFS_INTERNAL_SERVER_MAGIC, XVFS_INTERNAL_SERVER_MAGIC_LEN); |
︙ | |||
1151 1152 1153 1154 1155 1156 1157 | 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 | - + | int Xvfs_Register(Tcl_Interp *interp, struct Xvfs_FSInfo *fsInfo) { Tcl_HashEntry *mapEntry; struct xvfs_tclfs_instance_info *instanceInfo; int dispatchInitRet; int new; |
︙ |
Modified xvfs-core.h from [d0f2e4af12] to [b57f187c12].
︙ | |||
66 67 68 69 70 71 72 73 74 75 76 77 78 79 | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | + | #elif defined(XVFS_MODE_SERVER) /* * In server mode we are going to implementing Xvfs_Register() * for flexible/client modes, just forward declare it */ XVFS_REGISTER_INTERFACE(Xvfs_Register) int Xvfs_Init(Tcl_Interp *interp); #else # error Unsupported XVFS_MODE #endif /* * In flexible or standalone mode, directly include what |
︙ |