[Devel] [PATCH RHEL9 COMMIT] xfs: Introduce xfs_send_uevent()

Konstantin Khorenko khorenko at virtuozzo.com
Thu Jan 27 17:36:57 MSK 2022


The commit is pushed to "branch-rh9-5.14.0-4.vz9.12.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh9-5.14.0-4.vz9.12.2
------>
commit 1bd28ac4a7e5fcebd3f5aeface263a2dc4a36181
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Thu Jan 27 17:36:57 2022 +0300

    xfs: Introduce xfs_send_uevent()
    
    Helper to hide kobject from arguments
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
    
    ====================
    xfs: Add notification about fs events like for ext4
    
    This patchset generalizes ext4's related code and introduced the same
    uevent notifications for xfs.
    
    https://jira.sw.ru/browse/PSBM-135476
    Feature: fs: udev events support
---
 fs/xfs/xfs_error.c | 7 +++++++
 fs/xfs/xfs_error.h | 3 +++
 2 files changed, 10 insertions(+)

diff --git a/fs/xfs/xfs_error.c b/fs/xfs/xfs_error.c
index ce3bc1b291a1..25550c5bbb5b 100644
--- a/fs/xfs/xfs_error.c
+++ b/fs/xfs/xfs_error.c
@@ -466,3 +466,10 @@ xfs_inode_verifier_error(
 	if (xfs_error_level >= XFS_ERRLEVEL_HIGH)
 		xfs_stack_trace();
 }
+
+void xfs_send_uevent(struct super_block *sb, enum fs_event_type event)
+{
+	struct xfs_mount *mp = XFS_M(sb);
+
+	fs_send_uevent(sb, &mp->m_kobj.kobject, event);
+}
diff --git a/fs/xfs/xfs_error.h b/fs/xfs/xfs_error.h
index 1717b7508356..c0c8bd60cd36 100644
--- a/fs/xfs/xfs_error.h
+++ b/fs/xfs/xfs_error.h
@@ -6,6 +6,8 @@
 #ifndef	__XFS_ERROR_H__
 #define	__XFS_ERROR_H__
 
+#include <linux/fs.h>
+
 struct xfs_mount;
 
 extern void xfs_error_report(const char *tag, int level, struct xfs_mount *mp,
@@ -24,6 +26,7 @@ extern void xfs_verifier_error(struct xfs_buf *bp, int error,
 extern void xfs_inode_verifier_error(struct xfs_inode *ip, int error,
 			const char *name, const void *buf, size_t bufsz,
 			xfs_failaddr_t failaddr);
+extern void xfs_send_uevent(struct super_block *sb, enum fs_event_type event);
 
 #define	XFS_ERROR_REPORT(e, lvl, mp)	\
 	xfs_error_report(e, lvl, mp, __FILE__, __LINE__, __return_address)


More information about the Devel mailing list