aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2015-04-16 15:46:47 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-17 09:04:04 -0400
commit0ce187c4f32d77eae077f249aa10656b5eef5f28 (patch)
treebcac5ad738b1818a37d195e94a6496ef8bb12cdf /fs/nilfs2
parent3377f843cf80e33d63f1a3ded67fd129a298c6b0 (diff)
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 <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/nilfs2')
-rw-r--r--fs/nilfs2/inode.c4
1 files changed, 2 insertions, 2 deletions
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)
456 inode->i_flags |= S_NOATIME; 456 inode->i_flags |= S_NOATIME;
457 if (flags & FS_DIRSYNC_FL) 457 if (flags & FS_DIRSYNC_FL)
458 inode->i_flags |= S_DIRSYNC; 458 inode->i_flags |= S_DIRSYNC;
459 mapping_set_gfp_mask(inode->i_mapping,
460 mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS);
461} 459}
462 460
463int nilfs_read_inode_common(struct inode *inode, 461int nilfs_read_inode_common(struct inode *inode,
@@ -542,6 +540,8 @@ static int __nilfs_read_inode(struct super_block *sb,
542 brelse(bh); 540 brelse(bh);
543 up_read(&NILFS_MDT(nilfs->ns_dat)->mi_sem); 541 up_read(&NILFS_MDT(nilfs->ns_dat)->mi_sem);
544 nilfs_set_inode_flags(inode); 542 nilfs_set_inode_flags(inode);
543 mapping_set_gfp_mask(inode->i_mapping,
544 mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS);
545 return 0; 545 return 0;
546 546
547 failed_unmap: 547 failed_unmap: