Commit 2b6433c7 authored by Josef Bacik's avatar Josef Bacik Committed by David Sterba
Browse files

btrfs: move btrfs_ordered_sum_size into file-item.c



This is defined in ordered-data.h, but is only used in file-item.c.
Move this to file-item.c as it doesn't need to be global.

Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: default avatarAnand Jain <anand.jain@oracle.com>
Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent d9d88fde
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -129,6 +129,17 @@ static inline u32 max_ordered_sum_bytes(struct btrfs_fs_info *fs_info,
	return ncsums * fs_info->sectorsize;
}

/*
 * Calculate the total size needed to allocate for an ordered sum structure
 * spanning @bytes in the file.
 */
static int btrfs_ordered_sum_size(struct btrfs_fs_info *fs_info, unsigned long bytes)
{
	int num_sectors = (int)DIV_ROUND_UP(bytes, fs_info->sectorsize);

	return sizeof(struct btrfs_ordered_sum) + num_sectors * fs_info->csum_size;
}

int btrfs_insert_hole_extent(struct btrfs_trans_handle *trans,
			     struct btrfs_root *root,
			     u64 objectid, u64 pos, u64 num_bytes)
+0 −12
Original line number Diff line number Diff line
@@ -160,18 +160,6 @@ struct btrfs_ordered_extent {
	struct block_device *bdev;
};

/*
 * calculates the total size you need to allocate for an ordered sum
 * structure spanning 'bytes' in the file
 */
static inline int btrfs_ordered_sum_size(struct btrfs_fs_info *fs_info,
					 unsigned long bytes)
{
	int num_sectors = (int)DIV_ROUND_UP(bytes, fs_info->sectorsize);

	return sizeof(struct btrfs_ordered_sum) + num_sectors * fs_info->csum_size;
}

static inline void
btrfs_ordered_inode_tree_init(struct btrfs_ordered_inode_tree *t)
{