linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] btrfs: send uevent on subvolume add/remove
@ 2019-10-24  2:36 Marcos Paulo de Souza
  2019-10-24  2:36 ` [PATCH 1/5] btrfs: sysfs: Add envp argument to btrfs_kobject_uevent Marcos Paulo de Souza
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Marcos Paulo de Souza @ 2019-10-24  2:36 UTC (permalink / raw)
  To: linux-kernel; +Cc: clm, josef, dsterba, linux-btrfs, mpdesouza

From: Marcos Paulo de Souza <mpdesouza@suse.com>

Hey guys,

these patches make btrfs to send an uevent to userspace whenever a subvolume is
added/removed. The changes are pretty straightforward. This patchset was based
in btrfs-misc-next.

The first patch adds an additional argument to btrfs_kobject_uevent to receive a
envp, and just forward this argument to kobject_uevent_envp.

Patch number 2 creates a new function that will be called by patches 4 and 5 to
setup the environment variable to be set to userspace using uevent. These two
environment variables are BTRFS_VOL_{NEW,DEL} and BTRFS_VOL_NAME. The first
variable will have the value 1 for subvolume add/remove (only one will be
exported, so udev can distinguish the event), and the second one hold the name
of the subvolume being added/removed.

Feel free to suggest any other useful information to be exported to userspace
when adding/removing a subvolume.

Patches 3 and 5 call btrfs_vol_uevent to send the event on subvolume add/remove.

Patch 4 creates a helper function to distinguish a subvolume from a snapshot,
since the same function is used to delete both. This function is used in patch
5.

Thanks for you reviews!

Marcos Paulo de Souza (5):
  btrfs: sysfs: Add envp argument to btrfs_kobject_uevent
  btrfs: ioctl: Introduce btrfs_vol_uevent
  btrfs: ioctl: Call btrfs_vol_uevent on subvol creation
  btrfs: ctree.h: Add btrfs_is_snapshot function
  btrfs: ioctl: Call btrfs_vol_uevent on subvolume deletion

 fs/btrfs/ctree.h   | 14 ++++++++++++++
 fs/btrfs/ioctl.c   | 39 ++++++++++++++++++++++++++++++++++++++-
 fs/btrfs/sysfs.c   |  7 +++++--
 fs/btrfs/sysfs.h   |  3 ++-
 fs/btrfs/volumes.c |  2 +-
 5 files changed, 60 insertions(+), 5 deletions(-)

-- 
2.23.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-11-18 20:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-24  2:36 [PATCH 0/5] btrfs: send uevent on subvolume add/remove Marcos Paulo de Souza
2019-10-24  2:36 ` [PATCH 1/5] btrfs: sysfs: Add envp argument to btrfs_kobject_uevent Marcos Paulo de Souza
2019-10-24  2:36 ` [PATCH 2/5] btrfs: ioctl: Introduce btrfs_vol_uevent Marcos Paulo de Souza
2019-10-24  2:36 ` [PATCH 3/5] btrfs: ioctl: Call btrfs_vol_uevent on subvol creation Marcos Paulo de Souza
2019-10-24  2:36 ` [PATCH 4/5] btrfs: ctree.h: Add btrfs_is_snapshot function Marcos Paulo de Souza
2019-10-25 10:02   ` Filipe Manana
2019-10-24  2:36 ` [PATCH 5/5] btrfs: ioctl: Call btrfs_vol_uevent on subvolume deletion Marcos Paulo de Souza
2019-10-25 12:00   ` Graham Cobb
2019-10-25 15:44     ` Marcos Paulo de Souza
2019-11-18 20:50 ` [PATCH 0/5] btrfs: send uevent on subvolume add/remove David Sterba

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).