提交 86324a21 编写于 作者: M Matthew Wilcox 提交者: Theodore Ts'o

ext4: Convert ext4_journalled_zero_new_buffers() to use a folio

Remove a call to compound_head().
Signed-off-by: NMatthew Wilcox (Oracle) <willy@infradead.org>
Link: https://lore.kernel.org/r/20230324180129.1220691-20-willy@infradead.orgSigned-off-by: NTheodore Ts'o <tytso@mit.edu>
上级 feb22b77
......@@ -1359,24 +1359,24 @@ static int ext4_write_end(struct file *file,
*/
static void ext4_journalled_zero_new_buffers(handle_t *handle,
struct inode *inode,
struct page *page,
struct folio *folio,
unsigned from, unsigned to)
{
unsigned int block_start = 0, block_end;
struct buffer_head *head, *bh;
bh = head = page_buffers(page);
bh = head = folio_buffers(folio);
do {
block_end = block_start + bh->b_size;
if (buffer_new(bh)) {
if (block_end > from && block_start < to) {
if (!PageUptodate(page)) {
if (!folio_test_uptodate(folio)) {
unsigned start, size;
start = max(from, block_start);
size = min(to, block_end) - start;
zero_user(page, start, size);
folio_zero_range(folio, start, size);
write_end_fn(handle, inode, bh);
}
clear_buffer_new(bh);
......@@ -1413,10 +1413,11 @@ static int ext4_journalled_write_end(struct file *file,
if (unlikely(copied < len) && !folio_test_uptodate(folio)) {
copied = 0;
ext4_journalled_zero_new_buffers(handle, inode, page, from, to);
ext4_journalled_zero_new_buffers(handle, inode, folio,
from, to);
} else {
if (unlikely(copied < len))
ext4_journalled_zero_new_buffers(handle, inode, page,
ext4_journalled_zero_new_buffers(handle, inode, folio,
from + copied, to);
ret = ext4_walk_page_buffers(handle, inode,
folio_buffers(folio),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册