aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/quota_local.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/quota_local.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/quota_local.c')
-rw-r--r--fs/ocfs2/quota_local.c50
1 files changed, 12 insertions, 38 deletions
diff --git a/fs/ocfs2/quota_local.c b/fs/ocfs2/quota_local.c
index a6467f3d262e..a8f4cea1b824 100644
--- a/fs/ocfs2/quota_local.c
+++ b/fs/ocfs2/quota_local.c
@@ -118,12 +118,8 @@ static int ocfs2_modify_bh(struct inode *inode, struct buffer_head *bh,
118 lock_buffer(bh); 118 lock_buffer(bh);
119 modify(bh, private); 119 modify(bh, private);
120 unlock_buffer(bh); 120 unlock_buffer(bh);
121 status = ocfs2_journal_dirty(handle, bh); 121 ocfs2_journal_dirty(handle, bh);
122 if (status < 0) { 122
123 mlog_errno(status);
124 ocfs2_commit_trans(OCFS2_SB(sb), handle);
125 return status;
126 }
127 status = ocfs2_commit_trans(OCFS2_SB(sb), handle); 123 status = ocfs2_commit_trans(OCFS2_SB(sb), handle);
128 if (status < 0) { 124 if (status < 0) {
129 mlog_errno(status); 125 mlog_errno(status);
@@ -522,9 +518,7 @@ static int ocfs2_recover_local_quota_file(struct inode *lqinode,
522 ocfs2_clear_bit(bit, dchunk->dqc_bitmap); 518 ocfs2_clear_bit(bit, dchunk->dqc_bitmap);
523 le32_add_cpu(&dchunk->dqc_free, 1); 519 le32_add_cpu(&dchunk->dqc_free, 1);
524 unlock_buffer(qbh); 520 unlock_buffer(qbh);
525 status = ocfs2_journal_dirty(handle, qbh); 521 ocfs2_journal_dirty(handle, qbh);
526 if (status < 0)
527 mlog_errno(status);
528out_commit: 522out_commit:
529 mutex_unlock(&sb_dqopt(sb)->dqio_mutex); 523 mutex_unlock(&sb_dqopt(sb)->dqio_mutex);
530 ocfs2_commit_trans(OCFS2_SB(sb), handle); 524 ocfs2_commit_trans(OCFS2_SB(sb), handle);
@@ -630,9 +624,7 @@ int ocfs2_finish_quota_recovery(struct ocfs2_super *osb,
630 lock_buffer(bh); 624 lock_buffer(bh);
631 ldinfo->dqi_flags = cpu_to_le32(flags | OLQF_CLEAN); 625 ldinfo->dqi_flags = cpu_to_le32(flags | OLQF_CLEAN);
632 unlock_buffer(bh); 626 unlock_buffer(bh);
633 status = ocfs2_journal_dirty(handle, bh); 627 ocfs2_journal_dirty(handle, bh);
634 if (status < 0)
635 mlog_errno(status);
636out_trans: 628out_trans:
637 ocfs2_commit_trans(osb, handle); 629 ocfs2_commit_trans(osb, handle);
638out_bh: 630out_bh:
@@ -1008,11 +1000,7 @@ static struct ocfs2_quota_chunk *ocfs2_local_quota_add_chunk(
1008 sb->s_blocksize - sizeof(struct ocfs2_local_disk_chunk) - 1000 sb->s_blocksize - sizeof(struct ocfs2_local_disk_chunk) -
1009 OCFS2_QBLK_RESERVED_SPACE); 1001 OCFS2_QBLK_RESERVED_SPACE);
1010 unlock_buffer(bh); 1002 unlock_buffer(bh);
1011 status = ocfs2_journal_dirty(handle, bh); 1003 ocfs2_journal_dirty(handle, bh);
1012 if (status < 0) {
1013 mlog_errno(status);
1014 goto out_trans;
1015 }
1016 1004
1017 /* Initialize new block with structures */ 1005 /* Initialize new block with structures */
1018 down_read(&OCFS2_I(lqinode)->ip_alloc_sem); 1006 down_read(&OCFS2_I(lqinode)->ip_alloc_sem);
@@ -1039,11 +1027,7 @@ static struct ocfs2_quota_chunk *ocfs2_local_quota_add_chunk(
1039 lock_buffer(dbh); 1027 lock_buffer(dbh);
1040 memset(dbh->b_data, 0, sb->s_blocksize - OCFS2_QBLK_RESERVED_SPACE); 1028 memset(dbh->b_data, 0, sb->s_blocksize - OCFS2_QBLK_RESERVED_SPACE);
1041 unlock_buffer(dbh); 1029 unlock_buffer(dbh);
1042 status = ocfs2_journal_dirty(handle, dbh); 1030 ocfs2_journal_dirty(handle, dbh);
1043 if (status < 0) {
1044 mlog_errno(status);
1045 goto out_trans;
1046 }
1047 1031
1048 /* Update local quotafile info */ 1032 /* Update local quotafile info */
1049 oinfo->dqi_blocks += 2; 1033 oinfo->dqi_blocks += 2;
@@ -1154,11 +1138,8 @@ static struct ocfs2_quota_chunk *ocfs2_extend_local_quota_file(
1154 lock_buffer(bh); 1138 lock_buffer(bh);
1155 memset(bh->b_data, 0, sb->s_blocksize); 1139 memset(bh->b_data, 0, sb->s_blocksize);
1156 unlock_buffer(bh); 1140 unlock_buffer(bh);
1157 status = ocfs2_journal_dirty(handle, bh); 1141 ocfs2_journal_dirty(handle, bh);
1158 if (status < 0) { 1142
1159 mlog_errno(status);
1160 goto out_trans;
1161 }
1162 /* Update chunk header */ 1143 /* Update chunk header */
1163 status = ocfs2_journal_access_dq(handle, INODE_CACHE(lqinode), 1144 status = ocfs2_journal_access_dq(handle, INODE_CACHE(lqinode),
1164 chunk->qc_headerbh, 1145 chunk->qc_headerbh,
@@ -1172,11 +1153,8 @@ static struct ocfs2_quota_chunk *ocfs2_extend_local_quota_file(
1172 lock_buffer(chunk->qc_headerbh); 1153 lock_buffer(chunk->qc_headerbh);
1173 le32_add_cpu(&dchunk->dqc_free, ol_quota_entries_per_block(sb)); 1154 le32_add_cpu(&dchunk->dqc_free, ol_quota_entries_per_block(sb));
1174 unlock_buffer(chunk->qc_headerbh); 1155 unlock_buffer(chunk->qc_headerbh);
1175 status = ocfs2_journal_dirty(handle, chunk->qc_headerbh); 1156 ocfs2_journal_dirty(handle, chunk->qc_headerbh);
1176 if (status < 0) { 1157
1177 mlog_errno(status);
1178 goto out_trans;
1179 }
1180 /* Update file header */ 1158 /* Update file header */
1181 oinfo->dqi_blocks++; 1159 oinfo->dqi_blocks++;
1182 status = ocfs2_local_write_info(sb, type); 1160 status = ocfs2_local_write_info(sb, type);
@@ -1311,12 +1289,8 @@ static int ocfs2_local_release_dquot(struct dquot *dquot)
1311 ocfs2_clear_bit(offset, dchunk->dqc_bitmap); 1289 ocfs2_clear_bit(offset, dchunk->dqc_bitmap);
1312 le32_add_cpu(&dchunk->dqc_free, 1); 1290 le32_add_cpu(&dchunk->dqc_free, 1);
1313 unlock_buffer(od->dq_chunk->qc_headerbh); 1291 unlock_buffer(od->dq_chunk->qc_headerbh);
1314 status = ocfs2_journal_dirty(handle, od->dq_chunk->qc_headerbh); 1292 ocfs2_journal_dirty(handle, od->dq_chunk->qc_headerbh);
1315 if (status < 0) { 1293
1316 mlog_errno(status);
1317 goto out;
1318 }
1319 status = 0;
1320out: 1294out:
1321 /* Clear the read bit so that next time someone uses this 1295 /* Clear the read bit so that next time someone uses this
1322 * dquot he reads fresh info from disk and allocates local 1296 * dquot he reads fresh info from disk and allocates local