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:
@@ -2,7 +2,6 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <linux/btrfs.h>
|
||||
#if WANT_LINUX_FS_H
|
||||
#include <linux/fs.h>
|
||||
#endif
|
||||
@@ -779,20 +778,6 @@ int read_nr_open(void) {
|
||||
return 1024 * 1024;
|
||||
}
|
||||
|
||||
/* This is here because it's fd-related and is called from sd-journal code. Other btrfs-related utilities are
|
||||
* in src/shared, but libsystemd must not link to libsystemd-shared, see docs/ARCHITECTURE.md. */
|
||||
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 fd_get_diskseq(int fd, uint64_t *ret) {
|
||||
uint64_t diskseq;
|
||||
|
||||
|
||||
@@ -108,7 +108,6 @@ static inline int make_null_stdio(void) {
|
||||
|
||||
int fd_reopen(int fd, int flags);
|
||||
int read_nr_open(void);
|
||||
int btrfs_defrag_fd(int fd);
|
||||
int fd_get_diskseq(int fd, uint64_t *ret);
|
||||
|
||||
/* The maximum length a buffer for a /proc/self/fd/<fd> path needs */
|
||||
|
||||
Reference in New Issue
Block a user