From: Ryusuke Konishi Date: Thu, 16 Apr 2015 19:46:47 +0000 (-0700) Subject: nilfs2: put out gfp mask manipulation from nilfs_set_inode_flags() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0ce187c4f32d77eae077f249aa10656b5eef5f28;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git nilfs2: put out gfp mask manipulation from nilfs_set_inode_flags() nilfs_set_inode_flags() function adjusts gfp-mask of inode->i_mapping as well as i_flags, however, this coupling of operations is not appropriate. For instance, nilfs_ioctl_setflags(), one of three callers of nilfs_set_inode_flags(), doesn't need to reinitialize the gfp-mask at all. In addition, nilfs_new_inode(), another caller of nilfs_set_inode_flags(), doesn't either because it has already initialized the gfp-mask. Only __nilfs_read_inode(), the remaining caller, needs it. So, this moves the gfp mask manipulation to __nilfs_read_inode() from nilfs_set_inode_flags(). Signed-off-by: Ryusuke Konishi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c index 07577cbe668a..8138b1176867 100644 --- a/fs/nilfs2/inode.c +++ b/fs/nilfs2/inode.c @@ -456,8 +456,6 @@ void nilfs_set_inode_flags(struct inode *inode) inode->i_flags |= S_NOATIME; if (flags & FS_DIRSYNC_FL) inode->i_flags |= S_DIRSYNC; - mapping_set_gfp_mask(inode->i_mapping, - mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS); } int nilfs_read_inode_common(struct inode *inode, @@ -542,6 +540,8 @@ static int __nilfs_read_inode(struct super_block *sb, brelse(bh); up_read(&NILFS_MDT(nilfs->ns_dat)->mi_sem); nilfs_set_inode_flags(inode); + mapping_set_gfp_mask(inode->i_mapping, + mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS); return 0; failed_unmap: