Changeset 77444 in vbox
- Timestamp:
- Feb 23, 2019 1:58:10 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 129014
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/sharedfolders/regops.c
r77443 r77444 74 74 75 75 76 /* fops */77 78 static int sf_reg_write_aux(const char *caller, struct sf_glob_info *sf_g,79 struct sf_reg_info *sf_r, void *buf,80 uint32_t * nwritten, uint64_t pos)81 {82 /** @todo bird: yes, kmap() and kmalloc() input only. Since the buffer is83 * contiguous in physical memory (kmalloc or single page), we should84 * use a physical address here to speed things up. */85 int rc = VbglR0SfWrite(&client_handle, &sf_g->map, sf_r->handle,86 pos, nwritten, buf,87 false /* already locked? */ );88 if (RT_FAILURE(rc)) {89 LogFunc(("VbglR0SfWrite failed. caller=%s, rc=%Rrc\n",90 caller, rc));91 return -EPROTO;92 }93 return 0;94 }95 76 96 77 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) \ … … 1255 1236 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) 1256 1237 1238 # if 0 /* unused - see below */ 1239 static int sf_reg_write_aux(const char *caller, struct sf_glob_info *sf_g, 1240 struct sf_reg_info *sf_r, void *buf, 1241 uint32_t * nwritten, uint64_t pos) 1242 { 1243 /** @todo bird: yes, kmap() and kmalloc() input only. Since the buffer is 1244 * contiguous in physical memory (kmalloc or single page), we should 1245 * use a physical address here to speed things up. */ 1246 int rc = VbglR0SfWrite(&client_handle, &sf_g->map, sf_r->handle, 1247 pos, nwritten, buf, 1248 false /* already locked? */ ); 1249 if (RT_FAILURE(rc)) { 1250 LogFunc(("VbglR0SfWrite failed. caller=%s, rc=%Rrc\n", 1251 caller, rc)); 1252 return -EPROTO; 1253 } 1254 return 0; 1255 } 1256 # endif 1257 1258 /** 1259 * Called when writing thru the page cache (which we shouldn't be doing). 1260 */ 1257 1261 int sf_write_begin(struct file *file, struct address_space *mapping, loff_t pos, 1258 1262 unsigned len, unsigned flags, struct page **pagep, 1259 1263 void **fsdata) 1260 1264 { 1261 TRACE(); 1262 #if 0 1263 printk("sf_write_begin: pos=%#llx len=%#x flags=%#x\n", pos, len, flags); 1264 RTLogBackdoorPrintf("sf_write_begin: pos=%#llx len=%#x flags=%#x\n", pos, len, flags); 1265 #endif 1266 /** @todo rig up a FsPerf testcase for this code! */ 1267 1268 return simple_write_begin(file, mapping, pos, len, flags, pagep, 1269 fsdata); 1270 } 1271 1265 /** @todo r=bird: We shouldn't ever get here, should we? Because we don't use 1266 * the page cache for any writes AFAIK. We could just as well use 1267 * simple_write_begin & simple_write_end here if we think we really 1268 * need to have non-NULL function pointers in the table... */ 1269 static uint64_t volatile s_cCalls = 0; 1270 if (s_cCalls++ < 16) { 1271 printk("vboxsf: Unexpected call to sf_write_begin(pos=%#llx len=%#x flags=%#x)! Please report.\n", 1272 (unsigned long long)pos, len, flags); 1273 RTLogBackdoorPrintf("vboxsf: Unexpected call to sf_write_begin(pos=%#llx len=%#x flags=%#x)! Please report.\n", 1274 (unsigned long long)pos, len, flags); 1275 # ifdef WARN_ON 1276 WARN_ON(1); 1277 # endif 1278 } 1279 return simple_write_begin(file, mapping, pos, len, flags, pagep, fsdata); 1280 } 1281 1282 /** 1283 * Called to complete a write thru the page cache (which we shouldn't be doing). 1284 */ 1272 1285 int sf_write_end(struct file *file, struct address_space *mapping, loff_t pos, 1273 1286 unsigned len, unsigned copied, struct page *page, void *fsdata) 1274 1287 { 1288 # if 0 /** @todo r=bird: See sf_write_begin. */ 1275 1289 struct inode *inode = mapping->host; 1276 1290 struct sf_glob_info *sf_g = GET_GLOB_INFO(inode->i_sb); … … 1282 1296 1283 1297 TRACE(); 1284 /** @todo rig up a FsPerf testcase for this code! */1285 1298 1286 1299 buf = kmap(page); … … 1298 1311 1299 1312 unlock_page(page); 1300 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)1313 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0) 1301 1314 put_page(page); 1315 # else 1316 page_cache_release(page); 1317 # endif 1318 return nwritten; 1302 1319 # else 1303 page_cache_release(page);1320 return simple_write_end(file, mapping, pos, len, copied, page, fsdata); 1304 1321 # endif 1305 1306 return nwritten;1307 1322 } 1308 1323
Note:
See TracChangeset
for help on using the changeset viewer.