aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/file.c
diff options
context:
space:
mode:
authorMark Fasheh <mark.fasheh@oracle.com>2006-10-06 21:34:35 -0400
committerMark Fasheh <mark.fasheh@oracle.com>2006-12-01 21:27:49 -0500
commitda5cbf2f9df922cfdafa39351691fa83517f1e25 (patch)
tree845dc288b72f0408870f50605bb3c96eec978dd8 /fs/ocfs2/file.c
parent8d5596c687c49c1d8812c3456946dec15d069139 (diff)
ocfs2: don't use handle for locking in allocation functions
Instead we record our state on the allocation context structure which all callers already know about and lifetime correctly. This means the reservation functions don't need a handle passed in any more, and we can also take it off the alloc context. Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/file.c')
-rw-r--r--fs/ocfs2/file.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index d8bd2c32f08a..bd944e893bbe 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -463,13 +463,6 @@ restart_all:
463 (unsigned long long)OCFS2_I(inode)->ip_blkno, i_size_read(inode), 463 (unsigned long long)OCFS2_I(inode)->ip_blkno, i_size_read(inode),
464 fe->i_clusters, clusters_to_add); 464 fe->i_clusters, clusters_to_add);
465 465
466 handle = ocfs2_alloc_handle(osb);
467 if (handle == NULL) {
468 status = -ENOMEM;
469 mlog_errno(status);
470 goto leave;
471 }
472
473 num_free_extents = ocfs2_num_free_extents(osb, 466 num_free_extents = ocfs2_num_free_extents(osb,
474 inode, 467 inode,
475 fe); 468 fe);
@@ -480,10 +473,7 @@ restart_all:
480 } 473 }
481 474
482 if (!num_free_extents) { 475 if (!num_free_extents) {
483 status = ocfs2_reserve_new_metadata(osb, 476 status = ocfs2_reserve_new_metadata(osb, fe, &meta_ac);
484 handle,
485 fe,
486 &meta_ac);
487 if (status < 0) { 477 if (status < 0) {
488 if (status != -ENOSPC) 478 if (status != -ENOSPC)
489 mlog_errno(status); 479 mlog_errno(status);
@@ -491,10 +481,7 @@ restart_all:
491 } 481 }
492 } 482 }
493 483
494 status = ocfs2_reserve_clusters(osb, 484 status = ocfs2_reserve_clusters(osb, clusters_to_add, &data_ac);
495 handle,
496 clusters_to_add,
497 &data_ac);
498 if (status < 0) { 485 if (status < 0) {
499 if (status != -ENOSPC) 486 if (status != -ENOSPC)
500 mlog_errno(status); 487 mlog_errno(status);
@@ -509,7 +496,7 @@ restart_all:
509 drop_alloc_sem = 1; 496 drop_alloc_sem = 1;
510 497
511 credits = ocfs2_calc_extend_credits(osb->sb, fe, clusters_to_add); 498 credits = ocfs2_calc_extend_credits(osb->sb, fe, clusters_to_add);
512 handle = ocfs2_start_trans(osb, handle, credits); 499 handle = ocfs2_start_trans(osb, NULL, credits);
513 if (IS_ERR(handle)) { 500 if (IS_ERR(handle)) {
514 status = PTR_ERR(handle); 501 status = PTR_ERR(handle);
515 handle = NULL; 502 handle = NULL;