Skip to content

Commit

Permalink
btrfs: heuristic: call get4bits directly
Browse files Browse the repository at this point in the history
As it's a single instance and local to the file, we don't need to pass
it as an argument.

Reviewed-by: Timofey Titovets <[email protected]>
Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
kdave committed Jan 22, 2018
1 parent 7add17b commit 36243c9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/btrfs/compression.c
Original file line number Diff line number Diff line change
Expand Up @@ -1319,11 +1319,9 @@ static u8 get4bits(u64 num, int shift) {
* @array_buf - buffer array to store sorting results
* must be equal in size to @array
* @num - array size
* @get4bits - function to get 4 bits from number at specified offset
*/
static void radix_sort(struct bucket_item *array, struct bucket_item *array_buf,
int num,
u8 (*get4bits)(u64 num, int shift))
int num)
{
u64 max_num;
u64 buf_num;
Expand Down Expand Up @@ -1427,7 +1425,7 @@ static int byte_core_set_size(struct heuristic_ws *ws)
struct bucket_item *bucket = ws->bucket;

/* Sort in reverse order */
radix_sort(ws->bucket, ws->bucket_b, BUCKET_SIZE, get4bits);
radix_sort(ws->bucket, ws->bucket_b, BUCKET_SIZE);

for (i = 0; i < BYTE_CORE_SET_LOW; i++)
coreset_sum += bucket[i].count;
Expand Down

0 comments on commit 36243c9

Please sign in to comment.