summaryrefslogtreecommitdiff
path: root/include/linux/buffer_head.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2023-09-23 05:35:55 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2023-09-23 05:35:55 -0400
commit5804c19b80bf625c6a9925317f845e497434d6d3 (patch)
treeba4a0bf9cac721e2bf898e3be5ab64773da5a9d2 /include/linux/buffer_head.h
parent916e3e5f26abc165437950daff370c0693572ef4 (diff)
parent071ef070ca77e6dfe33fd78afa293e83422f0411 (diff)
downloadlinux-5804c19b80bf625c6a9925317f845e497434d6d3.tar.gz
linux-5804c19b80bf625c6a9925317f845e497434d6d3.tar.bz2
linux-5804c19b80bf625c6a9925317f845e497434d6d3.zip
Merge tag 'kvm-riscv-fixes-6.6-1' of https://github.com/kvm-riscv/linux into HEAD
KVM/riscv fixes for 6.6, take #1 - Fix KVM_GET_REG_LIST API for ISA_EXT registers - Fix reading ISA_EXT register of a missing extension - Fix ISA_EXT register handling in get-reg-list test - Fix filtering of AIA registers in get-reg-list test
Diffstat (limited to 'include/linux/buffer_head.h')
-rw-r--r--include/linux/buffer_head.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 4ede47649a81..44e9de51eedf 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -171,7 +171,10 @@ static __always_inline int buffer_uptodate(const struct buffer_head *bh)
return test_bit_acquire(BH_Uptodate, &bh->b_state);
}
-#define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK)
+static inline unsigned long bh_offset(const struct buffer_head *bh)
+{
+ return (unsigned long)(bh)->b_data & (page_size(bh->b_page) - 1);
+}
/* If we *know* page->private refers to buffer_heads */
#define page_buffers(page) \