From: Filipe David Borba Manana <fdmanana@gmail.com>
To: linux-btrfs@vger.kernel.org
Cc: Filipe David Borba Manana <fdmanana@gmail.com>
Subject: [PATCH 0/5] Add support for object properties
Date: Tue, 12 Nov 2013 13:41:41 +0000 [thread overview]
Message-ID: <1384263706-25549-1-git-send-email-fdmanana@gmail.com> (raw)
This is a revised version of the original proposal/work from Alexander Block
to introduce a generic framework to set properties on btrfs filesystem objects
(inodes, subvolumes, filesystems, devices).
I preserved most of Alexander's work, rebasing only his main patch against
latest integration branch, adding some missing static qualifiers, malloc failure
checks and fixing some checkpatch.pl warnings. On top of his work, I added a few
fixes and enhancements and added support for 1 inode property, named compression,
which requires the corresponding kernel patch.
Once there's agreement on this feature and patchset, I'll send my xfstests patch
that tests this feature.
Alexander's original cover letter:
"
This patchset introduces the btrfs property subgroup. It is the
result of a discussion we had on IRC. I tried to make the properties
interface as generic and extensible as possible. Comments are welcome.
Currently the command group looks like this:
btrfs prop set [-t <type>] /path/to/object <name> <value>
btrfs prop get [-t <type>] /path/to/object [<name>] (omitting name dumps all)
btrfs prop list [-t <type>] /path/to/object (lists properties with description)
The type is used to explicitly specify what type of object you mean. This is
necessary in case the object+property combination is ambiguous. For example
'/path/to/fs/root' could mean the root subvolume, the directory inode or the
filesystem itself. Normally, btrfs-progs will try to detect the type
automatically.
David suggested that it should also be possible to specify objects by
their id/uuid/fsid. I like that idea, but would be happy if someone else
could take over that part :)
For now, I've implemented two properties:
1. read-only. Usable on subvolumes to toggle the read-only flags.
2. label. I looked through btrfs to find good examples of things that
could be moved to the new properties interface and the filesystem
label looked like a good one. There are for sure more, but that is
something for later (and maybe for someone else). I would suggest
to move everthing that makes sense over to the props interface and
mark the old interfaces as deprecated. Comments on this are welcome.
Patch version history:
v1
Initial version.
v2
- Removed the filesystem prefix and implemented it as new command group
- Switched from the <name>[=<value>] form to the set/get <name> [<value>]
form.
- Removed patches "Btrfs-progs: make filesystem_cmd_group non const"
and "Btrfs-progs: move skip_prefix and prefixcmp to utils.c". They
are not needed anymore due to the 'btrfs prop list' command.
- Udjusted the subvol flags patch to be compatible to the "Btrfs: use
_IOR for BTRFS_IOC_SUBVOL_GETFLAGS" patch.
- Using -t <type> instead of <type>: prefix now.
- Changes are based on feedback from Ilya and David.
Alex.
"
Thanks.
Alexander Block (1):
Btrfs-progs: introduce btrfs property subgroup
Filipe David Borba Manana (4):
Btrfs-progs: let get_label return the label instead of printing it
Btrfs-progs: fix detection of root objects in cmds-property.c
Btrfs-progs: add type root to label property
Btrfs-progs: add support for the compression property
Makefile | 4 +-
btrfs.c | 1 +
cmds-filesystem.c | 14 +-
cmds-property.c | 467 +++++++++++++++++++++++++++++++++++++++++++++++++++++
commands.h | 2 +
ioctl.h | 12 ++
props.c | 184 +++++++++++++++++++++
props.h | 43 +++++
utils.c | 15 +-
utils.h | 2 +-
10 files changed, 729 insertions(+), 15 deletions(-)
create mode 100644 cmds-property.c
create mode 100644 props.c
create mode 100644 props.h
--
1.7.9.5
next reply other threads:[~2013-11-12 13:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-12 13:41 Filipe David Borba Manana [this message]
2013-11-12 13:41 ` [PATCH 1/5] Btrfs-progs: let get_label return the label instead of printing it Filipe David Borba Manana
2013-11-13 15:43 ` David Sterba
2013-11-12 13:41 ` [PATCH 2/5] Btrfs-progs: introduce btrfs property subgroup Filipe David Borba Manana
2013-11-12 13:41 ` [PATCH 3/5] Btrfs-progs: fix detection of root objects in cmds-property.c Filipe David Borba Manana
2013-11-12 13:41 ` [PATCH 4/5] Btrfs-progs: add type root to label property Filipe David Borba Manana
2013-11-12 13:41 ` [PATCH 5/5] Btrfs-progs: add support for the compression property Filipe David Borba Manana
2013-11-13 1:22 ` [PATCH 5/5 V2] " Filipe David Borba Manana
2013-11-13 16:15 ` [PATCH 0/5] Add support for object properties David Sterba
2013-11-23 0:52 ` David Sterba
2013-11-23 10:45 ` Goffredo Baroncelli
2014-01-07 11:51 ` Filipe David Manana
2014-01-23 17:47 ` 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=1384263706-25549-1-git-send-email-fdmanana@gmail.com \
--to=fdmanana@gmail.com \
--cc=linux-btrfs@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).