[RFC 3/8] 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 42568eb..c6b8801 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -153,6 +153,12 @@ static void destroy_super_rcu(struct rcu_head *head)
 	schedule_work(&s->destroy_work);
 }
 
+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 5ac8883..1cf2e011 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2071,6 +2071,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