lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 4 Jun 2009 14:01:40 -0500
From:	Felix Blyakher <felixb@....com>
To:	Artem Bityutskiy <dedekind@...radead.org>
Cc:	Al Viro <viro@...IV.linux.org.uk>, linux-kernel@...r.kernel.org,
	linux-fsdevel@...r.kernel.org,
	Christoph Hellwig <hch@...radead.org>,
	Artem Bityutskiy <Artem.Bityutskiy@...ia.com>
Subject: Re: [PATCH v2 01/17] VFS: introduce helpers for manipulation s_dirty flag


On Jun 4, 2009, at 5:41 AM, Artem Bityutskiy wrote:

> From: Artem Bityutskiy <Artem.Bityutskiy@...ia.com>
>
> This patch introduces 3 new VFS helpers: 'mark_sb_dirty()',
> 'mark_sb_clean()', and 'sb_is_dirty()'.

Should the name be is_sb_dirty() for consistency?

Felix

> The helpers simply
> set 'sb->s_dirt' or test 'sb->s_dirt'. The plan is to make
> every FS use these helpers instead of manipulating
> 'sb->s_dirt' directly. And the further plan is to stop the
> periodic write-back when there is no dirt.
>
> This patch is just a preparation. No functional changes yet.
>
> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@...ia.com>
> Cc: Christoph Hellwig <hch@...radead.org>
> Cc: Al Viro <viro@...iv.linux.org.uk>
> ---
> include/linux/fs.h |   17 +++++++++++++++++
> 1 files changed, 17 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 73242c3..2d67017 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -1782,6 +1782,23 @@ extern int get_sb_pseudo(struct  
> file_system_type *, char *,
> extern void simple_set_mnt(struct vfsmount *mnt, struct super_block  
> *sb);
> int __put_super_and_need_restart(struct super_block *sb);
>
> +/*
> + * Note, VFS does not provide any protection for the super block  
> clean/dirty
> + * state. File-systems should take care of this.
> + */
> +static inline void mark_sb_dirty(struct super_block *sb)
> +{
> +	sb->s_dirt = 1;
> +}
> +static inline void mark_sb_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 */
> #define fops_get(fops) \
> 	(((fops) && try_module_get((fops)->owner) ? (fops) : NULL))
> -- 
> 1.6.0.6
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux- 
> fsdevel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ