Commit 140236b4b1c749c9b795ea3d11558a0eb5a3a080

Authored by Artem Bityutskiy
Committed by Linus Torvalds
1 parent 47a716cf0c

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: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 13 additions and 0 deletions Side-by-side Diff

... ... @@ -1783,6 +1783,19 @@
1783 1783 struct vfsmount *mnt);
1784 1784 extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb);
1785 1785  
  1786 +static inline void sb_mark_dirty(struct super_block *sb)
  1787 +{
  1788 + sb->s_dirt = 1;
  1789 +}
  1790 +static inline void sb_mark_clean(struct super_block *sb)
  1791 +{
  1792 + sb->s_dirt = 0;
  1793 +}
  1794 +static inline int sb_is_dirty(struct super_block *sb)
  1795 +{
  1796 + return sb->s_dirt;
  1797 +}
  1798 +
1786 1799 /* Alas, no aliases. Too much hassle with bringing module.h everywhere */
1787 1800 #define fops_get(fops) \
1788 1801 (((fops) && try_module_get((fops)->owner) ? (fops) : NULL))