diff options
author | Mark Fasheh <mark.fasheh@oracle.com> | 2006-10-05 18:11:36 -0400 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2006-12-01 21:27:06 -0500 |
commit | c161f89be7d57af863e434e9b15afaa863343a7a (patch) | |
tree | 18152d2fb567746e74a0f57f0d11c53c740db87a /fs/ocfs2 | |
parent | 1fc581467e52546195c7ee8233a34d63c1cc1322 (diff) |
ocfs2: remove ocfs2_journal_handle flags field
Callers can set h_sync directly on the handle_t, whether a transaction has
been started or not can be determined via the existence of the handle_t on
the struct ocfs2_journal_handle.
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/journal.c | 13 | ||||
-rw-r--r-- | fs/ocfs2/journal.h | 17 | ||||
-rw-r--r-- | fs/ocfs2/localalloc.c | 4 | ||||
-rw-r--r-- | fs/ocfs2/suballoc.c | 2 |
4 files changed, 4 insertions, 32 deletions
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index 7c0c57ad517b..ca6f2094b006 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c | |||
@@ -190,7 +190,6 @@ struct ocfs2_journal_handle *ocfs2_start_trans(struct ocfs2_super *osb, | |||
190 | } | 190 | } |
191 | 191 | ||
192 | atomic_inc(&(osb->journal->j_num_trans)); | 192 | atomic_inc(&(osb->journal->j_num_trans)); |
193 | handle->flags |= OCFS2_HANDLE_STARTED; | ||
194 | 193 | ||
195 | mlog_exit_ptr(handle); | 194 | mlog_exit_ptr(handle); |
196 | return handle; | 195 | return handle; |
@@ -247,8 +246,6 @@ static void ocfs2_commit_unstarted_handle(struct ocfs2_journal_handle *handle) | |||
247 | { | 246 | { |
248 | mlog_entry_void(); | 247 | mlog_entry_void(); |
249 | 248 | ||
250 | BUG_ON(handle->flags & OCFS2_HANDLE_STARTED); | ||
251 | |||
252 | ocfs2_handle_unlock_inodes(handle); | 249 | ocfs2_handle_unlock_inodes(handle); |
253 | /* You are allowed to add journal locks before the transaction | 250 | /* You are allowed to add journal locks before the transaction |
254 | * has started. */ | 251 | * has started. */ |
@@ -269,7 +266,7 @@ void ocfs2_commit_trans(struct ocfs2_journal_handle *handle) | |||
269 | 266 | ||
270 | BUG_ON(!handle); | 267 | BUG_ON(!handle); |
271 | 268 | ||
272 | if (!(handle->flags & OCFS2_HANDLE_STARTED)) { | 269 | if (!handle->k_handle) { |
273 | ocfs2_commit_unstarted_handle(handle); | 270 | ocfs2_commit_unstarted_handle(handle); |
274 | mlog_exit_void(); | 271 | mlog_exit_void(); |
275 | return; | 272 | return; |
@@ -285,11 +282,6 @@ void ocfs2_commit_trans(struct ocfs2_journal_handle *handle) | |||
285 | if (handle->k_handle) { | 282 | if (handle->k_handle) { |
286 | jbd_handle = handle->k_handle; | 283 | jbd_handle = handle->k_handle; |
287 | 284 | ||
288 | if (handle->flags & OCFS2_HANDLE_SYNC) | ||
289 | jbd_handle->h_sync = 1; | ||
290 | else | ||
291 | jbd_handle->h_sync = 0; | ||
292 | |||
293 | /* actually stop the transaction. if we've set h_sync, | 285 | /* actually stop the transaction. if we've set h_sync, |
294 | * it'll have been committed when we return */ | 286 | * it'll have been committed when we return */ |
295 | retval = journal_stop(jbd_handle); | 287 | retval = journal_stop(jbd_handle); |
@@ -366,7 +358,6 @@ int ocfs2_journal_access(struct ocfs2_journal_handle *handle, | |||
366 | BUG_ON(!inode); | 358 | BUG_ON(!inode); |
367 | BUG_ON(!handle); | 359 | BUG_ON(!handle); |
368 | BUG_ON(!bh); | 360 | BUG_ON(!bh); |
369 | BUG_ON(!(handle->flags & OCFS2_HANDLE_STARTED)); | ||
370 | 361 | ||
371 | mlog_entry("bh->b_blocknr=%llu, type=%d (\"%s\"), bh->b_size = %zu\n", | 362 | mlog_entry("bh->b_blocknr=%llu, type=%d (\"%s\"), bh->b_size = %zu\n", |
372 | (unsigned long long)bh->b_blocknr, type, | 363 | (unsigned long long)bh->b_blocknr, type, |
@@ -421,8 +412,6 @@ int ocfs2_journal_dirty(struct ocfs2_journal_handle *handle, | |||
421 | { | 412 | { |
422 | int status; | 413 | int status; |
423 | 414 | ||
424 | BUG_ON(!(handle->flags & OCFS2_HANDLE_STARTED)); | ||
425 | |||
426 | mlog_entry("(bh->b_blocknr=%llu)\n", | 415 | mlog_entry("(bh->b_blocknr=%llu)\n", |
427 | (unsigned long long)bh->b_blocknr); | 416 | (unsigned long long)bh->b_blocknr); |
428 | 417 | ||
diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h index 9f3d79dac33b..6b5d548ca117 100644 --- a/fs/ocfs2/journal.h +++ b/fs/ocfs2/journal.h | |||
@@ -143,7 +143,6 @@ struct ocfs2_journal_lock { | |||
143 | struct ocfs2_journal_handle { | 143 | struct ocfs2_journal_handle { |
144 | handle_t *k_handle; /* kernel handle. */ | 144 | handle_t *k_handle; /* kernel handle. */ |
145 | struct ocfs2_journal *journal; | 145 | struct ocfs2_journal *journal; |
146 | u32 flags; /* see flags below. */ | ||
147 | 146 | ||
148 | /* The following two fields are for ocfs2_handle_add_lock */ | 147 | /* The following two fields are for ocfs2_handle_add_lock */ |
149 | int num_locks; | 148 | int num_locks; |
@@ -154,22 +153,6 @@ struct ocfs2_journal_handle { | |||
154 | struct list_head inode_list; | 153 | struct list_head inode_list; |
155 | }; | 154 | }; |
156 | 155 | ||
157 | #define OCFS2_HANDLE_STARTED 1 | ||
158 | /* should we sync-commit this handle? */ | ||
159 | #define OCFS2_HANDLE_SYNC 2 | ||
160 | static inline int ocfs2_handle_started(struct ocfs2_journal_handle *handle) | ||
161 | { | ||
162 | return handle->flags & OCFS2_HANDLE_STARTED; | ||
163 | } | ||
164 | |||
165 | static inline void ocfs2_handle_set_sync(struct ocfs2_journal_handle *handle, int sync) | ||
166 | { | ||
167 | if (sync) | ||
168 | handle->flags |= OCFS2_HANDLE_SYNC; | ||
169 | else | ||
170 | handle->flags &= ~OCFS2_HANDLE_SYNC; | ||
171 | } | ||
172 | |||
173 | /* Exported only for the journal struct init code in super.c. Do not call. */ | 156 | /* Exported only for the journal struct init code in super.c. Do not call. */ |
174 | void ocfs2_complete_recovery(void *data); | 157 | void ocfs2_complete_recovery(void *data); |
175 | 158 | ||
diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c index 1f17a4d08287..f2f384dd5ba8 100644 --- a/fs/ocfs2/localalloc.c +++ b/fs/ocfs2/localalloc.c | |||
@@ -423,7 +423,7 @@ int ocfs2_complete_local_alloc_recovery(struct ocfs2_super *osb, | |||
423 | } | 423 | } |
424 | 424 | ||
425 | /* we want the bitmap change to be recorded on disk asap */ | 425 | /* we want the bitmap change to be recorded on disk asap */ |
426 | ocfs2_handle_set_sync(handle, 1); | 426 | handle->k_handle->h_sync = 1; |
427 | 427 | ||
428 | status = ocfs2_sync_local_to_main(osb, handle, alloc, | 428 | status = ocfs2_sync_local_to_main(osb, handle, alloc, |
429 | main_bm_inode, main_bm_bh); | 429 | main_bm_inode, main_bm_bh); |
@@ -465,7 +465,7 @@ int ocfs2_reserve_local_alloc_bits(struct ocfs2_super *osb, | |||
465 | 465 | ||
466 | BUG_ON(!passed_handle); | 466 | BUG_ON(!passed_handle); |
467 | BUG_ON(!ac); | 467 | BUG_ON(!ac); |
468 | BUG_ON(passed_handle->flags & OCFS2_HANDLE_STARTED); | 468 | BUG_ON(passed_handle->k_handle); |
469 | 469 | ||
470 | local_alloc_inode = | 470 | local_alloc_inode = |
471 | ocfs2_get_system_file_inode(osb, | 471 | ocfs2_get_system_file_inode(osb, |
diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c index 9d91e66f51a9..32093409e256 100644 --- a/fs/ocfs2/suballoc.c +++ b/fs/ocfs2/suballoc.c | |||
@@ -414,7 +414,7 @@ static int ocfs2_reserve_suballoc_bits(struct ocfs2_super *osb, | |||
414 | 414 | ||
415 | mlog_entry_void(); | 415 | mlog_entry_void(); |
416 | 416 | ||
417 | BUG_ON(handle->flags & OCFS2_HANDLE_STARTED); | 417 | BUG_ON(handle->k_handle); |
418 | 418 | ||
419 | ocfs2_handle_add_inode(handle, alloc_inode); | 419 | ocfs2_handle_add_inode(handle, alloc_inode); |
420 | status = ocfs2_meta_lock(alloc_inode, handle, &bh, 1); | 420 | status = ocfs2_meta_lock(alloc_inode, handle, &bh, 1); |