2014-12-12 03:15:58 +01:00
|
|
|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
|
|
|
|
|
|
|
/***
|
|
|
|
This file is part of systemd.
|
|
|
|
|
|
|
|
Copyright 2014 Lennart Poettering
|
|
|
|
|
|
|
|
systemd is free software; you can redistribute it and/or modify it
|
|
|
|
under the terms of the GNU Lesser General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2.1 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
systemd is distributed in the hope that it will be useful, but
|
|
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
|
|
|
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
***/
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
2014-12-25 03:19:19 +01:00
|
|
|
#include "time-util.h"
|
|
|
|
|
|
|
|
typedef struct BtrfsSubvolInfo {
|
|
|
|
uint64_t subvol_id;
|
|
|
|
usec_t otime;
|
|
|
|
|
|
|
|
sd_id128_t uuid;
|
|
|
|
sd_id128_t parent_uuid;
|
|
|
|
|
|
|
|
bool read_only;
|
|
|
|
} BtrfsSubvolInfo;
|
|
|
|
|
2014-12-28 02:05:28 +01:00
|
|
|
typedef struct BtrfsQuotaInfo {
|
|
|
|
uint64_t referred;
|
|
|
|
uint64_t exclusive;
|
|
|
|
uint64_t referred_max;
|
|
|
|
uint64_t exclusive_max;
|
|
|
|
} BtrfsQuotaInfo;
|
|
|
|
|
2014-12-12 03:15:58 +01:00
|
|
|
int btrfs_is_snapshot(int fd);
|
|
|
|
|
|
|
|
int btrfs_subvol_make(const char *path);
|
2014-12-27 18:46:36 +01:00
|
|
|
int btrfs_subvol_make_label(const char *path);
|
2014-12-12 03:15:58 +01:00
|
|
|
int btrfs_subvol_remove(const char *path);
|
|
|
|
int btrfs_subvol_snapshot(const char *old_path, const char *new_path, bool read_only, bool fallback_copy);
|
2014-12-25 03:19:19 +01:00
|
|
|
|
|
|
|
int btrfs_subvol_set_read_only(const char *path, bool b);
|
|
|
|
int btrfs_subvol_get_read_only_fd(int fd);
|
|
|
|
int btrfs_subvol_get_id_fd(int fd, uint64_t *ret);
|
|
|
|
int btrfs_subvol_get_info_fd(int fd, BtrfsSubvolInfo *info);
|
2014-12-28 02:05:28 +01:00
|
|
|
int btrfs_subvol_get_quota_fd(int fd, BtrfsQuotaInfo *quota);
|
2014-12-12 03:15:58 +01:00
|
|
|
|
|
|
|
int btrfs_reflink(int infd, int outfd);
|
2015-01-17 18:11:45 +01:00
|
|
|
int btrfs_clone_range(int infd, uint64_t in_offset, int ofd, uint64_t out_offset, uint64_t sz);
|
2014-12-12 03:15:58 +01:00
|
|
|
|
|
|
|
int btrfs_get_block_device(const char *path, dev_t *dev);
|
2015-01-06 19:51:03 +01:00
|
|
|
|
|
|
|
int btrfs_defrag_fd(int fd);
|
|
|
|
int btrfs_defrag(const char *p);
|