[PoC 4/7] Report file system events

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Goldwyn Rodrigues <rgoldwyn@xxxxxxxx>

This would allow the filesystems to report back events to the userspace.
Examples could be but not limited to:
 - Reporting ENOSPC on a filesystem
 	This could be used to trigger commands that would either clear
	up temporary files and/or inform the administrator
 - Reporting file errors
 	Filesystems tend to turn read-only at the drop of a hat. This could
	be used to develop utilities that would focus on clearing the errors
	as opposed to umounting and checking the entire filesystem. Even
	though checking the entire filesystem may be a good idea for this.
	Such a feature would improve availability (yes, perhaps at the cost of
	integrity) and improve modularize online filesystem checking.

This was the original idea of this effort which extended to kobjectifying
the entire filesystem series.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@xxxxxxxx>
---
 fs/super.c         | 6 ++++++
 include/linux/fs.h | 1 +
 2 files changed, 7 insertions(+)

diff --git a/fs/super.c b/fs/super.c
index f6cef10..50b5ae5 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -190,6 +190,12 @@ static int register_kobj(struct super_block *sb)
 			"%s", sb->s_id);
 }
 
+int sb_report_event(struct super_block *sb, char *envp[])
+{
+	return kobject_uevent_env(&sb->s_kobj, KOBJ_CHANGE, envp);
+}
+EXPORT_SYMBOL(sb_report_event);
+
 /**
  *	destroy_super	-	frees a superblock
  *	@s: superblock to free
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 59b84a8..d356485 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2092,6 +2092,7 @@ extern int vfs_ustat(dev_t, struct kstatfs *);
 extern int freeze_super(struct super_block *super);
 extern int thaw_super(struct super_block *super);
 extern bool our_mnt(struct vfsmount *mnt);
+extern int sb_report_event(struct super_block *sb, char *envp[]);
 
 extern int current_umask(void);
 
-- 
2.6.6

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux