aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/namei.c
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-08-15 14:11:45 -0400
committerSage Weil <sage@inktank.com>2013-08-15 14:11:45 -0400
commitee3e542fec6e69bc9fb668698889a37d93950ddf (patch)
treee74ee766a4764769ef1d3d45d266b4dea64101d3 /fs/f2fs/namei.c
parentfe2a801b50c0bb8039d627e5ae1fec249d10ff39 (diff)
parentf1d6e17f540af37bb1891480143669ba7636c4cf (diff)
Merge remote-tracking branch 'linus/master' into testing
Diffstat (limited to 'fs/f2fs/namei.c')
-rw-r--r--fs/f2fs/namei.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index 47abc9722b17..64c07169df05 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -112,7 +112,7 @@ static inline void set_cold_files(struct f2fs_sb_info *sbi, struct inode *inode,
112 int count = le32_to_cpu(sbi->raw_super->extension_count); 112 int count = le32_to_cpu(sbi->raw_super->extension_count);
113 for (i = 0; i < count; i++) { 113 for (i = 0; i < count; i++) {
114 if (is_multimedia_file(name, extlist[i])) { 114 if (is_multimedia_file(name, extlist[i])) {
115 set_cold_file(inode); 115 file_set_cold(inode);
116 break; 116 break;
117 } 117 }
118 } 118 }
@@ -149,8 +149,7 @@ static int f2fs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
149 149
150 alloc_nid_done(sbi, ino); 150 alloc_nid_done(sbi, ino);
151 151
152 if (!sbi->por_doing) 152 d_instantiate(dentry, inode);
153 d_instantiate(dentry, inode);
154 unlock_new_inode(inode); 153 unlock_new_inode(inode);
155 return 0; 154 return 0;
156out: 155out:
@@ -173,7 +172,7 @@ static int f2fs_link(struct dentry *old_dentry, struct inode *dir,
173 f2fs_balance_fs(sbi); 172 f2fs_balance_fs(sbi);
174 173
175 inode->i_ctime = CURRENT_TIME; 174 inode->i_ctime = CURRENT_TIME;
176 atomic_inc(&inode->i_count); 175 ihold(inode);
177 176
178 set_inode_flag(F2FS_I(inode), FI_INC_LINK); 177 set_inode_flag(F2FS_I(inode), FI_INC_LINK);
179 ilock = mutex_lock_op(sbi); 178 ilock = mutex_lock_op(sbi);
@@ -182,17 +181,10 @@ static int f2fs_link(struct dentry *old_dentry, struct inode *dir,
182 if (err) 181 if (err)
183 goto out; 182 goto out;
184 183
185 /*
186 * This file should be checkpointed during fsync.
187 * We lost i_pino from now on.
188 */
189 set_cp_file(inode);
190
191 d_instantiate(dentry, inode); 184 d_instantiate(dentry, inode);
192 return 0; 185 return 0;
193out: 186out:
194 clear_inode_flag(F2FS_I(inode), FI_INC_LINK); 187 clear_inode_flag(F2FS_I(inode), FI_INC_LINK);
195 make_bad_inode(inode);
196 iput(inode); 188 iput(inode);
197 return err; 189 return err;
198} 190}
@@ -498,6 +490,7 @@ const struct inode_operations f2fs_dir_inode_operations = {
498 .rmdir = f2fs_rmdir, 490 .rmdir = f2fs_rmdir,
499 .mknod = f2fs_mknod, 491 .mknod = f2fs_mknod,
500 .rename = f2fs_rename, 492 .rename = f2fs_rename,
493 .getattr = f2fs_getattr,
501 .setattr = f2fs_setattr, 494 .setattr = f2fs_setattr,
502 .get_acl = f2fs_get_acl, 495 .get_acl = f2fs_get_acl,
503#ifdef CONFIG_F2FS_FS_XATTR 496#ifdef CONFIG_F2FS_FS_XATTR
@@ -512,6 +505,7 @@ const struct inode_operations f2fs_symlink_inode_operations = {
512 .readlink = generic_readlink, 505 .readlink = generic_readlink,
513 .follow_link = page_follow_link_light, 506 .follow_link = page_follow_link_light,
514 .put_link = page_put_link, 507 .put_link = page_put_link,
508 .getattr = f2fs_getattr,
515 .setattr = f2fs_setattr, 509 .setattr = f2fs_setattr,
516#ifdef CONFIG_F2FS_FS_XATTR 510#ifdef CONFIG_F2FS_FS_XATTR
517 .setxattr = generic_setxattr, 511 .setxattr = generic_setxattr,
@@ -522,6 +516,7 @@ const struct inode_operations f2fs_symlink_inode_operations = {
522}; 516};
523 517
524const struct inode_operations f2fs_special_inode_operations = { 518const struct inode_operations f2fs_special_inode_operations = {
519 .getattr = f2fs_getattr,
525 .setattr = f2fs_setattr, 520 .setattr = f2fs_setattr,
526 .get_acl = f2fs_get_acl, 521 .get_acl = f2fs_get_acl,
527#ifdef CONFIG_F2FS_FS_XATTR 522#ifdef CONFIG_F2FS_FS_XATTR