Skip to content

Commit abdb318

Browse files
Jiro SEKIBAkonis
authored andcommitted
nilfs2: replace mark_inode_dirty as nilfs_mark_inode_dirty
Replace mark_inode_dirty() as nilfs_mark_inode_dirty() to reduce deep function calls. Signed-off-by: Jiro SEKIBA <jir@unicus.jp> Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
1 parent 3534573 commit abdb318

3 files changed

Lines changed: 20 additions & 20 deletions

File tree

‎fs/nilfs2/dir.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ int nilfs_add_link(struct dentry *dentry, struct inode *inode)
548548
nilfs_commit_chunk(page, page->mapping, from, to);
549549
dir->i_mtime = dir->i_ctime = CURRENT_TIME;
550550
/* NILFS_I(dir)->i_flags &= ~NILFS_BTREE_FL; */
551-
mark_inode_dirty(dir);
551+
nilfs_mark_inode_dirty(dir);
552552
/* OFFSET_CACHE */
553553
out_put:
554554
nilfs_put_page(page);

‎fs/nilfs2/inode.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ int nilfs_get_block(struct inode *inode, sector_t blkoff,
9797
nilfs_transaction_abort(inode->i_sb);
9898
goto out;
9999
}
100-
mark_inode_dirty(inode);
100+
nilfs_mark_inode_dirty(inode);
101101
nilfs_transaction_commit(inode->i_sb); /* never fails */
102102
/* Error handling should be detailed */
103103
set_buffer_new(bh_result);
@@ -598,7 +598,7 @@ void nilfs_truncate(struct inode *inode)
598598
if (IS_SYNC(inode))
599599
nilfs_set_transaction_flag(NILFS_TI_SYNC);
600600

601-
mark_inode_dirty(inode);
601+
nilfs_mark_inode_dirty(inode);
602602
nilfs_set_file_dirty(NILFS_SB(sb), inode, 0);
603603
nilfs_transaction_commit(sb);
604604
/* May construct a logical segment and may fail in sync mode.
@@ -623,7 +623,7 @@ void nilfs_delete_inode(struct inode *inode)
623623
truncate_inode_pages(&inode->i_data, 0);
624624

625625
nilfs_truncate_bmap(ii, 0);
626-
mark_inode_dirty(inode);
626+
nilfs_mark_inode_dirty(inode);
627627
nilfs_free_inode(inode);
628628
/* nilfs_free_inode() marks inode buffer dirty */
629629
if (IS_SYNC(inode))

‎fs/nilfs2/namei.c‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static int nilfs_create(struct inode *dir, struct dentry *dentry, int mode,
120120
inode->i_op = &nilfs_file_inode_operations;
121121
inode->i_fop = &nilfs_file_operations;
122122
inode->i_mapping->a_ops = &nilfs_aops;
123-
mark_inode_dirty(inode);
123+
nilfs_mark_inode_dirty(inode);
124124
err = nilfs_add_nondir(dentry, inode);
125125
}
126126
if (!err)
@@ -148,7 +148,7 @@ nilfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev)
148148
err = PTR_ERR(inode);
149149
if (!IS_ERR(inode)) {
150150
init_special_inode(inode, inode->i_mode, rdev);
151-
mark_inode_dirty(inode);
151+
nilfs_mark_inode_dirty(inode);
152152
err = nilfs_add_nondir(dentry, inode);
153153
}
154154
if (!err)
@@ -201,7 +201,7 @@ static int nilfs_symlink(struct inode *dir, struct dentry *dentry,
201201

202202
out_fail:
203203
drop_nlink(inode);
204-
mark_inode_dirty(inode);
204+
nilfs_mark_inode_dirty(inode);
205205
iput(inode);
206206
goto out;
207207
}
@@ -267,7 +267,7 @@ static int nilfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
267267
if (err)
268268
goto out_fail;
269269

270-
mark_inode_dirty(inode);
270+
nilfs_mark_inode_dirty(inode);
271271
d_instantiate(dentry, inode);
272272
out:
273273
if (!err)
@@ -280,11 +280,11 @@ static int nilfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
280280
out_fail:
281281
drop_nlink(inode);
282282
drop_nlink(inode);
283-
mark_inode_dirty(inode);
283+
nilfs_mark_inode_dirty(inode);
284284
iput(inode);
285285
out_dir:
286286
drop_nlink(dir);
287-
mark_inode_dirty(dir);
287+
nilfs_mark_inode_dirty(dir);
288288
goto out;
289289
}
290290

@@ -334,8 +334,8 @@ static int nilfs_unlink(struct inode *dir, struct dentry *dentry)
334334
err = nilfs_do_unlink(dir, dentry);
335335

336336
if (!err) {
337-
mark_inode_dirty(dir);
338-
mark_inode_dirty(dentry->d_inode);
337+
nilfs_mark_inode_dirty(dir);
338+
nilfs_mark_inode_dirty(dentry->d_inode);
339339
err = nilfs_transaction_commit(dir->i_sb);
340340
} else
341341
nilfs_transaction_abort(dir->i_sb);
@@ -359,9 +359,9 @@ static int nilfs_rmdir(struct inode *dir, struct dentry *dentry)
359359
if (!err) {
360360
inode->i_size = 0;
361361
drop_nlink(inode);
362-
mark_inode_dirty(inode);
362+
nilfs_mark_inode_dirty(inode);
363363
drop_nlink(dir);
364-
mark_inode_dirty(dir);
364+
nilfs_mark_inode_dirty(dir);
365365
}
366366
}
367367
if (!err)
@@ -414,12 +414,12 @@ static int nilfs_rename(struct inode *old_dir, struct dentry *old_dentry,
414414
goto out_dir;
415415
inc_nlink(old_inode);
416416
nilfs_set_link(new_dir, new_de, new_page, old_inode);
417-
mark_inode_dirty(new_dir);
417+
nilfs_mark_inode_dirty(new_dir);
418418
new_inode->i_ctime = CURRENT_TIME;
419419
if (dir_de)
420420
drop_nlink(new_inode);
421421
drop_nlink(new_inode);
422-
mark_inode_dirty(new_inode);
422+
nilfs_mark_inode_dirty(new_inode);
423423
} else {
424424
if (dir_de) {
425425
err = -EMLINK;
@@ -430,12 +430,12 @@ static int nilfs_rename(struct inode *old_dir, struct dentry *old_dentry,
430430
err = nilfs_add_link(new_dentry, old_inode);
431431
if (err) {
432432
drop_nlink(old_inode);
433-
mark_inode_dirty(old_inode);
433+
nilfs_mark_inode_dirty(old_inode);
434434
goto out_dir;
435435
}
436436
if (dir_de) {
437437
inc_nlink(new_dir);
438-
mark_inode_dirty(new_dir);
438+
nilfs_mark_inode_dirty(new_dir);
439439
}
440440
}
441441

@@ -452,8 +452,8 @@ static int nilfs_rename(struct inode *old_dir, struct dentry *old_dentry,
452452
nilfs_set_link(old_inode, dir_de, dir_page, new_dir);
453453
drop_nlink(old_dir);
454454
}
455-
mark_inode_dirty(old_dir);
456-
mark_inode_dirty(old_inode);
455+
nilfs_mark_inode_dirty(old_dir);
456+
nilfs_mark_inode_dirty(old_inode);
457457

458458
err = nilfs_transaction_commit(old_dir->i_sb);
459459
return err;

0 commit comments

Comments
 (0)