aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Fasheh <mark.fasheh@oracle.com>2006-10-05 17:15:36 -0400
committerMark Fasheh <mark.fasheh@oracle.com>2006-12-01 21:27:04 -0500
commit1fc581467e52546195c7ee8233a34d63c1cc1322 (patch)
tree7aa909dfd9f48c29c7e086aa6c929c8444b461a8
parent01ddf1e186b3b12b38c9e44912e0fd6a1cbc882b (diff)
ocfs2: have ocfs2_extend_trans() take handle_t
No reason to use our wrapper struct in this function, so take the handle_t directly. Also fixes a bug where we were incorrectly setting the handle to NULL in case of a failure from journal_restart() Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
-rw-r--r--fs/ocfs2/alloc.c2
-rw-r--r--fs/ocfs2/file.c2
-rw-r--r--fs/ocfs2/journal.c9
-rw-r--r--fs/ocfs2/journal.h3
4 files changed, 6 insertions, 10 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index f43bc5f18a35..74b93f924296 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -1074,7 +1074,7 @@ static int ocfs2_replay_truncate_records(struct ocfs2_super *osb,
1074 /* TODO: Perhaps we can calculate the bulk of the 1074 /* TODO: Perhaps we can calculate the bulk of the
1075 * credits up front rather than extending like 1075 * credits up front rather than extending like
1076 * this. */ 1076 * this. */
1077 status = ocfs2_extend_trans(handle, 1077 status = ocfs2_extend_trans(handle->k_handle,
1078 OCFS2_TRUNCATE_LOG_FLUSH_ONE_REC); 1078 OCFS2_TRUNCATE_LOG_FLUSH_ONE_REC);
1079 if (status < 0) { 1079 if (status < 0) {
1080 mlog_errno(status); 1080 mlog_errno(status);
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 1be74c4e7814..d8bd2c32f08a 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -566,7 +566,7 @@ restarted_transaction:
566 credits = ocfs2_calc_extend_credits(osb->sb, 566 credits = ocfs2_calc_extend_credits(osb->sb,
567 fe, 567 fe,
568 clusters_to_add); 568 clusters_to_add);
569 status = ocfs2_extend_trans(handle, credits); 569 status = ocfs2_extend_trans(handle->k_handle, credits);
570 if (status < 0) { 570 if (status < 0) {
571 /* handle still has to be committed at 571 /* handle still has to be committed at
572 * this point. */ 572 * this point. */
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c
index e26cd0ca5176..7c0c57ad517b 100644
--- a/fs/ocfs2/journal.c
+++ b/fs/ocfs2/journal.c
@@ -323,20 +323,18 @@ void ocfs2_commit_trans(struct ocfs2_journal_handle *handle)
323 * good because transaction ids haven't yet been recorded on the 323 * good because transaction ids haven't yet been recorded on the
324 * cluster locks associated with this handle. 324 * cluster locks associated with this handle.
325 */ 325 */
326int ocfs2_extend_trans(struct ocfs2_journal_handle *handle, 326int ocfs2_extend_trans(handle_t *handle, int nblocks)
327 int nblocks)
328{ 327{
329 int status; 328 int status;
330 329
331 BUG_ON(!handle); 330 BUG_ON(!handle);
332 BUG_ON(!(handle->flags & OCFS2_HANDLE_STARTED));
333 BUG_ON(!nblocks); 331 BUG_ON(!nblocks);
334 332
335 mlog_entry_void(); 333 mlog_entry_void();
336 334
337 mlog(0, "Trying to extend transaction by %d blocks\n", nblocks); 335 mlog(0, "Trying to extend transaction by %d blocks\n", nblocks);
338 336
339 status = journal_extend(handle->k_handle, nblocks); 337 status = journal_extend(handle, nblocks);
340 if (status < 0) { 338 if (status < 0) {
341 mlog_errno(status); 339 mlog_errno(status);
342 goto bail; 340 goto bail;
@@ -344,9 +342,8 @@ int ocfs2_extend_trans(struct ocfs2_journal_handle *handle,
344 342
345 if (status > 0) { 343 if (status > 0) {
346 mlog(0, "journal_extend failed, trying journal_restart\n"); 344 mlog(0, "journal_extend failed, trying journal_restart\n");
347 status = journal_restart(handle->k_handle, nblocks); 345 status = journal_restart(handle, nblocks);
348 if (status < 0) { 346 if (status < 0) {
349 handle->k_handle = NULL;
350 mlog_errno(status); 347 mlog_errno(status);
351 goto bail; 348 goto bail;
352 } 349 }
diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h
index 35ae835e9698..9f3d79dac33b 100644
--- a/fs/ocfs2/journal.h
+++ b/fs/ocfs2/journal.h
@@ -264,8 +264,7 @@ struct ocfs2_journal_handle *ocfs2_start_trans(struct ocfs2_super *osb,
264 struct ocfs2_journal_handle *handle, 264 struct ocfs2_journal_handle *handle,
265 int max_buffs); 265 int max_buffs);
266void ocfs2_commit_trans(struct ocfs2_journal_handle *handle); 266void ocfs2_commit_trans(struct ocfs2_journal_handle *handle);
267int ocfs2_extend_trans(struct ocfs2_journal_handle *handle, 267int ocfs2_extend_trans(handle_t *handle, int nblocks);
268 int nblocks);
269 268
270/* 269/*
271 * Create access is for when we get a newly created buffer and we're 270 * Create access is for when we get a newly created buffer and we're