diff options
author | Joel Becker <joel.becker@oracle.com> | 2010-03-19 17:13:52 -0400 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2010-05-05 21:17:29 -0400 |
commit | ec20cec7a351584ca6c70ead012e73d61f9a8e04 (patch) | |
tree | 39af308ae07ab168313bb50ced1bb1ae7ef7e6a3 /fs/ocfs2/xattr.c | |
parent | b4414eea0e7b9c134262c801a87e338bf675962c (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/xattr.c')
-rw-r--r-- | fs/ocfs2/xattr.c | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 3e7773089b9..4cf6fde7102 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
@@ -739,11 +739,7 @@ static int ocfs2_xattr_extend_allocation(struct inode *inode, | |||
739 | goto leave; | 739 | goto leave; |
740 | } | 740 | } |
741 | 741 | ||
742 | status = ocfs2_journal_dirty(handle, vb->vb_bh); | 742 | ocfs2_journal_dirty(handle, vb->vb_bh); |
743 | if (status < 0) { | ||
744 | mlog_errno(status); | ||
745 | goto leave; | ||
746 | } | ||
747 | 743 | ||
748 | clusters_to_add -= le32_to_cpu(vb->vb_xv->xr_clusters) - prev_clusters; | 744 | clusters_to_add -= le32_to_cpu(vb->vb_xv->xr_clusters) - prev_clusters; |
749 | 745 | ||
@@ -786,12 +782,7 @@ static int __ocfs2_remove_xattr_range(struct inode *inode, | |||
786 | } | 782 | } |
787 | 783 | ||
788 | le32_add_cpu(&vb->vb_xv->xr_clusters, -len); | 784 | le32_add_cpu(&vb->vb_xv->xr_clusters, -len); |
789 | 785 | ocfs2_journal_dirty(handle, vb->vb_bh); | |
790 | ret = ocfs2_journal_dirty(handle, vb->vb_bh); | ||
791 | if (ret) { | ||
792 | mlog_errno(ret); | ||
793 | goto out; | ||
794 | } | ||
795 | 786 | ||
796 | if (ext_flags & OCFS2_EXT_REFCOUNTED) | 787 | if (ext_flags & OCFS2_EXT_REFCOUNTED) |
797 | ret = ocfs2_decrease_refcount(inode, handle, | 788 | ret = ocfs2_decrease_refcount(inode, handle, |
@@ -1374,11 +1365,7 @@ static int __ocfs2_xattr_set_value_outside(struct inode *inode, | |||
1374 | memset(bh->b_data + cp_len, 0, | 1365 | memset(bh->b_data + cp_len, 0, |
1375 | blocksize - cp_len); | 1366 | blocksize - cp_len); |
1376 | 1367 | ||
1377 | ret = ocfs2_journal_dirty(handle, bh); | 1368 | ocfs2_journal_dirty(handle, bh); |
1378 | if (ret < 0) { | ||
1379 | mlog_errno(ret); | ||
1380 | goto out; | ||
1381 | } | ||
1382 | brelse(bh); | 1369 | brelse(bh); |
1383 | bh = NULL; | 1370 | bh = NULL; |
1384 | 1371 | ||
@@ -2594,9 +2581,7 @@ int ocfs2_xattr_remove(struct inode *inode, struct buffer_head *di_bh) | |||
2594 | di->i_dyn_features = cpu_to_le16(oi->ip_dyn_features); | 2581 | di->i_dyn_features = cpu_to_le16(oi->ip_dyn_features); |
2595 | spin_unlock(&oi->ip_lock); | 2582 | spin_unlock(&oi->ip_lock); |
2596 | 2583 | ||
2597 | ret = ocfs2_journal_dirty(handle, di_bh); | 2584 | ocfs2_journal_dirty(handle, di_bh); |
2598 | if (ret < 0) | ||
2599 | mlog_errno(ret); | ||
2600 | out_commit: | 2585 | out_commit: |
2601 | ocfs2_commit_trans(OCFS2_SB(inode->i_sb), handle); | 2586 | ocfs2_commit_trans(OCFS2_SB(inode->i_sb), handle); |
2602 | out: | 2587 | out: |
@@ -2724,9 +2709,7 @@ static int ocfs2_xattr_ibody_init(struct inode *inode, | |||
2724 | di->i_dyn_features = cpu_to_le16(oi->ip_dyn_features); | 2709 | di->i_dyn_features = cpu_to_le16(oi->ip_dyn_features); |
2725 | spin_unlock(&oi->ip_lock); | 2710 | spin_unlock(&oi->ip_lock); |
2726 | 2711 | ||
2727 | ret = ocfs2_journal_dirty(ctxt->handle, di_bh); | 2712 | ocfs2_journal_dirty(ctxt->handle, di_bh); |
2728 | if (ret < 0) | ||
2729 | mlog_errno(ret); | ||
2730 | 2713 | ||
2731 | out: | 2714 | out: |
2732 | return ret; | 2715 | return ret; |
@@ -5153,9 +5136,7 @@ static int ocfs2_add_new_xattr_cluster(struct inode *inode, | |||
5153 | goto leave; | 5136 | goto leave; |
5154 | } | 5137 | } |
5155 | 5138 | ||
5156 | ret = ocfs2_journal_dirty(handle, root_bh); | 5139 | ocfs2_journal_dirty(handle, root_bh); |
5157 | if (ret < 0) | ||
5158 | mlog_errno(ret); | ||
5159 | 5140 | ||
5160 | leave: | 5141 | leave: |
5161 | return ret; | 5142 | return ret; |
@@ -5477,12 +5458,7 @@ static int ocfs2_rm_xattr_cluster(struct inode *inode, | |||
5477 | } | 5458 | } |
5478 | 5459 | ||
5479 | le32_add_cpu(&xb->xb_attrs.xb_root.xt_clusters, -len); | 5460 | le32_add_cpu(&xb->xb_attrs.xb_root.xt_clusters, -len); |
5480 | 5461 | ocfs2_journal_dirty(handle, root_bh); | |
5481 | ret = ocfs2_journal_dirty(handle, root_bh); | ||
5482 | if (ret) { | ||
5483 | mlog_errno(ret); | ||
5484 | goto out_commit; | ||
5485 | } | ||
5486 | 5462 | ||
5487 | ret = ocfs2_truncate_log_append(osb, handle, blkno, len); | 5463 | ret = ocfs2_truncate_log_append(osb, handle, blkno, len); |
5488 | if (ret) | 5464 | if (ret) |