diff --git a/inode.c b/inode.c index 98aa40d..53d40bb 100644 --- a/inode.c +++ b/inode.c @@ -394,20 +394,34 @@ static int exfat_get_block(struct inode *inode, sector_t iblock, * For direct read, the unwritten part will be zeroed in * exfat_direct_IO() */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) if (!bh_result->b_folio) goto done; +#else + if (bh_result->b_page) + goto done; +#endif pos -= sb->s_blocksize; size = ei->valid_size - pos; off = pos & (PAGE_SIZE - 1); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) folio_set_bh(bh_result, bh_result->b_folio, off); +#else + set_bh_page(bh_result, bh_result->b_page, off); +#endif err = bh_read(bh_result, 0); if (err < 0) goto unlock_ret; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) folio_zero_segment(bh_result->b_folio, off + size, off + sb->s_blocksize); +#else + zero_user_segment(bh_result->b_page, off + size, + off + sb->s_blocksize); +#endif } else { /* * The range has not been written, clear the mapped flag