Fixups for pending branches after PAGE_CACHE_/page_cache_ removal
David Sterba
maintainercover Fixups for pending branches after PAGE_CACHE_/page_cache_ removal
Hi,
merge tests of current for-next to master lead to build failures, because some of the branches still used the PAGE_CACHE_ macros. As I don't want to do rebases, there are fixups committed on top of the respective branches.
These are:
* device delete by id, from Anand Jain
* enospc rework, from Josef Bacik
David Sterba (2):
btrfs: btrfs_read_disk_super: PAGE_CACHE_ removal related fixups
btrfs: __btrfs_buffered_write: PAGE_CACHE_ removal related fixups
David Sterba
maintainerPATCH 1/2 btrfs: btrfs_read_disk_super: PAGE_CACHE_ removal related fixups
The PAGE_CACHE_* macros and page_cache_* helpers are gone in the next merging target (4.7), so we have to fix that before the "delete device by id" branch gets merged. Fixed only instances introduced by this patchset.
--- fs/btrfs/volumes.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
fs/btrfs/volumes.c +6 -6
@@ -1006,7 +1006,7 @@ int btrfs_open_devices(struct btrfs_fs_devices *fs_devices,void btrfs_release_disk_super (struct page *page) {kunmap (page); -page_cache_release (page); +put_page (page); } int btrfs_read_disk_super(struct block_device *bdev, u64 bytenr,
@@ -1016,16 +1016,16 @@ int btrfs_read_disk_super(struct block_device *bdev, u64 bytenr,pgoff_t index;/* make sure our super fits in the device */ -if (bytenr +PAGE_CACHE_SIZE >=i_size_read (bdev->bd_inode)) +if (bytenr +PAGE_SIZE >=i_size_read (bdev->bd_inode))return 1 ;/* make sure our super fits in the page */ -if (sizeof (**disk_super) >PAGE_CACHE_SIZE ) +if (sizeof (**disk_super) >PAGE_SIZE )return 1 ;/* make sure our super doesn't straddle pages on disk */ - index = bytenr >>PAGE_CACHE_SHIFT ; -if ((bytenr +sizeof (**disk_super) -1 ) >>PAGE_CACHE_SHIFT != index) + index = bytenr >>PAGE_SHIFT ; +if ((bytenr +sizeof (**disk_super) -1 ) >>PAGE_SHIFT != index)return 1 ;/* pull in the page with our super */
@@ -1038,7 +1038,7 @@ int btrfs_read_disk_super(struct block_device *bdev, u64 bytenr, p =kmap (*page);/* align our pointer to the offset of the super block */ - *disk_super = p + (bytenr & ~PAGE_CACHE_MASK ); + *disk_super = p + (bytenr & ~PAGE_MASK );if (btrfs_super_bytenr (*disk_super) != bytenr ||btrfs_super_magic (*disk_super) !=BTRFS_MAGIC ) {
Signature · 1 line
2.7.1
David Sterba
maintainerPATCH 2/2 btrfs: __btrfs_buffered_write: PAGE_CACHE_ removal related fixups
In reply to David SterbaThe PAGE_CACHE_* macros and page_cache_* helpers are gone in the next merging target (4.7), so we have to fix that before the "enospc rework" branch gets merged. Fixed only instances introduced by this patchset.
--- fs/btrfs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/file.c +1 -1
@@ -1549,7 +1549,7 @@ static noinline ssize_t __btrfs_buffered_write(struct file *file,* write_bytes, so scale down. */ num_pages =DIV_ROUND_UP (write_bytes + offset, -PAGE_CACHE_SIZE ); +PAGE_SIZE ); reserve_bytes =round_up (write_bytes + sector_offset, root->sectorsize);
Signature · 1 line
2.7.1