Overview
Comment: | Fixed inode lookup and determination of a file being packaged or not |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
1e2435553a4cdb1c2e2d07cf0d2fe706 |
User & Date: | rkeene on 2015-07-31 03:02:37 |
Other Links: | manifest | tags |
Context
2015-10-14
| ||
17:47 | Changed mount options to remove "direct_io", which breaks mmap and performed additional cleanups check-in: 1c47ca9097 user: rkeene tags: trunk | |
2015-07-31
| ||
03:02 | Fixed inode lookup and determination of a file being packaged or not check-in: 1e2435553a user: rkeene tags: trunk | |
2015-05-26
| ||
15:46 | Post-release version increment check-in: f90c4863fb user: rkeene tags: trunk | |
Changes
Modified appfsd.c from [388927f9ca] to [647fdab61a].
︙ | |||
646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 | 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 | + + + + | } if (uid >= 0) { retval += uid; retval++; } APPFS_DEBUG("Looked up inode number for path=%s,uid=%i: %u", path, uid, retval); return(retval); } /* * Cache Get Path Info lookups for speed */ static int appfs_get_path_info_cache_get(const char *path, uid_t uid, struct appfs_pathinfo *pathinfo) { unsigned int hash_idx; int pthread_ret; int retval; retval = 1; pthread_ret = pthread_mutex_lock(&appfs_path_info_cache_mutex); if (pthread_ret != 0) { APPFS_DEBUG("Unable to lock path_info cache mutex !"); return(-1); } APPFS_DEBUG("Looking up cache entry for path=%s,uid=%lli...", path, (long long) uid); if (appfs_path_info_cache != NULL) { hash_idx = (appfs_get_path_inode(path, uid)) % appfs_path_info_cache_size; if (appfs_path_info_cache[hash_idx]._cache_path != NULL) { if (strcmp(appfs_path_info_cache[hash_idx]._cache_path, path) == 0 && appfs_path_info_cache[hash_idx]._cache_uid == uid) { retval = 0; |
︙ | |||
687 688 689 690 691 692 693 | 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 | - + - + | if (pthread_ret != 0) { APPFS_DEBUG("Unable to unlock path_info cache mutex !"); return(-1); } if (retval == 0) { |
︙ | |||
1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 | 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 | + + | if (pathinfo->packaged) { pathinfo->inode = appfs_get_path_inode(path, -1); } else { pathinfo->inode = appfs_get_path_inode(path, fsuid); } APPFS_DEBUG("Caching inode for path=%s,uid=%lli as %llu (packaged = %i)", path, (long long) fsuid, pathinfo->inode, pathinfo->packaged); if (retval == 0) { appfs_get_path_info_cache_add(path, fsuid, pathinfo); } else { APPFS_DEBUG("error: Invalid type for \"%s\" from Tcl", path); } return(retval); |
︙ | |||
1211 1212 1213 1214 1215 1216 1217 | 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 | + - - + + - + + | case APPFS_PATHTYPE_FILE: stbuf->st_mode = S_IFREG | 0444; if (pathinfo.typeinfo.file.executable) { stbuf->st_mode |= 0111; } if (pathinfo.packaged) { |
︙ | |||
1250 1251 1252 1253 1254 1255 1256 | 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 | - + | break; case APPFS_PATHTYPE_INVALID: retval = -EIO; break; } |
︙ | |||
2016 2017 2018 2019 2020 2021 2022 | 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 | - + | #else appfs_threaded_tcl = 0; #endif /** ** Add FUSE arguments which we always supply **/ |
︙ |
Modified appfsd.tcl from [a394650d8e] to [e7e131fd9c].
︙ | |||
675 676 677 678 679 680 681 682 683 684 685 686 687 688 | 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 | + + | array set retval [list] catch { ::appfs::getindex $pathinfo(hostname) ::appfs::getpkgmanifest $pathinfo(hostname) $pathinfo(package_sha1) } set retval(path_type) $pathinfo(_type) switch -- $pathinfo(_type) { "toplevel" { set retval(type) directory set retval(childcount) [llength [getchildren $path]] } "sites" { set check [::appfs::db onecolumn {SELECT 1 FROM packages WHERE hostname = $pathinfo(hostname);}] |
︙ | |||
752 753 754 755 756 757 758 759 760 761 762 763 764 765 | 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 | + | file lstat $localpath localpathinfo } } } if {$localpath != "" && [info exists localpathinfo]} { set retval(is_localfile) 1 unset retval(packaged) catch { set retval(time) $localpathinfo(mtime) switch -- $localpathinfo(type) { "directory" { set retval(type) "directory" set retval(childcount) [llength [getchildren $path]] |
︙ | |||
837 838 839 840 841 842 843 | 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 | - + | return [array get retval] } proc openpath {path mode} { array set pathinfo [_parsepath $path] if {$pathinfo(_type) != "files"} { |
︙ | |||
901 902 903 904 905 906 907 | 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 | - + | return $localcachefile } proc localpath {path} { array set pathinfo [_parsepath $path] if {$pathinfo(_type) != "files"} { |
︙ | |||
950 951 952 953 954 955 956 | 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 | - - + + | return $filename } proc unlinkpath {path} { array set pathattrs [exists $path] |
︙ |