Commit 140236b4 authored by Artem Bityutskiy's avatar Artem Bityutskiy Committed by Linus Torvalds

VFS: introduce s_dirty accessors

This patch introduces 3 VFS accessors: 'sb_mark_dirty()',
'sb_mark_clean()', and 'sb_is_dirty()'. They simply
set 'sb->s_dirt' or test 'sb->s_dirt'. The plan is to make
every FS use these accessors later instead of manipulating
the 'sb->s_dirt' flag directly.

Ultimately, this change is a preparation for the periodic
superblock synchronization optimization which is about
preventing the "sync_supers" kernel thread from waking up
even if there is nothing to synchronize.

This patch does not do any functional change, just adds
accessor functions.
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 47a716cf
...@@ -1783,6 +1783,19 @@ extern int get_sb_pseudo(struct file_system_type *, char *, ...@@ -1783,6 +1783,19 @@ extern int get_sb_pseudo(struct file_system_type *, char *,
struct vfsmount *mnt); struct vfsmount *mnt);
extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb);
static inline void sb_mark_dirty(struct super_block *sb)
{
sb->s_dirt = 1;
}
static inline void sb_mark_clean(struct super_block *sb)
{
sb->s_dirt = 0;
}
static inline int sb_is_dirty(struct super_block *sb)
{
return sb->s_dirt;
}
/* Alas, no aliases. Too much hassle with bringing module.h everywhere */ /* Alas, no aliases. Too much hassle with bringing module.h everywhere */
#define fops_get(fops) \ #define fops_get(fops) \
(((fops) && try_module_get((fops)->owner) ? (fops) : NULL)) (((fops) && try_module_get((fops)->owner) ? (fops) : NULL))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment