diff options
Diffstat (limited to 'fs/ocfs2/namei.c')
-rw-r--r-- | fs/ocfs2/namei.c | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index 689761b57a18..c07217ad8796 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c | |||
@@ -375,7 +375,8 @@ static int ocfs2_mknod(struct inode *dir, | |||
375 | goto leave; | 375 | goto leave; |
376 | } | 376 | } |
377 | 377 | ||
378 | status = ocfs2_journal_access_di(handle, dir, parent_fe_bh, | 378 | status = ocfs2_journal_access_di(handle, INODE_CACHE(dir), |
379 | parent_fe_bh, | ||
379 | OCFS2_JOURNAL_ACCESS_WRITE); | 380 | OCFS2_JOURNAL_ACCESS_WRITE); |
380 | if (status < 0) { | 381 | if (status < 0) { |
381 | mlog_errno(status); | 382 | mlog_errno(status); |
@@ -509,7 +510,8 @@ static int ocfs2_mknod_locked(struct ocfs2_super *osb, | |||
509 | } | 510 | } |
510 | ocfs2_set_new_buffer_uptodate(INODE_CACHE(inode), *new_fe_bh); | 511 | ocfs2_set_new_buffer_uptodate(INODE_CACHE(inode), *new_fe_bh); |
511 | 512 | ||
512 | status = ocfs2_journal_access_di(handle, inode, *new_fe_bh, | 513 | status = ocfs2_journal_access_di(handle, INODE_CACHE(inode), |
514 | *new_fe_bh, | ||
513 | OCFS2_JOURNAL_ACCESS_CREATE); | 515 | OCFS2_JOURNAL_ACCESS_CREATE); |
514 | if (status < 0) { | 516 | if (status < 0) { |
515 | mlog_errno(status); | 517 | mlog_errno(status); |
@@ -565,7 +567,7 @@ static int ocfs2_mknod_locked(struct ocfs2_super *osb, | |||
565 | } | 567 | } |
566 | 568 | ||
567 | ocfs2_populate_inode(inode, fe, 1); | 569 | ocfs2_populate_inode(inode, fe, 1); |
568 | ocfs2_inode_set_new(osb, inode); | 570 | ocfs2_ci_set_new(osb, INODE_CACHE(inode)); |
569 | if (!ocfs2_mount_local(osb)) { | 571 | if (!ocfs2_mount_local(osb)) { |
570 | status = ocfs2_create_new_inode_locks(inode); | 572 | status = ocfs2_create_new_inode_locks(inode); |
571 | if (status < 0) | 573 | if (status < 0) |
@@ -682,7 +684,7 @@ static int ocfs2_link(struct dentry *old_dentry, | |||
682 | goto out_unlock_inode; | 684 | goto out_unlock_inode; |
683 | } | 685 | } |
684 | 686 | ||
685 | err = ocfs2_journal_access_di(handle, inode, fe_bh, | 687 | err = ocfs2_journal_access_di(handle, INODE_CACHE(inode), fe_bh, |
686 | OCFS2_JOURNAL_ACCESS_WRITE); | 688 | OCFS2_JOURNAL_ACCESS_WRITE); |
687 | if (err < 0) { | 689 | if (err < 0) { |
688 | mlog_errno(err); | 690 | mlog_errno(err); |
@@ -866,7 +868,7 @@ static int ocfs2_unlink(struct inode *dir, | |||
866 | goto leave; | 868 | goto leave; |
867 | } | 869 | } |
868 | 870 | ||
869 | status = ocfs2_journal_access_di(handle, inode, fe_bh, | 871 | status = ocfs2_journal_access_di(handle, INODE_CACHE(inode), fe_bh, |
870 | OCFS2_JOURNAL_ACCESS_WRITE); | 872 | OCFS2_JOURNAL_ACCESS_WRITE); |
871 | if (status < 0) { | 873 | if (status < 0) { |
872 | mlog_errno(status); | 874 | mlog_errno(status); |
@@ -1284,7 +1286,8 @@ static int ocfs2_rename(struct inode *old_dir, | |||
1284 | goto bail; | 1286 | goto bail; |
1285 | } | 1287 | } |
1286 | } | 1288 | } |
1287 | status = ocfs2_journal_access_di(handle, new_inode, newfe_bh, | 1289 | status = ocfs2_journal_access_di(handle, INODE_CACHE(new_inode), |
1290 | newfe_bh, | ||
1288 | OCFS2_JOURNAL_ACCESS_WRITE); | 1291 | OCFS2_JOURNAL_ACCESS_WRITE); |
1289 | if (status < 0) { | 1292 | if (status < 0) { |
1290 | mlog_errno(status); | 1293 | mlog_errno(status); |
@@ -1331,7 +1334,8 @@ static int ocfs2_rename(struct inode *old_dir, | |||
1331 | old_inode->i_ctime = CURRENT_TIME; | 1334 | old_inode->i_ctime = CURRENT_TIME; |
1332 | mark_inode_dirty(old_inode); | 1335 | mark_inode_dirty(old_inode); |
1333 | 1336 | ||
1334 | status = ocfs2_journal_access_di(handle, old_inode, old_inode_bh, | 1337 | status = ocfs2_journal_access_di(handle, INODE_CACHE(old_inode), |
1338 | old_inode_bh, | ||
1335 | OCFS2_JOURNAL_ACCESS_WRITE); | 1339 | OCFS2_JOURNAL_ACCESS_WRITE); |
1336 | if (status >= 0) { | 1340 | if (status >= 0) { |
1337 | old_di = (struct ocfs2_dinode *) old_inode_bh->b_data; | 1341 | old_di = (struct ocfs2_dinode *) old_inode_bh->b_data; |
@@ -1407,9 +1411,10 @@ static int ocfs2_rename(struct inode *old_dir, | |||
1407 | (int)old_dir_nlink, old_dir->i_nlink); | 1411 | (int)old_dir_nlink, old_dir->i_nlink); |
1408 | } else { | 1412 | } else { |
1409 | struct ocfs2_dinode *fe; | 1413 | struct ocfs2_dinode *fe; |
1410 | status = ocfs2_journal_access_di(handle, old_dir, | 1414 | status = ocfs2_journal_access_di(handle, |
1411 | old_dir_bh, | 1415 | INODE_CACHE(old_dir), |
1412 | OCFS2_JOURNAL_ACCESS_WRITE); | 1416 | old_dir_bh, |
1417 | OCFS2_JOURNAL_ACCESS_WRITE); | ||
1413 | fe = (struct ocfs2_dinode *) old_dir_bh->b_data; | 1418 | fe = (struct ocfs2_dinode *) old_dir_bh->b_data; |
1414 | ocfs2_set_links_count(fe, old_dir->i_nlink); | 1419 | ocfs2_set_links_count(fe, old_dir->i_nlink); |
1415 | status = ocfs2_journal_dirty(handle, old_dir_bh); | 1420 | status = ocfs2_journal_dirty(handle, old_dir_bh); |
@@ -1530,7 +1535,8 @@ static int ocfs2_create_symlink_data(struct ocfs2_super *osb, | |||
1530 | ocfs2_set_new_buffer_uptodate(INODE_CACHE(inode), | 1535 | ocfs2_set_new_buffer_uptodate(INODE_CACHE(inode), |
1531 | bhs[virtual]); | 1536 | bhs[virtual]); |
1532 | 1537 | ||
1533 | status = ocfs2_journal_access(handle, inode, bhs[virtual], | 1538 | status = ocfs2_journal_access(handle, INODE_CACHE(inode), |
1539 | bhs[virtual], | ||
1534 | OCFS2_JOURNAL_ACCESS_CREATE); | 1540 | OCFS2_JOURNAL_ACCESS_CREATE); |
1535 | if (status < 0) { | 1541 | if (status < 0) { |
1536 | mlog_errno(status); | 1542 | mlog_errno(status); |
@@ -1918,7 +1924,9 @@ static int ocfs2_orphan_add(struct ocfs2_super *osb, | |||
1918 | goto leave; | 1924 | goto leave; |
1919 | } | 1925 | } |
1920 | 1926 | ||
1921 | status = ocfs2_journal_access_di(handle, orphan_dir_inode, orphan_dir_bh, | 1927 | status = ocfs2_journal_access_di(handle, |
1928 | INODE_CACHE(orphan_dir_inode), | ||
1929 | orphan_dir_bh, | ||
1922 | OCFS2_JOURNAL_ACCESS_WRITE); | 1930 | OCFS2_JOURNAL_ACCESS_WRITE); |
1923 | if (status < 0) { | 1931 | if (status < 0) { |
1924 | mlog_errno(status); | 1932 | mlog_errno(status); |
@@ -2003,7 +2011,9 @@ int ocfs2_orphan_del(struct ocfs2_super *osb, | |||
2003 | goto leave; | 2011 | goto leave; |
2004 | } | 2012 | } |
2005 | 2013 | ||
2006 | status = ocfs2_journal_access_di(handle,orphan_dir_inode, orphan_dir_bh, | 2014 | status = ocfs2_journal_access_di(handle, |
2015 | INODE_CACHE(orphan_dir_inode), | ||
2016 | orphan_dir_bh, | ||
2007 | OCFS2_JOURNAL_ACCESS_WRITE); | 2017 | OCFS2_JOURNAL_ACCESS_WRITE); |
2008 | if (status < 0) { | 2018 | if (status < 0) { |
2009 | mlog_errno(status); | 2019 | mlog_errno(status); |