projects
/
linux-block.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge tag 'mm-stable-2023-04-27-15-30' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-block.git]
/
fs
/
buffer.c
diff --git
a/fs/buffer.c
b/fs/buffer.c
index b0b8c5fba691f411e81b77e7aa6b648a958a5df8..a7fc561758b1ac10816181bc6bd9fcbc1c737925 100644
(file)
--- a/
fs/buffer.c
+++ b/
fs/buffer.c
@@
-308,20
+308,19
@@
static void verify_bh(struct work_struct *work)
struct buffer_head *bh = ctx->bh;
bool valid;
struct buffer_head *bh = ctx->bh;
bool valid;
- valid = fsverity_verify_blocks(page_folio(bh->b_page), bh->b_size,
- bh_offset(bh));
+ valid = fsverity_verify_blocks(bh->b_folio, bh->b_size, bh_offset(bh));
end_buffer_async_read(bh, valid);
kfree(ctx);
}
static bool need_fsverity(struct buffer_head *bh)
{
end_buffer_async_read(bh, valid);
kfree(ctx);
}
static bool need_fsverity(struct buffer_head *bh)
{
- struct
page *page = bh->b_page
;
- struct inode *inode =
page
->mapping->host;
+ struct
folio *folio = bh->b_folio
;
+ struct inode *inode =
folio
->mapping->host;
return fsverity_active(inode) &&
/* needed by ext4 */
return fsverity_active(inode) &&
/* needed by ext4 */
-
page
->index < DIV_ROUND_UP(inode->i_size, PAGE_SIZE);
+
folio
->index < DIV_ROUND_UP(inode->i_size, PAGE_SIZE);
}
static void decrypt_bh(struct work_struct *work)
}
static void decrypt_bh(struct work_struct *work)
@@
-331,8
+330,8
@@
static void decrypt_bh(struct work_struct *work)
struct buffer_head *bh = ctx->bh;
int err;
struct buffer_head *bh = ctx->bh;
int err;
- err = fscrypt_decrypt_pagecache_blocks(
page_folio(bh->b_page)
,
- bh
->b_size, bh
_offset(bh));
+ err = fscrypt_decrypt_pagecache_blocks(
bh->b_folio, bh->b_size
,
+ bh_offset(bh));
if (err == 0 && need_fsverity(bh)) {
/*
* We use different work queues for decryption and for verity
if (err == 0 && need_fsverity(bh)) {
/*
* We use different work queues for decryption and for verity
@@
-2612,7
+2611,7
@@
int block_truncate_page(struct address_space *mapping,
struct inode *inode = mapping->host;
struct page *page;
struct buffer_head *bh;
struct inode *inode = mapping->host;
struct page *page;
struct buffer_head *bh;
- int err;
+ int err
= 0
;
blocksize = i_blocksize(inode);
length = offset & (blocksize - 1);
blocksize = i_blocksize(inode);
length = offset & (blocksize - 1);
@@
-2625,9
+2624,8
@@
int block_truncate_page(struct address_space *mapping,
iblock = (sector_t)index << (PAGE_SHIFT - inode->i_blkbits);
page = grab_cache_page(mapping, index);
iblock = (sector_t)index << (PAGE_SHIFT - inode->i_blkbits);
page = grab_cache_page(mapping, index);
- err = -ENOMEM;
if (!page)
if (!page)
-
goto out
;
+
return -ENOMEM
;
if (!page_has_buffers(page))
create_empty_buffers(page, blocksize, 0);
if (!page_has_buffers(page))
create_empty_buffers(page, blocksize, 0);
@@
-2641,7
+2639,6
@@
int block_truncate_page(struct address_space *mapping,
pos += blocksize;
}
pos += blocksize;
}
- err = 0;
if (!buffer_mapped(bh)) {
WARN_ON(bh->b_size != blocksize);
err = get_block(inode, iblock, bh, 0);
if (!buffer_mapped(bh)) {
WARN_ON(bh->b_size != blocksize);
err = get_block(inode, iblock, bh, 0);
@@
-2665,12
+2662,11
@@
int block_truncate_page(struct address_space *mapping,
zero_user(page, offset, length);
mark_buffer_dirty(bh);
zero_user(page, offset, length);
mark_buffer_dirty(bh);
- err = 0;
unlock:
unlock_page(page);
put_page(page);
unlock:
unlock_page(page);
put_page(page);
-out:
+
return err;
}
EXPORT_SYMBOL(block_truncate_page);
return err;
}
EXPORT_SYMBOL(block_truncate_page);