Skip to content

Commit 26cebc4

Browse files
committed
btrfs-progs: remove device_get_partition_size_fd()
The last user of the helper is removed in commit 585ac14 ("btrfs-progs: use btrfs_device_size() instead of device_get_partition_size_fd()"), and that helper is not generic enough to handle regular files. So let's just remove it. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: Qu Wenruo <[email protected]>
1 parent 021bc89 commit 26cebc4

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

common/device-utils.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -323,19 +323,6 @@ u64 device_get_partition_size_fd_stat(int fd, const struct stat *st)
323323
return 0;
324324
}
325325

326-
/*
327-
* Read partition size using the low-level ioctl
328-
*/
329-
u64 device_get_partition_size_fd(int fd)
330-
{
331-
u64 result;
332-
333-
if (ioctl(fd, BLKGETSIZE64, &result) < 0)
334-
return 0;
335-
336-
return result;
337-
}
338-
339326
static u64 device_get_partition_size_sysfs(const char *dev)
340327
{
341328
int ret;

common/device-utils.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ enum {
4343
int device_discard_blocks(int fd, u64 start, u64 len);
4444
int device_zero_blocks(int fd, off_t start, size_t len, const bool direct);
4545
u64 device_get_partition_size(const char *dev);
46-
u64 device_get_partition_size_fd(int fd);
4746
u64 device_get_partition_size_fd_stat(int fd, const struct stat *st);
4847
int device_get_queue_param(const char *file, const char *param, char *buf, size_t len);
4948
u64 device_get_zone_unusable(int fd, u64 flags);

0 commit comments

Comments
 (0)