aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/namei.c
diff options
context:
space:
mode:
authorJoel Becker <joel.becker@oracle.com>2010-03-19 17:13:52 -0400
committerJoel Becker <joel.becker@oracle.com>2010-05-05 21:17:29 -0400
commitec20cec7a351584ca6c70ead012e73d61f9a8e04 (patch)
tree39af308ae07ab168313bb50ced1bb1ae7ef7e6a3 /fs/ocfs2/namei.c
parentb4414eea0e7b9c134262c801a87e338bf675962c (diff)
ocfs2: Make ocfs2_journal_dirty() void.
jbd[2]_journal_dirty_metadata() only returns 0. It's been returning 0 since before the kernel moved to git. There is no point in checking this error. ocfs2_journal_dirty() has been faithfully returning the status since the beginning. All over ocfs2, we have blocks of code checking this can't fail status. In the past few years, we've tried to avoid adding these checks, because they are pointless. But anyone who looks at our code assumes they are needed. Finally, ocfs2_journal_dirty() is made a void function. All error checking is removed from other files. We'll BUG_ON() the status of jbd2_journal_dirty_metadata() just in case they change it someday. They won't. Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/namei.c')
-rw-r--r--fs/ocfs2/namei.c62
1 files changed, 10 insertions, 52 deletions
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
index d9cd4e373a53..21d4a33d0f0e 100644
--- a/fs/ocfs2/namei.c
+++ b/fs/ocfs2/namei.c
@@ -384,11 +384,7 @@ static int ocfs2_mknod(struct inode *dir,
384 goto leave; 384 goto leave;
385 } 385 }
386 ocfs2_add_links_count(dirfe, 1); 386 ocfs2_add_links_count(dirfe, 1);
387 status = ocfs2_journal_dirty(handle, parent_fe_bh); 387 ocfs2_journal_dirty(handle, parent_fe_bh);
388 if (status < 0) {
389 mlog_errno(status);
390 goto leave;
391 }
392 inc_nlink(dir); 388 inc_nlink(dir);
393 } 389 }
394 390
@@ -556,11 +552,7 @@ static int ocfs2_mknod_locked(struct ocfs2_super *osb,
556 fel->l_count = cpu_to_le16(ocfs2_extent_recs_per_inode(osb->sb)); 552 fel->l_count = cpu_to_le16(ocfs2_extent_recs_per_inode(osb->sb));
557 } 553 }
558 554
559 status = ocfs2_journal_dirty(handle, *new_fe_bh); 555 ocfs2_journal_dirty(handle, *new_fe_bh);
560 if (status < 0) {
561 mlog_errno(status);
562 goto leave;
563 }
564 556
565 ocfs2_populate_inode(inode, fe, 1); 557 ocfs2_populate_inode(inode, fe, 1);
566 ocfs2_ci_set_new(osb, INODE_CACHE(inode)); 558 ocfs2_ci_set_new(osb, INODE_CACHE(inode));
@@ -694,14 +686,7 @@ static int ocfs2_link(struct dentry *old_dentry,
694 ocfs2_set_links_count(fe, inode->i_nlink); 686 ocfs2_set_links_count(fe, inode->i_nlink);
695 fe->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); 687 fe->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec);
696 fe->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); 688 fe->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec);
697 689 ocfs2_journal_dirty(handle, fe_bh);
698 err = ocfs2_journal_dirty(handle, fe_bh);
699 if (err < 0) {
700 ocfs2_add_links_count(fe, -1);
701 drop_nlink(inode);
702 mlog_errno(err);
703 goto out_commit;
704 }
705 690
706 err = ocfs2_add_entry(handle, dentry, inode, 691 err = ocfs2_add_entry(handle, dentry, inode,
707 OCFS2_I(inode)->ip_blkno, 692 OCFS2_I(inode)->ip_blkno,
@@ -898,12 +883,7 @@ static int ocfs2_unlink(struct inode *dir,
898 drop_nlink(inode); 883 drop_nlink(inode);
899 drop_nlink(inode); 884 drop_nlink(inode);
900 ocfs2_set_links_count(fe, inode->i_nlink); 885 ocfs2_set_links_count(fe, inode->i_nlink);
901 886 ocfs2_journal_dirty(handle, fe_bh);
902 status = ocfs2_journal_dirty(handle, fe_bh);
903 if (status < 0) {
904 mlog_errno(status);
905 goto leave;
906 }
907 887
908 dir->i_ctime = dir->i_mtime = CURRENT_TIME; 888 dir->i_ctime = dir->i_mtime = CURRENT_TIME;
909 if (S_ISDIR(inode->i_mode)) 889 if (S_ISDIR(inode->i_mode))
@@ -1321,12 +1301,7 @@ static int ocfs2_rename(struct inode *old_dir,
1321 ocfs2_set_links_count(newfe, 0); 1301 ocfs2_set_links_count(newfe, 0);
1322 else 1302 else
1323 ocfs2_add_links_count(newfe, -1); 1303 ocfs2_add_links_count(newfe, -1);
1324 1304 ocfs2_journal_dirty(handle, newfe_bh);
1325 status = ocfs2_journal_dirty(handle, newfe_bh);
1326 if (status < 0) {
1327 mlog_errno(status);
1328 goto bail;
1329 }
1330 } else { 1305 } else {
1331 /* if the name was not found in new_dir, add it now */ 1306 /* if the name was not found in new_dir, add it now */
1332 status = ocfs2_add_entry(handle, new_dentry, old_inode, 1307 status = ocfs2_add_entry(handle, new_dentry, old_inode,
@@ -1345,10 +1320,7 @@ static int ocfs2_rename(struct inode *old_dir,
1345 1320
1346 old_di->i_ctime = cpu_to_le64(old_inode->i_ctime.tv_sec); 1321 old_di->i_ctime = cpu_to_le64(old_inode->i_ctime.tv_sec);
1347 old_di->i_ctime_nsec = cpu_to_le32(old_inode->i_ctime.tv_nsec); 1322 old_di->i_ctime_nsec = cpu_to_le32(old_inode->i_ctime.tv_nsec);
1348 1323 ocfs2_journal_dirty(handle, old_inode_bh);
1349 status = ocfs2_journal_dirty(handle, old_inode_bh);
1350 if (status < 0)
1351 mlog_errno(status);
1352 } else 1324 } else
1353 mlog_errno(status); 1325 mlog_errno(status);
1354 1326
@@ -1420,7 +1392,7 @@ static int ocfs2_rename(struct inode *old_dir,
1420 OCFS2_JOURNAL_ACCESS_WRITE); 1392 OCFS2_JOURNAL_ACCESS_WRITE);
1421 fe = (struct ocfs2_dinode *) old_dir_bh->b_data; 1393 fe = (struct ocfs2_dinode *) old_dir_bh->b_data;
1422 ocfs2_set_links_count(fe, old_dir->i_nlink); 1394 ocfs2_set_links_count(fe, old_dir->i_nlink);
1423 status = ocfs2_journal_dirty(handle, old_dir_bh); 1395 ocfs2_journal_dirty(handle, old_dir_bh);
1424 } 1396 }
1425 } 1397 }
1426 ocfs2_dentry_move(old_dentry, new_dentry, old_dir, new_dir); 1398 ocfs2_dentry_move(old_dentry, new_dentry, old_dir, new_dir);
@@ -1552,11 +1524,7 @@ static int ocfs2_create_symlink_data(struct ocfs2_super *osb,
1552 (bytes_left > sb->s_blocksize) ? sb->s_blocksize : 1524 (bytes_left > sb->s_blocksize) ? sb->s_blocksize :
1553 bytes_left); 1525 bytes_left);
1554 1526
1555 status = ocfs2_journal_dirty(handle, bhs[virtual]); 1527 ocfs2_journal_dirty(handle, bhs[virtual]);
1556 if (status < 0) {
1557 mlog_errno(status);
1558 goto bail;
1559 }
1560 1528
1561 virtual++; 1529 virtual++;
1562 p_blkno++; 1530 p_blkno++;
@@ -1943,12 +1911,7 @@ static int ocfs2_orphan_add(struct ocfs2_super *osb,
1943 if (S_ISDIR(inode->i_mode)) 1911 if (S_ISDIR(inode->i_mode))
1944 ocfs2_add_links_count(orphan_fe, 1); 1912 ocfs2_add_links_count(orphan_fe, 1);
1945 orphan_dir_inode->i_nlink = ocfs2_read_links_count(orphan_fe); 1913 orphan_dir_inode->i_nlink = ocfs2_read_links_count(orphan_fe);
1946 1914 ocfs2_journal_dirty(handle, orphan_dir_bh);
1947 status = ocfs2_journal_dirty(handle, orphan_dir_bh);
1948 if (status < 0) {
1949 mlog_errno(status);
1950 goto leave;
1951 }
1952 1915
1953 status = __ocfs2_add_entry(handle, orphan_dir_inode, name, 1916 status = __ocfs2_add_entry(handle, orphan_dir_inode, name,
1954 OCFS2_ORPHAN_NAMELEN, inode, 1917 OCFS2_ORPHAN_NAMELEN, inode,
@@ -2029,12 +1992,7 @@ int ocfs2_orphan_del(struct ocfs2_super *osb,
2029 if (S_ISDIR(inode->i_mode)) 1992 if (S_ISDIR(inode->i_mode))
2030 ocfs2_add_links_count(orphan_fe, -1); 1993 ocfs2_add_links_count(orphan_fe, -1);
2031 orphan_dir_inode->i_nlink = ocfs2_read_links_count(orphan_fe); 1994 orphan_dir_inode->i_nlink = ocfs2_read_links_count(orphan_fe);
2032 1995 ocfs2_journal_dirty(handle, orphan_dir_bh);
2033 status = ocfs2_journal_dirty(handle, orphan_dir_bh);
2034 if (status < 0) {
2035 mlog_errno(status);
2036 goto leave;
2037 }
2038 1996
2039leave: 1997leave:
2040 ocfs2_free_dir_lookup_result(&lookup); 1998 ocfs2_free_dir_lookup_result(&lookup);