Function report |
Source Code:fs\dax.c |
Create Date:2022-07-28 20:23:17 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:dax_iomap_pte_fault
Proto:static vm_fault_t dax_iomap_pte_fault(struct vm_fault *vmf, pfn_t *pfnp, int *iomap_errp, const struct iomap_ops *ops)
Type:vm_fault_t
Parameter:
Type | Parameter | Name |
---|---|---|
struct vm_fault * | vmf | |
pfn_t * | pfnp | |
int * | iomap_errp | |
const struct iomap_ops * | ops |
1253 | pos = pgoff << PAGE_SHIFT determines the page size |
1254 | struct iomap iomap = { type of mapping = blocks allocated, need allocation } |
1255 | struct iomap srcmap = { type of mapping = blocks allocated, need allocation } |
1256 | flags = mapping for page fault |
1257 | major = 0 |
1258 | write = flags & Fault was a write access |
1260 | ret = 0 |
1264 | trace_dax_pte_fault(inode, vmf, ret) |
1271 | ret = VM_FAULT_SIGBUS |
1272 | Go to out |
1275 | If write && Not cow_page Then flags |= writing, must allocate blocks |
1280 | ret = xa_to_internal() - Extract the value from an internal entry.*@entry: XArray entry.* Context: Any context.* Return: The value which was stored in the internal entry. |
1281 | Go to out |
1290 | If pmd_trans_huge( * pmd) || pmd_devmap( * pmd) Then |
1291 | ret = VM_FAULT_NOPAGE |
1292 | Go to unlock_entry |
1301 | If iomap_errp Then iomap_errp = error |
1303 | If error Then |
1304 | ret = dax_fault_return(error) |
1305 | Go to unlock_entry |
1307 | If WARN_ON_ONCE( file offset of mapping, bytes + length of mapping, bytes < pos + PAGE_SIZE) Then |
1309 | Go to error_finish_iomap |
1312 | If cow_page Then |
1313 | sector = dax_iomap_sector( & iomap, pos) |
1316 | Case type of mapping == blocks allocated, need allocation |
1320 | Case type of mapping == locks allocated at @addr |
1321 | error = copy_user_dax( block device for I/O , dax_dev for dax operations , sector, PAGE_SIZE, cow_page, vaddr) |
1323 | Break |
1324 | Default |
1330 | If error Then Go to error_finish_iomap |
1333 | __SetPageUptodate(cow_page) |
1335 | If Not ret Then ret = VM_FAULT_DONE_COW |
1337 | Go to finish_iomap |
1340 | sync = MAP_SYNC on a dax mapping guarantees dirty metadata is* flushed on write-faults (non-cow), but not read-faults. |
1343 | Case type of mapping == locks allocated at @addr |
1345 | Disable counters |
1347 | major = VM_FAULT_MAJOR |
1350 | If error < 0 Then Go to error_finish_iomap |
1353 | entry = By this point grab_mapping_entry() has ensured that we have a locked entry* of the appropriate size so we don't have to worry about downgrading PMDs to* PTEs |
1362 | If sync Then |
1363 | If WARN_ON_ONCE(!pfnp) Then |
1365 | Go to error_finish_iomap |
1368 | ret = VM_FAULT_NEEDDSYNC | major |
1369 | Go to finish_iomap |
1371 | trace_dax_insert_mapping(inode, vmf, entry) |
1374 | Else ret = vmf_insert_mixed(vma, vaddr, pfn) |
1377 | Go to finish_iomap |
1379 | Case type of mapping == blocks allocated, need allocation |
1380 | If Not write Then |
1382 | Go to finish_iomap |
1385 | Default |
1391 | error_finish_iomap : |
1392 | ret = dax_fault_return(error) |
1393 | finish_iomap : |
1394 | If iomap_end Then |
1397 | If ret & VM_FAULT_ERROR Then copied = 0 |
1407 | unlock_entry : |
1409 | out : |
1410 | trace_dax_pte_fault_done(inode, vmf, ret) |
Name | Describe |
---|---|
dax_iomap_fault | dax_iomap_fault - handle a page fault on a DAX file*@vmf: The description of the fault*@pe_size: Size of the page to fault in*@pfnp: PFN to insert for synchronous faults if fsync is required*@iomap_errp: Storage for detailed error code in case of |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |