Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\iomap\buffered-io.c Create Date:2022-07-28 20:31:56
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:We implement an immediate ioend submission policy here to avoid needing to* chain multiple ioends and hence nest mempool allocations which can violate* forward progress guarantees we need to provide

Proto:static int iomap_writepage_map(struct iomap_writepage_ctx *wpc, struct writeback_control *wbc, struct inode *inode, struct page *page, u64 end_offset)

Type:int

Parameter:

TypeParameterName
struct iomap_writepage_ctx *wpc
struct writeback_control *wbc
struct inode *inode
struct page *page
u64end_offset
1416  iop = to_iomap_page(page)
1418  len = i_blocksize(inode)
1420  error = 0 , count = 0
1421  LIST_HEAD(submit_list)
1423  WARN_ON_ONCE(i_blocksize(inode) < PAGE_SIZE && !iop)
1424  WARN_ON_ONCE(iop && atomic_read( & write_count) != 0)
1431  When i < PAGE_SIZE >> i_blkbits && file_offset < end_offset cycle
1434  If iop && Not st_bit - Determine whether a bit is set*@nr: bit number to test*@addr: Address to start counting from Then Continue
1437  error = map_blocks(wpc, inode, file_offset)
1438  If error Then Break
1440  If WARN_ON_ONCE( type of mapping == data inline in the inode ) Then Continue
1442  If type of mapping == blocks allocated, need allocation Then Continue
1444  Test to see if we have an existing ioend structure that we could append to* first, otherwise finish off the current ioend and start another.
1446  count++
1449  WARN_ON_ONCE(!ioend && !list_empty - tests whether a list is empty*@head: the list to test.)
1450  WARN_ON_ONCE(!PageLocked(page))
1451  WARN_ON_ONCE(Only test-and-set exist for PG_writeback. The unconditional operators are* risky: they bypass page accounting.)
1459  If Value for the false possibility is greater at compile time(error) Then
1460  If Not count Then
1466  If discard_page Then discard_page(page)
1470  Go to done
1481  set_page_writeback_keepwrite(page)
1482  Else
1483  Clear a page's dirty flag, while caring for dirty memory accounting.* Returns true if the page was previously dirty.* This is for preparing to put the page under writeout. We leave the page* tagged as dirty in the xarray so that a concurrent write-for-sync
1484  set_page_writeback(page)
1487  lock_page - unlock a locked page*@page: the page* Unlocks the page and wakes up sleepers in ___wait_on_page_locked().* Also wakes sleepers in wait_on_page_writeback() because the wakeup* mechanism between PageLocked pages and PageWriteback pages is shared.
1497  list_del_init - deletes entry from list and reinitialize it.*@entry: the element to delete from the list.
1498  error2 = Submit the final bio for an ioend.* If @error is non-zero, it means that we have a situation where some part of* the submission process has failed after we have marked paged for writeback* and unlocked them
1499  If error2 && Not error Then error = error2
1507  If Not count Then d_page_writeback - end writeback against a page*@page: the page
1509  done :
1510  mapping_set_error - record a writeback error in the address_space*@mapping - the mapping in which an error should be set*@error - the error to set in the mapping* When writeback fails in some way, we must record that error so that
1511  Return error
Caller
NameDescribe
iomap_do_writepageWrite out a dirty page.* For delalloc space on the page we need to allocate space and flush it.* For unwritten space on the page we need to start the conversion to* regular allocated space.