From: Goldwyn Rodrigues <rgoldwyn@suse.de>
To: linux-fsdevel@vger.kernel.org
Cc: Goldwyn Rodrigues <rgoldwyn@suse.com>
Subject: [PoC 4/7] Report file system events
Date: Thu, 28 Apr 2016 21:01:19 -0500 [thread overview]
Message-ID: <1461895282-4941-5-git-send-email-rgoldwyn@suse.de> (raw)
In-Reply-To: <1461895282-4941-1-git-send-email-rgoldwyn@suse.de>
From: Goldwyn Rodrigues <rgoldwyn@suse.com>
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@suse.com>
---
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
next prev parent reply other threads:[~2016-04-29 2:01 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-29 2:01 [PoC 0/7] Kobjectify filesystem Goldwyn Rodrigues
2016-04-29 2:01 ` [PoC 1/7] Add kset to file_system_type Goldwyn Rodrigues
2016-04-29 2:01 ` [PoC 2/7] Add kobject to super_block Goldwyn Rodrigues
2016-04-29 2:26 ` Al Viro
2016-04-29 19:09 ` Goldwyn Rodrigues
2016-04-29 2:01 ` [PoC 3/7] Create sysfs files under sb Goldwyn Rodrigues
2016-04-29 2:01 ` Goldwyn Rodrigues [this message]
2016-04-29 2:01 ` [PoC 5/7] ocfs2: Use the sb's kset Goldwyn Rodrigues
2016-04-29 2:01 ` [PoC 6/7] ocfs2: create filecheck files Goldwyn Rodrigues
2016-04-29 2:01 ` [PoC 7/7] ocfs2: report inode errors to userspace Goldwyn Rodrigues
2016-04-29 17:32 ` [PoC 0/7] Kobjectify filesystem Viacheslav Dubeyko
2016-04-29 18:28 ` Goldwyn Rodrigues
2016-04-29 20:16 ` Viacheslav Dubeyko
2016-04-29 22:09 ` Goldwyn Rodrigues
2016-04-29 22:31 ` Al Viro
2016-04-29 22:45 ` Goldwyn Rodrigues
2016-05-04 22:20 ` Dave Chinner
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=1461895282-4941-5-git-send-email-rgoldwyn@suse.de \
--to=rgoldwyn@suse.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=rgoldwyn@suse.com \
/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).