mirror of
https://github.com/kdave/btrfs-progs
synced 2025-02-13 16:17:08 +00:00
btrfs-progs: add prefix to discard_blocks
This is a helper for devices, make it clear in the function name. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
43ea336e17
commit
aed8243eb1
@ -50,7 +50,7 @@ static int discard_range(int fd, u64 start, u64 len)
|
||||
/*
|
||||
* Discard blocks in the given range in 1G chunks, the process is interruptible
|
||||
*/
|
||||
int discard_blocks(int fd, u64 start, u64 len)
|
||||
int device_discard_blocks(int fd, u64 start, u64 len)
|
||||
{
|
||||
while (len > 0) {
|
||||
/* 1G granularity */
|
||||
@ -221,7 +221,7 @@ int btrfs_prepare_device(int fd, const char *file, u64 *block_count_ret,
|
||||
if (opflags & PREP_DEVICE_VERBOSE)
|
||||
printf("Performing full device TRIM %s (%s) ...\n",
|
||||
file, pretty_size(block_count));
|
||||
discard_blocks(fd, 0, block_count);
|
||||
device_discard_blocks(fd, 0, block_count);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
#define PREP_DEVICE_VERBOSE (1U << 2)
|
||||
#define PREP_DEVICE_ZONED (1U << 3)
|
||||
|
||||
int discard_blocks(int fd, u64 start, u64 len);
|
||||
int device_discard_blocks(int fd, u64 start, u64 len);
|
||||
int zero_blocks(int fd, off_t start, size_t len);
|
||||
u64 get_partition_size(const char *dev);
|
||||
u64 disk_size(const char *path);
|
||||
|
@ -373,7 +373,7 @@ int btrfs_reset_all_zones(int fd, struct btrfs_zoned_device_info *zinfo)
|
||||
/* Zone size granularity */
|
||||
for (i = 0; i < zinfo->nr_zones; i++) {
|
||||
if (zinfo->zones[i].type == BLK_ZONE_TYPE_CONVENTIONAL) {
|
||||
ret = discard_blocks(fd,
|
||||
ret = device_discard_blocks(fd,
|
||||
zinfo->zones[i].start << SECTOR_SHIFT,
|
||||
zinfo->zone_size);
|
||||
if (ret == EOPNOTSUPP)
|
||||
|
Loading…
Reference in New Issue
Block a user