Perform the O(1) btrfs clone operation, if possible. Upon success, return 0. Otherwise, return -1 and set errno. */
| 226 | /* Perform the O(1) btrfs clone operation, if possible. |
| 227 | Upon success, return 0. Otherwise, return -1 and set errno. */ |
| 228 | static inline int |
| 229 | clone_file (MAYBE_UNUSED int dest_fd, MAYBE_UNUSED int src_fd) |
| 230 | { |
| 231 | #ifdef FICLONE |
| 232 | return ioctl (dest_fd, FICLONE, src_fd); |
| 233 | #else |
| 234 | errno = ENOTSUP; |
| 235 | return -1; |
| 236 | #endif |
| 237 | } |
| 238 | |
| 239 | /* FIXME: describe */ |
| 240 | /* FIXME: rewrite this to use a hash table so we avoid the quadratic |