mirror of https://gitee.com/openkylin/linux.git
btrfs: Replace opencoded sizes with their symbolic constants
Currently btrfs' code uses a mix of opencoded sizes and defines from sizes.h. Let's unifiy the code base to always use the symbolic constants. No functional changes Signed-off-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
859a58a207
commit
d4417e2255
|
@ -523,7 +523,7 @@ struct btrfs_caching_control {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Once caching_thread() finds this much free space, it will wake up waiters. */
|
/* Once caching_thread() finds this much free space, it will wake up waiters. */
|
||||||
#define CACHING_CTL_WAKE_UP (1024 * 1024 * 2)
|
#define CACHING_CTL_WAKE_UP SZ_2M
|
||||||
|
|
||||||
struct btrfs_io_ctl {
|
struct btrfs_io_ctl {
|
||||||
void *cur, *orig;
|
void *cur, *orig;
|
||||||
|
|
|
@ -2733,7 +2733,7 @@ int open_ctree(struct super_block *sb,
|
||||||
sb->s_bdi->congested_fn = btrfs_congested_fn;
|
sb->s_bdi->congested_fn = btrfs_congested_fn;
|
||||||
sb->s_bdi->congested_data = fs_info;
|
sb->s_bdi->congested_data = fs_info;
|
||||||
sb->s_bdi->capabilities |= BDI_CAP_CGROUP_WRITEBACK;
|
sb->s_bdi->capabilities |= BDI_CAP_CGROUP_WRITEBACK;
|
||||||
sb->s_bdi->ra_pages = VM_MAX_READAHEAD * 1024 / PAGE_SIZE;
|
sb->s_bdi->ra_pages = VM_MAX_READAHEAD * SZ_1K / PAGE_SIZE;
|
||||||
sb->s_bdi->ra_pages *= btrfs_super_num_devices(disk_super);
|
sb->s_bdi->ra_pages *= btrfs_super_num_devices(disk_super);
|
||||||
sb->s_bdi->ra_pages = max(sb->s_bdi->ra_pages, SZ_4M / PAGE_SIZE);
|
sb->s_bdi->ra_pages = max(sb->s_bdi->ra_pages, SZ_4M / PAGE_SIZE);
|
||||||
|
|
||||||
|
|
|
@ -2126,7 +2126,7 @@ static int btrfs_statfs(struct dentry *dentry, struct kstatfs *buf)
|
||||||
* succeed even if the Avail is zero. But this is better than the other
|
* succeed even if the Avail is zero. But this is better than the other
|
||||||
* way around.
|
* way around.
|
||||||
*/
|
*/
|
||||||
thresh = 4 * 1024 * 1024;
|
thresh = SZ_4M;
|
||||||
|
|
||||||
if (!mixed && total_free_meta - thresh < block_rsv->size)
|
if (!mixed && total_free_meta - thresh < block_rsv->size)
|
||||||
buf->f_bavail = 0;
|
buf->f_bavail = 0;
|
||||||
|
|
|
@ -770,7 +770,7 @@ static noinline int test_btrfs_get_extent(u32 sectorsize, u32 nodesize)
|
||||||
offset = em->start + em->len;
|
offset = em->start + em->len;
|
||||||
free_extent_map(em);
|
free_extent_map(em);
|
||||||
|
|
||||||
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, 4096 * 1024, 0);
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, SZ_4M, 0);
|
||||||
if (IS_ERR(em)) {
|
if (IS_ERR(em)) {
|
||||||
test_msg("Got an error when we shouldn't have\n");
|
test_msg("Got an error when we shouldn't have\n");
|
||||||
goto out;
|
goto out;
|
||||||
|
|
Loading…
Reference in New Issue