Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\buffer.c Create Date:2022-07-28 20:14:10
Last Modify:2020-03-18 10:38:29 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:lock_write_begin takes care of the basic task of block allocation and* bringing partial write blocks uptodate first.* The filesystem needs to handle block truncation upon failure.

Proto:int block_write_begin(struct address_space *mapping, loff_t pos, unsigned len, unsigned flags, struct page **pagep, get_block_t *get_block)

Type:int

Parameter:

TypeParameterName
struct address_space *mapping
loff_tpos
unsignedlen
unsignedflags
struct page **pagep
get_block_t *get_block
2109  index = pos >> PAGE_SHIFT determines the page size
2113  page = Find or create a page at the given pagecache position. Return the locked* page. This function is specifically for buffered writes.
2114  If Not page Then Return -ENOMEM
2117  status = __block_write_begin(page, pos, len, get_block)
2118  If Value for the false possibility is greater at compile time(status) Then
2119  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.
2120  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
2121  page = NULL
2124  pagep = page
2125  Return status
Caller
NameDescribe
cont_write_beginFor moronic filesystems that do not allow holes in file.* We may have to extend the file.
blkdev_write_begin