Skip to content

Commit adbab64

Browse files
asjkdave
authored andcommitted
btrfs: unexport btrfs_compress_set_level()
btrfs_compress_set_level() can be static function in the file compression.c. Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Anand Jain <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 0202e83 commit adbab64

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

fs/btrfs/compression.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,6 +1139,22 @@ static void put_workspace(int type, struct list_head *ws)
11391139
}
11401140
}
11411141

1142+
/*
1143+
* Adjust @level according to the limits of the compression algorithm or
1144+
* fallback to default
1145+
*/
1146+
static unsigned int btrfs_compress_set_level(int type, unsigned level)
1147+
{
1148+
const struct btrfs_compress_op *ops = btrfs_compress_op[type];
1149+
1150+
if (level == 0)
1151+
level = ops->default_level;
1152+
else
1153+
level = min(level, ops->max_level);
1154+
1155+
return level;
1156+
}
1157+
11421158
/*
11431159
* Given an address space and start and length, compress the bytes into @pages
11441160
* that are allocated on demand.
@@ -1746,19 +1762,3 @@ unsigned int btrfs_compress_str2level(unsigned int type, const char *str)
17461762

17471763
return level;
17481764
}
1749-
1750-
/*
1751-
* Adjust @level according to the limits of the compression algorithm or
1752-
* fallback to default
1753-
*/
1754-
unsigned int btrfs_compress_set_level(int type, unsigned level)
1755-
{
1756-
const struct btrfs_compress_op *ops = btrfs_compress_op[type];
1757-
1758-
if (level == 0)
1759-
level = ops->default_level;
1760-
else
1761-
level = min(level, ops->max_level);
1762-
1763-
return level;
1764-
}

fs/btrfs/compression.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,6 @@ extern const struct btrfs_compress_op btrfs_zstd_compress;
140140
const char* btrfs_compress_type2str(enum btrfs_compression_type type);
141141
bool btrfs_compress_is_valid_type(const char *str, size_t len);
142142

143-
unsigned int btrfs_compress_set_level(int type, unsigned level);
144-
145143
int btrfs_compress_heuristic(struct inode *inode, u64 start, u64 end);
146144

147145
#endif

0 commit comments

Comments
 (0)