Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 21380931 authored by Joel Becker's avatar Joel Becker Committed by Chris Mason
Browse files

Btrfs: Fix a bunch of printk() warnings.



Just happened to notice a bunch of %llu vs u64 warnings.  Here's a patch
to cast them all.

Signed-off-by: default avatarJoel Becker <joel.becker@oracle.com>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent e63b6a6c
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -1671,7 +1671,7 @@ struct btrfs_root *open_ctree(struct super_block *sb,
	if (features) {
	if (features) {
		printk(KERN_ERR "BTRFS: couldn't mount because of "
		printk(KERN_ERR "BTRFS: couldn't mount because of "
		       "unsupported optional features (%Lx).\n",
		       "unsupported optional features (%Lx).\n",
		       features);
		       (unsigned long long)features);
		err = -EINVAL;
		err = -EINVAL;
		goto fail_iput;
		goto fail_iput;
	}
	}
@@ -1681,7 +1681,7 @@ struct btrfs_root *open_ctree(struct super_block *sb,
	if (!(sb->s_flags & MS_RDONLY) && features) {
	if (!(sb->s_flags & MS_RDONLY) && features) {
		printk(KERN_ERR "BTRFS: couldn't mount RDWR because of "
		printk(KERN_ERR "BTRFS: couldn't mount RDWR because of "
		       "unsupported option features (%Lx).\n",
		       "unsupported option features (%Lx).\n",
		       features);
		       (unsigned long long)features);
		err = -EINVAL;
		err = -EINVAL;
		goto fail_iput;
		goto fail_iput;
	}
	}
@@ -2273,7 +2273,7 @@ int close_ctree(struct btrfs_root *root)


	if (fs_info->delalloc_bytes) {
	if (fs_info->delalloc_bytes) {
		printk(KERN_INFO "btrfs: at unmount delalloc count %llu\n",
		printk(KERN_INFO "btrfs: at unmount delalloc count %llu\n",
		       fs_info->delalloc_bytes);
		       (unsigned long long)fs_info->delalloc_bytes);
	}
	}
	if (fs_info->total_ref_cache_size) {
	if (fs_info->total_ref_cache_size) {
		printk(KERN_INFO "btrfs: at umount reference cache size %llu\n",
		printk(KERN_INFO "btrfs: at umount reference cache size %llu\n",
+14 −7
Original line number Original line Diff line number Diff line
@@ -1844,10 +1844,14 @@ int btrfs_check_data_free_space(struct btrfs_root *root, struct inode *inode,
		printk(KERN_ERR "no space left, need %llu, %llu delalloc bytes"
		printk(KERN_ERR "no space left, need %llu, %llu delalloc bytes"
		       ", %llu bytes_used, %llu bytes_reserved, "
		       ", %llu bytes_used, %llu bytes_reserved, "
		       "%llu bytes_pinned, %llu bytes_readonly, %llu may use"
		       "%llu bytes_pinned, %llu bytes_readonly, %llu may use"
		       "%llu total\n", bytes, data_sinfo->bytes_delalloc,
		       "%llu total\n", (unsigned long long)bytes,
		       data_sinfo->bytes_used, data_sinfo->bytes_reserved,
		       (unsigned long long)data_sinfo->bytes_delalloc,
		       data_sinfo->bytes_pinned, data_sinfo->bytes_readonly,
		       (unsigned long long)data_sinfo->bytes_used,
		       data_sinfo->bytes_may_use, data_sinfo->total_bytes);
		       (unsigned long long)data_sinfo->bytes_reserved,
		       (unsigned long long)data_sinfo->bytes_pinned,
		       (unsigned long long)data_sinfo->bytes_readonly,
		       (unsigned long long)data_sinfo->bytes_may_use,
		       (unsigned long long)data_sinfo->total_bytes);
		return -ENOSPC;
		return -ENOSPC;
	}
	}
	data_sinfo->bytes_may_use += bytes;
	data_sinfo->bytes_may_use += bytes;
@@ -2824,9 +2828,12 @@ static void dump_space_info(struct btrfs_space_info *info, u64 bytes)
				    info->bytes_pinned - info->bytes_reserved),
				    info->bytes_pinned - info->bytes_reserved),
	       (info->full) ? "" : "not ");
	       (info->full) ? "" : "not ");
	printk(KERN_INFO "space_info total=%llu, pinned=%llu, delalloc=%llu,"
	printk(KERN_INFO "space_info total=%llu, pinned=%llu, delalloc=%llu,"
	       " may_use=%llu, used=%llu\n", info->total_bytes,
	       " may_use=%llu, used=%llu\n",
	       info->bytes_pinned, info->bytes_delalloc, info->bytes_may_use,
	       (unsigned long long)info->total_bytes,
	       info->bytes_used);
	       (unsigned long long)info->bytes_pinned,
	       (unsigned long long)info->bytes_delalloc,
	       (unsigned long long)info->bytes_may_use,
	       (unsigned long long)info->bytes_used);


	down_read(&info->groups_sem);
	down_read(&info->groups_sem);
	list_for_each_entry(cache, &info->block_groups, list) {
	list_for_each_entry(cache, &info->block_groups, list) {
+10 −5
Original line number Original line Diff line number Diff line
@@ -332,13 +332,17 @@ int btrfs_remove_free_space(struct btrfs_block_group_cache *block_group,
			printk(KERN_ERR "couldn't find space %llu to free\n",
			printk(KERN_ERR "couldn't find space %llu to free\n",
			       (unsigned long long)offset);
			       (unsigned long long)offset);
			printk(KERN_ERR "cached is %d, offset %llu bytes %llu\n",
			printk(KERN_ERR "cached is %d, offset %llu bytes %llu\n",
			       block_group->cached, block_group->key.objectid,
			       block_group->cached,
			       block_group->key.offset);
			       (unsigned long long)block_group->key.objectid,
			       (unsigned long long)block_group->key.offset);
			btrfs_dump_free_space(block_group, bytes);
			btrfs_dump_free_space(block_group, bytes);
		} else if (info) {
		} else if (info) {
			printk(KERN_ERR "hmm, found offset=%llu bytes=%llu, "
			printk(KERN_ERR "hmm, found offset=%llu bytes=%llu, "
			       "but wanted offset=%llu bytes=%llu\n",
			       "but wanted offset=%llu bytes=%llu\n",
			       info->offset, info->bytes, offset, bytes);
			       (unsigned long long)info->offset,
			       (unsigned long long)info->bytes,
			       (unsigned long long)offset,
			       (unsigned long long)bytes);
		}
		}
		WARN_ON(1);
		WARN_ON(1);
	}
	}
@@ -357,8 +361,9 @@ void btrfs_dump_free_space(struct btrfs_block_group_cache *block_group,
		info = rb_entry(n, struct btrfs_free_space, offset_index);
		info = rb_entry(n, struct btrfs_free_space, offset_index);
		if (info->bytes >= bytes)
		if (info->bytes >= bytes)
			count++;
			count++;
		printk(KERN_ERR "entry offset %llu, bytes %llu\n", info->offset,
		printk(KERN_ERR "entry offset %llu, bytes %llu\n",
		       info->bytes);
		       (unsigned long long)info->offset,
		       (unsigned long long)info->bytes);
	}
	}
	printk(KERN_INFO "%d blocks of free space at or bigger than bytes is"
	printk(KERN_INFO "%d blocks of free space at or bigger than bytes is"
	       "\n", count);
	       "\n", count);
+4 −2
Original line number Original line Diff line number Diff line
@@ -483,11 +483,13 @@ static int btrfs_ioctl_resize(struct btrfs_root *root, void __user *arg)
		*devstr = '\0';
		*devstr = '\0';
		devstr = vol_args->name;
		devstr = vol_args->name;
		devid = simple_strtoull(devstr, &end, 10);
		devid = simple_strtoull(devstr, &end, 10);
		printk(KERN_INFO "resizing devid %llu\n", devid);
		printk(KERN_INFO "resizing devid %llu\n",
		       (unsigned long long)devid);
	}
	}
	device = btrfs_find_device(root, devid, NULL, NULL);
	device = btrfs_find_device(root, devid, NULL, NULL);
	if (!device) {
	if (!device) {
		printk(KERN_INFO "resizer unable to find device %llu\n", devid);
		printk(KERN_INFO "resizer unable to find device %llu\n",
		       (unsigned long long)devid);
		ret = -EINVAL;
		ret = -EINVAL;
		goto out_unlock;
		goto out_unlock;
	}
	}
+9 −6
Original line number Original line Diff line number Diff line
@@ -196,7 +196,7 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
				info->max_extent = max_t(u64,
				info->max_extent = max_t(u64,
					info->max_extent, root->sectorsize);
					info->max_extent, root->sectorsize);
				printk(KERN_INFO "btrfs: max_extent at %llu\n",
				printk(KERN_INFO "btrfs: max_extent at %llu\n",
				       info->max_extent);
				       (unsigned long long)info->max_extent);
			}
			}
			break;
			break;
		case Opt_max_inline:
		case Opt_max_inline:
@@ -211,7 +211,7 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
						root->sectorsize);
						root->sectorsize);
				}
				}
				printk(KERN_INFO "btrfs: max_inline at %llu\n",
				printk(KERN_INFO "btrfs: max_inline at %llu\n",
					info->max_inline);
					(unsigned long long)info->max_inline);
			}
			}
			break;
			break;
		case Opt_alloc_start:
		case Opt_alloc_start:
@@ -221,7 +221,7 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
				kfree(num);
				kfree(num);
				printk(KERN_INFO
				printk(KERN_INFO
					"btrfs: allocations start at %llu\n",
					"btrfs: allocations start at %llu\n",
					info->alloc_start);
					(unsigned long long)info->alloc_start);
			}
			}
			break;
			break;
		case Opt_noacl:
		case Opt_noacl:
@@ -420,11 +420,14 @@ static int btrfs_show_options(struct seq_file *seq, struct vfsmount *vfs)
	if (btrfs_test_opt(root, NOBARRIER))
	if (btrfs_test_opt(root, NOBARRIER))
		seq_puts(seq, ",nobarrier");
		seq_puts(seq, ",nobarrier");
	if (info->max_extent != (u64)-1)
	if (info->max_extent != (u64)-1)
		seq_printf(seq, ",max_extent=%llu", info->max_extent);
		seq_printf(seq, ",max_extent=%llu",
			   (unsigned long long)info->max_extent);
	if (info->max_inline != 8192 * 1024)
	if (info->max_inline != 8192 * 1024)
		seq_printf(seq, ",max_inline=%llu", info->max_inline);
		seq_printf(seq, ",max_inline=%llu",
			   (unsigned long long)info->max_inline);
	if (info->alloc_start != 0)
	if (info->alloc_start != 0)
		seq_printf(seq, ",alloc_start=%llu", info->alloc_start);
		seq_printf(seq, ",alloc_start=%llu",
			   (unsigned long long)info->alloc_start);
	if (info->thread_pool_size !=  min_t(unsigned long,
	if (info->thread_pool_size !=  min_t(unsigned long,
					     num_online_cpus() + 2, 8))
					     num_online_cpus() + 2, 8))
		seq_printf(seq, ",thread_pool=%d", info->thread_pool_size);
		seq_printf(seq, ",thread_pool=%d", info->thread_pool_size);