Changeset 77741 in vbox
- Timestamp:
- Mar 17, 2019 3:42:04 AM (6 years ago)
- Location:
- trunk/src/VBox/Additions/linux/sharedfolders
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/sharedfolders/dirops.c
r77708 r77741 288 288 { 289 289 char szDstName[NAME_MAX]; 290 int rc = vbsf_nlscpy(sf_g, szDstName, sizeof(szDstName), pszSrcName, cchSrcName + 1);290 int rc = vbsf_nlscpy(sf_g, szDstName, sizeof(szDstName), pszSrcName, cchSrcName); 291 291 if (rc == 0) { 292 292 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) -
trunk/src/VBox/Additions/linux/sharedfolders/regops.c
r77735 r77741 545 545 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0) 546 546 ssize_t cPagesLocked = get_user_pages_unlocked(uPtrFrom, cPages, papPages, 547 fWrite ? FOLL_WRITE | FOLL_FORCE : FOLL_FORCE);547 fWrite ? FOLL_WRITE | FOLL_FORCE : FOLL_FORCE); 548 548 # elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0) 549 549 ssize_t cPagesLocked = get_user_pages_unlocked(uPtrFrom, cPages, fWrite, 1 /*force*/, papPages); … … 844 844 if (mapping) 845 845 invalidate_inode_pages2_range(mapping, offStart >> PAGE_SHIFT, (offEnd - 1) >> PAGE_SHIFT); 846 # elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 60) 846 # elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 21) 847 if (mapping && mapping->nrpages > 0) 848 invalidate_mapping_pages(mapping, offStart >> PAGE_SHIFT, (offEnd - 1) >> PAGE_SHIFT); 849 # elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 60) && 0 /** @todo invalidate_mapping_pages was added in 2.5.60, but exported in 2.6.21 */ 847 850 if (mapping && mapping->nrpages > 0) 848 851 invalidate_mapping_pages(mapping, offStart >> PAGE_SHIFT, (offEnd - 1) >> PAGE_SHIFT); … … 2692 2695 /** 2693 2696 * Address space (for the page cache) operations for regular files. 2697 * 2698 * @todo the FsPerf touch/flush (mmap) test fails on 4.4.0 (ubuntu 16.04 lts). 2694 2699 */ 2695 2700 struct address_space_operations vbsf_reg_aops = { -
trunk/src/VBox/Additions/linux/sharedfolders/utils.c
r77629 r77741 39 39 int vbsf_nlscpy(struct vbsf_super_info *sf_g, char *name, size_t name_bound_len, const unsigned char *utf8_name, size_t utf8_len) 40 40 { 41 Assert(RTStrNLen(utf8_name, utf8_len) == utf8_len); 42 41 43 if (sf_g->nls) { 42 const char *in; 43 char *out; 44 size_t out_len; 45 size_t out_bound_len; 46 size_t in_bound_len; 47 48 in = utf8_name; 49 in_bound_len = utf8_len; 50 51 out = name; 52 out_len = 0; 53 out_bound_len = name_bound_len; 44 const char *in = utf8_name; 45 size_t in_bound_len = utf8_len; 46 char *out = name; 47 size_t out_bound_len = name_bound_len; 48 size_t out_len = 0; 54 49 55 50 while (in_bound_len) { 56 int nb;57 51 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31) 58 52 unicode_t uni; 59 60 nb = utf8_to_utf32(in, in_bound_len, &uni); 53 int cbInEnc = utf8_to_utf32(in, in_bound_len, &uni); 61 54 #else 62 55 linux_wchar_t uni; 63 64 nb = utf8_mbtowc(&uni, in, in_bound_len); 65 #endif 66 if (nb < 0) { 67 LogFunc(("utf8_mbtowc failed(%s) %x:%d\n", (const char *)utf8_name, *in, in_bound_len)); 56 int cbInEnc = utf8_mbtowc(&uni, in, in_bound_len); 57 #endif 58 if (cbInEnc >= 0) { 59 int cbOutEnc = sf_g->nls->uni2char(uni, out, out_bound_len); 60 if (cbOutEnc >= 0) { 61 /*SFLOG3(("vbsf_nlscpy: cbOutEnc=%d cbInEnc=%d uni=%#x in_bound_len=%u\n", cbOutEnc, cbInEnc, uni, in_bound_len));*/ 62 out += cbOutEnc; 63 out_bound_len -= cbOutEnc; 64 out_len += cbOutEnc; 65 66 in += cbInEnc; 67 in_bound_len -= cbInEnc; 68 } else { 69 SFLOG(("vbsf_nlscpy: nls->uni2char failed with %d on %#x (pos %u in '%s'), out_bound_len=%u\n", 70 cbOutEnc, uni, in - (const char *)utf8_name, (const char *)utf8_name, (unsigned)out_bound_len)); 71 return cbOutEnc; 72 } 73 } else { 74 SFLOG(("vbsf_nlscpy: utf8_to_utf32/utf8_mbtowc failed with %d on %x (pos %u in '%s'), in_bound_len=%u!\n", 75 cbInEnc, *in, in - (const char *)utf8_name, (const char *)utf8_name, (unsigned)in_bound_len)); 68 76 return -EINVAL; 69 77 } 70 in += nb;71 in_bound_len -= nb;72 73 nb = sf_g->nls->uni2char(uni, out, out_bound_len);74 if (nb < 0) {75 LogFunc(("nls->uni2char failed(%s) %x:%d\n", utf8_name, uni, out_bound_len));76 return nb;77 }78 out += nb;79 out_bound_len -= nb;80 out_len += nb;81 78 } 82 79 83 *out = 0;80 *out = '\0'; 84 81 } else { 85 82 if (utf8_len + 1 > name_bound_len) -
trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.c
r77739 r77741 193 193 sf_g->fNlsIsUtf8 = false; 194 194 sf_g->nls = load_nls(info->nls_name); 195 if (!sf_g->nls) { 195 if (sf_g->nls) { 196 SFLOGFLOW(("vbsf_super_info_alloc_and_map_it: nls=%s -> %p\n", info->nls_name, sf_g->nls)); 197 } else { 196 198 SFLOGRELBOTH(("vboxsf: Failed to load nls '%s'!\n", info->nls_name)); 197 199 rc = -EINVAL; … … 206 208 sf_g->fNlsIsUtf8 = false; 207 209 sf_g->nls = load_nls_default(); 210 SFLOGFLOW(("vbsf_super_info_alloc_and_map_it: CONFIG_NLS_DEFAULT=%s -> %p\n", CONFIG_NLS_DEFAULT, sf_g->nls)); 208 211 } else 209 212 sf_g->nls = NULL; -
trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.h
r77739 r77741 59 59 * Logging wrappers. 60 60 */ 61 #if 161 #if 0 62 62 # define TRACE() LogFunc(("tracepoint\n")) 63 # define SFLOGFLOW(aArgs) Log(aArgs) 63 # define SFLOG(aArgs) Log(aArgs) 64 # define SFLOGFLOW(aArgs) LogFlow(aArgs) 64 65 # define SFLOG2(aArgs) Log2(aArgs) 65 66 # define SFLOG3(aArgs) Log3(aArgs) … … 70 71 #else 71 72 # define TRACE() RTLogBackdoorPrintf("%s: tracepoint\n", __FUNCTION__) 73 # define SFLOG(aArgs) RTLogBackdoorPrintf aArgs 72 74 # define SFLOGFLOW(aArgs) RTLogBackdoorPrintf aArgs 73 75 # define SFLOG2(aArgs) RTLogBackdoorPrintf aArgs
Note:
See TracChangeset
for help on using the changeset viewer.