btrfs-util: move btrfs_defrag_fd() from fd-util.[ch]
After d71ece3f0b, the function is not used
in libbasic or libsystemd anymore. Let's move it to more appropriate
place.
This commit is contained in:
@@ -739,6 +739,18 @@ int btrfs_subvol_get_subtree_quota(const char *path, uint64_t subvol_id, BtrfsQu
|
||||
return btrfs_subvol_get_subtree_quota_fd(fd, subvol_id, ret);
|
||||
}
|
||||
|
||||
int btrfs_defrag_fd(int fd) {
|
||||
int r;
|
||||
|
||||
assert(fd >= 0);
|
||||
|
||||
r = fd_verify_regular(fd);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
return RET_NERRNO(ioctl(fd, BTRFS_IOC_DEFRAG, NULL));
|
||||
}
|
||||
|
||||
int btrfs_defrag(const char *p) {
|
||||
_cleanup_close_ int fd = -1;
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ int btrfs_clone_range(int infd, uint64_t in_offset, int ofd, uint64_t out_offset
|
||||
int btrfs_get_block_device_fd(int fd, dev_t *dev);
|
||||
int btrfs_get_block_device(const char *path, dev_t *dev);
|
||||
|
||||
int btrfs_defrag_fd(int fd);
|
||||
int btrfs_defrag(const char *p);
|
||||
|
||||
int btrfs_quota_enable_fd(int fd, bool b);
|
||||
|
||||
Reference in New Issue
Block a user