From: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
To: dsterba@suse.com, wqu@suse.com, linux-btrfs@vger.kernel.org
Cc: Marcos Paulo de Souza <mpdesouza@suse.com>
Subject: [PATCHv2 1/4] btrfs-progs: add IOC_SNAP_DESTROY_V2 to ioctl.h
Date: Fri, 7 Feb 2020 10:10:25 -0300 [thread overview]
Message-ID: <20200207131028.9977-2-marcos.souza.org@gmail.com> (raw)
In-Reply-To: <20200207131028.9977-1-marcos.souza.org@gmail.com>
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>
---
Changes from v1:
* Moved subvolid member to the same union containing name and devid (David)
* Changed BTRFS_SUBVOL_DELETE_BY_ID to BTRFS_SUBVOL_SPEC_BY_ID (David,
Christoph)
ioctl.h | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/ioctl.h b/ioctl.h
index 1d53c100..1a2882df 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_SPEC_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_SPEC_BY_ID)
#define BTRFS_FSID_SIZE 16
#define BTRFS_UUID_SIZE 16
@@ -104,6 +106,7 @@ struct btrfs_ioctl_vol_args_v2 {
};
union {
char name[BTRFS_SUBVOL_NAME_MAX + 1];
+ __u64 subvolid;
__u64 devid;
};
};
@@ -940,6 +943,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 prev parent reply other threads:[~2020-02-07 13:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-07 13:10 [PATCHv2 0/4] btrfs-progs: Add BTRFS_IOC_SNAP_DESTROY_V2 support Marcos Paulo de Souza
2020-02-07 13:10 ` Marcos Paulo de Souza [this message]
2020-02-07 13:10 ` [PATCHv2 2/4] libbtrfsutil: add IOC_SNAP_DESTROY_V2 to ioctl.h Marcos Paulo de Souza
2020-02-07 13:10 ` [PATCHv2 3/4] libbtrfsutil: Introduce btrfs_util_delete_subvolume_by_id_fd Marcos Paulo de Souza
2020-02-07 13:10 ` [PATCHv2 4/4] cmds: subvolume: Add --subvolid argument to subvol_delete Marcos Paulo de Souza
2020-03-03 18:34 ` [PATCHv2 0/4] btrfs-progs: Add BTRFS_IOC_SNAP_DESTROY_V2 support 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=20200207131028.9977-2-marcos.souza.org@gmail.com \
--to=marcos.souza.org@gmail.com \
--cc=dsterba@suse.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=mpdesouza@suse.com \
--cc=wqu@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