diff options
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index e2b54d546b7c..bd0f45fb38c4 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -1025,16 +1025,16 @@ int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder, | |||
1025 | } | 1025 | } |
1026 | 1026 | ||
1027 | /* make sure our super fits in the device */ | 1027 | /* make sure our super fits in the device */ |
1028 | if (bytenr + PAGE_CACHE_SIZE >= i_size_read(bdev->bd_inode)) | 1028 | if (bytenr + PAGE_SIZE >= i_size_read(bdev->bd_inode)) |
1029 | goto error_bdev_put; | 1029 | goto error_bdev_put; |
1030 | 1030 | ||
1031 | /* make sure our super fits in the page */ | 1031 | /* make sure our super fits in the page */ |
1032 | if (sizeof(*disk_super) > PAGE_CACHE_SIZE) | 1032 | if (sizeof(*disk_super) > PAGE_SIZE) |
1033 | goto error_bdev_put; | 1033 | goto error_bdev_put; |
1034 | 1034 | ||
1035 | /* make sure our super doesn't straddle pages on disk */ | 1035 | /* make sure our super doesn't straddle pages on disk */ |
1036 | index = bytenr >> PAGE_CACHE_SHIFT; | 1036 | index = bytenr >> PAGE_SHIFT; |
1037 | if ((bytenr + sizeof(*disk_super) - 1) >> PAGE_CACHE_SHIFT != index) | 1037 | if ((bytenr + sizeof(*disk_super) - 1) >> PAGE_SHIFT != index) |
1038 | goto error_bdev_put; | 1038 | goto error_bdev_put; |
1039 | 1039 | ||
1040 | /* pull in the page with our super */ | 1040 | /* pull in the page with our super */ |
@@ -1047,7 +1047,7 @@ int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder, | |||
1047 | p = kmap(page); | 1047 | p = kmap(page); |
1048 | 1048 | ||
1049 | /* align our pointer to the offset of the super block */ | 1049 | /* align our pointer to the offset of the super block */ |
1050 | disk_super = p + (bytenr & ~PAGE_CACHE_MASK); | 1050 | disk_super = p + (bytenr & ~PAGE_MASK); |
1051 | 1051 | ||
1052 | if (btrfs_super_bytenr(disk_super) != bytenr || | 1052 | if (btrfs_super_bytenr(disk_super) != bytenr || |
1053 | btrfs_super_magic(disk_super) != BTRFS_MAGIC) | 1053 | btrfs_super_magic(disk_super) != BTRFS_MAGIC) |
@@ -1075,7 +1075,7 @@ int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder, | |||
1075 | 1075 | ||
1076 | error_unmap: | 1076 | error_unmap: |
1077 | kunmap(page); | 1077 | kunmap(page); |
1078 | page_cache_release(page); | 1078 | put_page(page); |
1079 | 1079 | ||
1080 | error_bdev_put: | 1080 | error_bdev_put: |
1081 | blkdev_put(bdev, flags); | 1081 | blkdev_put(bdev, flags); |
@@ -6527,7 +6527,7 @@ int btrfs_read_sys_array(struct btrfs_root *root) | |||
6527 | * but sb spans only this function. Add an explicit SetPageUptodate call | 6527 | * but sb spans only this function. Add an explicit SetPageUptodate call |
6528 | * to silence the warning eg. on PowerPC 64. | 6528 | * to silence the warning eg. on PowerPC 64. |
6529 | */ | 6529 | */ |
6530 | if (PAGE_CACHE_SIZE > BTRFS_SUPER_INFO_SIZE) | 6530 | if (PAGE_SIZE > BTRFS_SUPER_INFO_SIZE) |
6531 | SetPageUptodate(sb->pages[0]); | 6531 | SetPageUptodate(sb->pages[0]); |
6532 | 6532 | ||
6533 | write_extent_buffer(sb, super_copy, 0, BTRFS_SUPER_INFO_SIZE); | 6533 | write_extent_buffer(sb, super_copy, 0, BTRFS_SUPER_INFO_SIZE); |