Re: [PATCH V2] fs/jfs/jfs_inode.c: atomically set inode->i_flags

Dave Kleikamp <[email protected]>
Newsgroups gmane.comp.file-systems.jfs.general,gmane.linux.kernel
Message-ID <[email protected]>
Looks good to me. I'll push it upstream.

Thanks,
Dave

On 04/14/2014 02:39 AM, Fabian Frederick wrote:
> According to commit 5f16f3225b0624
> 
> ext4: atomically set inode->i_flags in ext4_set_inode_flags()
> 
> Inspired-by: "Theodore Ts'o" <[email protected]>
> Cc: Dave Kleikamp <[email protected]>
> Cc: "Theodore Ts'o" <[email protected]>
> Signed-off-by: Fabian Frederick <[email protected]>
> ---
>  fs/jfs/jfs_inode.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/fs/jfs/jfs_inode.c b/fs/jfs/jfs_inode.c
> index 7f464c5..6b0f816 100644
> --- a/fs/jfs/jfs_inode.c
> +++ b/fs/jfs/jfs_inode.c
> @@ -29,20 +29,20 @@
>  void jfs_set_inode_flags(struct inode *inode)
>  {
>  	unsigned int flags = JFS_IP(inode)->mode2;
> -
> -	inode->i_flags &= ~(S_IMMUTABLE | S_APPEND |
> -		S_NOATIME | S_DIRSYNC | S_SYNC);
> +	unsigned int new_fl = 0;
>  
>  	if (flags & JFS_IMMUTABLE_FL)
> -		inode->i_flags |= S_IMMUTABLE;
> +		new_fl |= S_IMMUTABLE;
>  	if (flags & JFS_APPEND_FL)
> -		inode->i_flags |= S_APPEND;
> +		new_fl |= S_APPEND;
>  	if (flags & JFS_NOATIME_FL)
> -		inode->i_flags |= S_NOATIME;
> +		new_fl |= S_NOATIME;
>  	if (flags & JFS_DIRSYNC_FL)
> -		inode->i_flags |= S_DIRSYNC;
> +		new_fl |= S_DIRSYNC;
>  	if (flags & JFS_SYNC_FL)
> -		inode->i_flags |= S_SYNC;
> +		new_fl |= S_SYNC;
> +	inode_set_flags(inode, new_fl, S_IMMUTABLE | S_APPEND | S_NOATIME |
> +			S_DIRSYNC | S_SYNC);
>  }
>  
>  void jfs_get_inode_flags(struct jfs_inode_info *jfs_ip)
> 

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.