aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/dir.c')
-rw-r--r--fs/ocfs2/dir.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c
index 04e01915b86e..d10ccea82fab 100644
--- a/fs/ocfs2/dir.c
+++ b/fs/ocfs2/dir.c
@@ -409,13 +409,6 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb,
409 mlog(0, "extending dir %llu (i_size = %lld)\n", 409 mlog(0, "extending dir %llu (i_size = %lld)\n",
410 (unsigned long long)OCFS2_I(dir)->ip_blkno, dir_i_size); 410 (unsigned long long)OCFS2_I(dir)->ip_blkno, dir_i_size);
411 411
412 handle = ocfs2_alloc_handle(osb);
413 if (handle == NULL) {
414 status = -ENOMEM;
415 mlog_errno(status);
416 goto bail;
417 }
418
419 /* dir->i_size is always block aligned. */ 412 /* dir->i_size is always block aligned. */
420 spin_lock(&OCFS2_I(dir)->ip_lock); 413 spin_lock(&OCFS2_I(dir)->ip_lock);
421 if (dir_i_size == ocfs2_clusters_to_bytes(sb, OCFS2_I(dir)->ip_clusters)) { 414 if (dir_i_size == ocfs2_clusters_to_bytes(sb, OCFS2_I(dir)->ip_clusters)) {
@@ -428,8 +421,7 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb,
428 } 421 }
429 422
430 if (!num_free_extents) { 423 if (!num_free_extents) {
431 status = ocfs2_reserve_new_metadata(osb, handle, 424 status = ocfs2_reserve_new_metadata(osb, fe, &meta_ac);
432 fe, &meta_ac);
433 if (status < 0) { 425 if (status < 0) {
434 if (status != -ENOSPC) 426 if (status != -ENOSPC)
435 mlog_errno(status); 427 mlog_errno(status);
@@ -437,7 +429,7 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb,
437 } 429 }
438 } 430 }
439 431
440 status = ocfs2_reserve_clusters(osb, handle, 1, &data_ac); 432 status = ocfs2_reserve_clusters(osb, 1, &data_ac);
441 if (status < 0) { 433 if (status < 0) {
442 if (status != -ENOSPC) 434 if (status != -ENOSPC)
443 mlog_errno(status); 435 mlog_errno(status);
@@ -450,7 +442,7 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb,
450 credits = OCFS2_SIMPLE_DIR_EXTEND_CREDITS; 442 credits = OCFS2_SIMPLE_DIR_EXTEND_CREDITS;
451 } 443 }
452 444
453 handle = ocfs2_start_trans(osb, handle, credits); 445 handle = ocfs2_start_trans(osb, NULL, credits);
454 if (IS_ERR(handle)) { 446 if (IS_ERR(handle)) {
455 status = PTR_ERR(handle); 447 status = PTR_ERR(handle);
456 handle = NULL; 448 handle = NULL;