From: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: dsterba@suse.com, josef@toxicpanda.com,
linux-btrfs@vger.kernel.org,
Marcos Paulo de Souza <mpdesouza@suse.com>
Subject: [PATCH 1/5] btrfs-progs: add IOC_SNAP_DESTROY_V2 to ioctl.h
Date: Sun, 26 Jan 2020 23:49:50 -0300 [thread overview]
Message-ID: <20200127024954.16916-1-marcos.souza.org@gmail.com> (raw)
From: Marcos Paulo de Souza <mpdesouza@suse.com>
This ioctl will make possible to delete a subvolume/snapshot by using
the subvolume id.
Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
---
ioctl.h | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/ioctl.h b/ioctl.h
index 1d53c100..d4cf71de 100644
--- a/ioctl.h
+++ b/ioctl.h
@@ -53,12 +53,14 @@ BUILD_ASSERT(sizeof(struct btrfs_ioctl_vol_args) == 4096);
#define BTRFS_SUBVOL_RDONLY (1ULL << 1)
#define BTRFS_SUBVOL_QGROUP_INHERIT (1ULL << 2)
#define BTRFS_DEVICE_SPEC_BY_ID (1ULL << 3)
+#define BTRFS_SUBVOL_BY_ID (1ULL << 4)
#define BTRFS_VOL_ARG_V2_FLAGS_SUPPORTED \
(BTRFS_SUBVOL_CREATE_ASYNC | \
BTRFS_SUBVOL_RDONLY | \
BTRFS_SUBVOL_QGROUP_INHERIT | \
- BTRFS_DEVICE_SPEC_BY_ID)
+ BTRFS_DEVICE_SPEC_BY_ID | \
+ BTRFS_SUBVOL_BY_ID)
#define BTRFS_FSID_SIZE 16
#define BTRFS_UUID_SIZE 16
@@ -103,7 +105,10 @@ struct btrfs_ioctl_vol_args_v2 {
__u64 unused[4];
};
union {
- char name[BTRFS_SUBVOL_NAME_MAX + 1];
+ union {
+ char name[BTRFS_SUBVOL_NAME_MAX + 1];
+ __u64 subvolid;
+ };
__u64 devid;
};
};
@@ -940,6 +945,9 @@ static inline char *btrfs_err_str(enum btrfs_err_code err_code)
struct btrfs_ioctl_get_subvol_rootref_args)
#define BTRFS_IOC_INO_LOOKUP_USER _IOWR(BTRFS_IOCTL_MAGIC, 62, \
struct btrfs_ioctl_ino_lookup_user_args)
+#define BTRFS_IOC_SNAP_DESTROY_V2 _IOW(BTRFS_IOCTL_MAGIC, 63, \
+ struct btrfs_ioctl_vol_args_v2)
+
#ifdef __cplusplus
}
#endif
--
2.24.0
next reply other threads:[~2020-01-27 2:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-27 2:49 Marcos Paulo de Souza [this message]
2020-01-27 2:49 ` [PATCH 2/5] libbtrfsutil: add IOC_SNAP_DESTROY_V2 to ioctl.h Marcos Paulo de Souza
2020-01-27 2:49 ` [PATCH 3/5] libbtrfsutil: Introduce btrfs_util_delete_subvolume_by_id_fd Marcos Paulo de Souza
2020-01-27 2:49 ` [PATCH 4/5] cmds: subvolume: Add --subvolid argument to subvol_delete Marcos Paulo de Souza
2020-01-27 2:49 ` [PATCH 5/5] VERSION: bump version Marcos Paulo de Souza
2020-01-27 2:50 ` Qu Wenruo
2020-01-27 14:24 ` David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200127024954.16916-1-marcos.souza.org@gmail.com \
--to=marcos.souza.org@gmail.com \
--cc=dsterba@suse.com \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=mpdesouza@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox