aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r--fs/gfs2/inode.c209
1 files changed, 109 insertions, 100 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 381893ceefa4..2b6f5698ef18 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -364,34 +364,34 @@ static int create_ok(struct gfs2_inode *dip, const struct qstr *name,
364 return 0; 364 return 0;
365} 365}
366 366
367static void munge_mode_uid_gid(struct gfs2_inode *dip, umode_t *mode, 367static void munge_mode_uid_gid(const struct gfs2_inode *dip,
368 unsigned int *uid, unsigned int *gid) 368 struct inode *inode)
369{ 369{
370 if (GFS2_SB(&dip->i_inode)->sd_args.ar_suiddir && 370 if (GFS2_SB(&dip->i_inode)->sd_args.ar_suiddir &&
371 (dip->i_inode.i_mode & S_ISUID) && dip->i_inode.i_uid) { 371 (dip->i_inode.i_mode & S_ISUID) && dip->i_inode.i_uid) {
372 if (S_ISDIR(*mode)) 372 if (S_ISDIR(inode->i_mode))
373 *mode |= S_ISUID; 373 inode->i_mode |= S_ISUID;
374 else if (dip->i_inode.i_uid != current_fsuid()) 374 else if (dip->i_inode.i_uid != current_fsuid())
375 *mode &= ~07111; 375 inode->i_mode &= ~07111;
376 *uid = dip->i_inode.i_uid; 376 inode->i_uid = dip->i_inode.i_uid;
377 } else 377 } else
378 *uid = current_fsuid(); 378 inode->i_uid = current_fsuid();
379 379
380 if (dip->i_inode.i_mode & S_ISGID) { 380 if (dip->i_inode.i_mode & S_ISGID) {
381 if (S_ISDIR(*mode)) 381 if (S_ISDIR(inode->i_mode))
382 *mode |= S_ISGID; 382 inode->i_mode |= S_ISGID;
383 *gid = dip->i_inode.i_gid; 383 inode->i_gid = dip->i_inode.i_gid;
384 } else 384 } else
385 *gid = current_fsgid(); 385 inode->i_gid = current_fsgid();
386} 386}
387 387
388static int alloc_dinode(struct gfs2_inode *dip, u64 *no_addr, u64 *generation) 388static int alloc_dinode(struct gfs2_inode *ip, u32 flags)
389{ 389{
390 struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode); 390 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
391 int error; 391 int error;
392 int dblocks = 1; 392 int dblocks = 1;
393 393
394 error = gfs2_inplace_reserve(dip, RES_DINODE); 394 error = gfs2_inplace_reserve(ip, RES_DINODE, flags);
395 if (error) 395 if (error)
396 goto out; 396 goto out;
397 397
@@ -399,12 +399,15 @@ static int alloc_dinode(struct gfs2_inode *dip, u64 *no_addr, u64 *generation)
399 if (error) 399 if (error)
400 goto out_ipreserv; 400 goto out_ipreserv;
401 401
402 error = gfs2_alloc_blocks(dip, no_addr, &dblocks, 1, generation); 402 error = gfs2_alloc_blocks(ip, &ip->i_no_addr, &dblocks, 1, &ip->i_generation);
403 ip->i_no_formal_ino = ip->i_generation;
404 ip->i_inode.i_ino = ip->i_no_addr;
405 ip->i_goal = ip->i_no_addr;
403 406
404 gfs2_trans_end(sdp); 407 gfs2_trans_end(sdp);
405 408
406out_ipreserv: 409out_ipreserv:
407 gfs2_inplace_release(dip); 410 gfs2_inplace_release(ip);
408out: 411out:
409 return error; 412 return error;
410} 413}
@@ -429,52 +432,42 @@ static void gfs2_init_dir(struct buffer_head *dibh,
429/** 432/**
430 * init_dinode - Fill in a new dinode structure 433 * init_dinode - Fill in a new dinode structure
431 * @dip: The directory this inode is being created in 434 * @dip: The directory this inode is being created in
432 * @gl: The glock covering the new inode 435 * @ip: The inode
433 * @inum: The inode number
434 * @mode: The file permissions
435 * @uid: The uid of the new inode
436 * @gid: The gid of the new inode
437 * @generation: The generation number of the new inode
438 * @dev: The device number (if a device node)
439 * @symname: The symlink destination (if a symlink) 436 * @symname: The symlink destination (if a symlink)
440 * @size: The inode size (ignored for directories)
441 * @bhp: The buffer head (returned to caller) 437 * @bhp: The buffer head (returned to caller)
442 * 438 *
443 */ 439 */
444 440
445static void init_dinode(struct gfs2_inode *dip, struct gfs2_glock *gl, 441static void init_dinode(struct gfs2_inode *dip, struct gfs2_inode *ip,
446 const struct gfs2_inum_host *inum, umode_t mode, 442 const char *symname, struct buffer_head **bhp)
447 unsigned int uid, unsigned int gid,
448 const u64 *generation, dev_t dev, const char *symname,
449 unsigned size, struct buffer_head **bhp)
450{ 443{
451 struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode); 444 struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode);
452 struct gfs2_dinode *di; 445 struct gfs2_dinode *di;
453 struct buffer_head *dibh; 446 struct buffer_head *dibh;
454 struct timespec tv = CURRENT_TIME; 447 struct timespec tv = CURRENT_TIME;
455 448
456 dibh = gfs2_meta_new(gl, inum->no_addr); 449 dibh = gfs2_meta_new(ip->i_gl, ip->i_no_addr);
457 gfs2_trans_add_bh(gl, dibh, 1); 450 gfs2_trans_add_bh(ip->i_gl, dibh, 1);
458 gfs2_metatype_set(dibh, GFS2_METATYPE_DI, GFS2_FORMAT_DI); 451 gfs2_metatype_set(dibh, GFS2_METATYPE_DI, GFS2_FORMAT_DI);
459 gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode)); 452 gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode));
460 di = (struct gfs2_dinode *)dibh->b_data; 453 di = (struct gfs2_dinode *)dibh->b_data;
461 454
462 di->di_num.no_formal_ino = cpu_to_be64(inum->no_formal_ino); 455 di->di_num.no_formal_ino = cpu_to_be64(ip->i_no_formal_ino);
463 di->di_num.no_addr = cpu_to_be64(inum->no_addr); 456 di->di_num.no_addr = cpu_to_be64(ip->i_no_addr);
464 di->di_mode = cpu_to_be32(mode); 457 di->di_mode = cpu_to_be32(ip->i_inode.i_mode);
465 di->di_uid = cpu_to_be32(uid); 458 di->di_uid = cpu_to_be32(ip->i_inode.i_uid);
466 di->di_gid = cpu_to_be32(gid); 459 di->di_gid = cpu_to_be32(ip->i_inode.i_gid);
467 di->di_nlink = 0; 460 di->di_nlink = 0;
468 di->di_size = cpu_to_be64(size); 461 di->di_size = cpu_to_be64(ip->i_inode.i_size);
469 di->di_blocks = cpu_to_be64(1); 462 di->di_blocks = cpu_to_be64(1);
470 di->di_atime = di->di_mtime = di->di_ctime = cpu_to_be64(tv.tv_sec); 463 di->di_atime = di->di_mtime = di->di_ctime = cpu_to_be64(tv.tv_sec);
471 di->di_major = cpu_to_be32(MAJOR(dev)); 464 di->di_major = cpu_to_be32(MAJOR(ip->i_inode.i_rdev));
472 di->di_minor = cpu_to_be32(MINOR(dev)); 465 di->di_minor = cpu_to_be32(MINOR(ip->i_inode.i_rdev));
473 di->di_goal_meta = di->di_goal_data = cpu_to_be64(inum->no_addr); 466 di->di_goal_meta = di->di_goal_data = cpu_to_be64(ip->i_no_addr);
474 di->di_generation = cpu_to_be64(*generation); 467 di->di_generation = cpu_to_be64(ip->i_generation);
475 di->di_flags = 0; 468 di->di_flags = 0;
476 di->__pad1 = 0; 469 di->__pad1 = 0;
477 di->di_payload_format = cpu_to_be32(S_ISDIR(mode) ? GFS2_FORMAT_DE : 0); 470 di->di_payload_format = cpu_to_be32(S_ISDIR(ip->i_inode.i_mode) ? GFS2_FORMAT_DE : 0);
478 di->di_height = 0; 471 di->di_height = 0;
479 di->__pad2 = 0; 472 di->__pad2 = 0;
480 di->__pad3 = 0; 473 di->__pad3 = 0;
@@ -487,7 +480,7 @@ static void init_dinode(struct gfs2_inode *dip, struct gfs2_glock *gl,
487 di->di_ctime_nsec = cpu_to_be32(tv.tv_nsec); 480 di->di_ctime_nsec = cpu_to_be32(tv.tv_nsec);
488 memset(&di->di_reserved, 0, sizeof(di->di_reserved)); 481 memset(&di->di_reserved, 0, sizeof(di->di_reserved));
489 482
490 switch(mode & S_IFMT) { 483 switch(ip->i_inode.i_mode & S_IFMT) {
491 case S_IFREG: 484 case S_IFREG:
492 if ((dip->i_diskflags & GFS2_DIF_INHERIT_JDATA) || 485 if ((dip->i_diskflags & GFS2_DIF_INHERIT_JDATA) ||
493 gfs2_tune_get(sdp, gt_new_files_jdata)) 486 gfs2_tune_get(sdp, gt_new_files_jdata))
@@ -502,7 +495,7 @@ static void init_dinode(struct gfs2_inode *dip, struct gfs2_glock *gl,
502 gfs2_init_dir(dibh, dip); 495 gfs2_init_dir(dibh, dip);
503 break; 496 break;
504 case S_IFLNK: 497 case S_IFLNK:
505 memcpy(dibh->b_data + sizeof(struct gfs2_dinode), symname, size); 498 memcpy(dibh->b_data + sizeof(struct gfs2_dinode), symname, ip->i_inode.i_size);
506 break; 499 break;
507 } 500 }
508 501
@@ -511,25 +504,22 @@ static void init_dinode(struct gfs2_inode *dip, struct gfs2_glock *gl,
511 *bhp = dibh; 504 *bhp = dibh;
512} 505}
513 506
514static int make_dinode(struct gfs2_inode *dip, struct gfs2_glock *gl, 507static int make_dinode(struct gfs2_inode *dip, struct gfs2_inode *ip,
515 umode_t mode, const struct gfs2_inum_host *inum, 508 const char *symname, struct buffer_head **bhp)
516 const u64 *generation, dev_t dev, const char *symname,
517 unsigned int size, struct buffer_head **bhp)
518{ 509{
510 struct inode *inode = &ip->i_inode;
519 struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode); 511 struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode);
520 unsigned int uid, gid;
521 int error; 512 int error;
522 513
523 munge_mode_uid_gid(dip, &mode, &uid, &gid);
524 error = gfs2_rindex_update(sdp); 514 error = gfs2_rindex_update(sdp);
525 if (error) 515 if (error)
526 return error; 516 return error;
527 517
528 error = gfs2_quota_lock(dip, uid, gid); 518 error = gfs2_quota_lock(dip, inode->i_uid, inode->i_gid);
529 if (error) 519 if (error)
530 return error; 520 return error;
531 521
532 error = gfs2_quota_check(dip, uid, gid); 522 error = gfs2_quota_check(dip, inode->i_uid, inode->i_gid);
533 if (error) 523 if (error)
534 goto out_quota; 524 goto out_quota;
535 525
@@ -537,8 +527,8 @@ static int make_dinode(struct gfs2_inode *dip, struct gfs2_glock *gl,
537 if (error) 527 if (error)
538 goto out_quota; 528 goto out_quota;
539 529
540 init_dinode(dip, gl, inum, mode, uid, gid, generation, dev, symname, size, bhp); 530 init_dinode(dip, ip, symname, bhp);
541 gfs2_quota_change(dip, +1, uid, gid); 531 gfs2_quota_change(dip, +1, inode->i_uid, inode->i_gid);
542 gfs2_trans_end(sdp); 532 gfs2_trans_end(sdp);
543 533
544out_quota: 534out_quota:
@@ -570,7 +560,7 @@ static int link_dinode(struct gfs2_inode *dip, const struct qstr *name,
570 if (error) 560 if (error)
571 goto fail_quota_locks; 561 goto fail_quota_locks;
572 562
573 error = gfs2_inplace_reserve(dip, sdp->sd_max_dirres); 563 error = gfs2_inplace_reserve(dip, sdp->sd_max_dirres, 0);
574 if (error) 564 if (error)
575 goto fail_quota_locks; 565 goto fail_quota_locks;
576 566
@@ -657,19 +647,14 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
657 struct inode *inode = NULL; 647 struct inode *inode = NULL;
658 struct gfs2_inode *dip = GFS2_I(dir), *ip; 648 struct gfs2_inode *dip = GFS2_I(dir), *ip;
659 struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode); 649 struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode);
660 struct gfs2_inum_host inum = { .no_addr = 0, .no_formal_ino = 0 }; 650 struct gfs2_glock *io_gl;
661 int error; 651 int error;
662 u64 generation;
663 struct buffer_head *bh = NULL; 652 struct buffer_head *bh = NULL;
653 u32 aflags = 0;
664 654
665 if (!name->len || name->len > GFS2_FNAMESIZE) 655 if (!name->len || name->len > GFS2_FNAMESIZE)
666 return -ENAMETOOLONG; 656 return -ENAMETOOLONG;
667 657
668 /* We need a reservation to allocate the new dinode block. The
669 directory ip temporarily points to the reservation, but this is
670 being done to get a set of contiguous blocks for the new dinode.
671 Since this is a create, we don't have a sizehint yet, so it will
672 have to use the minimum reservation size. */
673 error = gfs2_rs_alloc(dip); 658 error = gfs2_rs_alloc(dip);
674 if (error) 659 if (error)
675 return error; 660 return error;
@@ -688,45 +673,72 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
688 if (error) 673 if (error)
689 goto fail_gunlock; 674 goto fail_gunlock;
690 675
691 error = alloc_dinode(dip, &inum.no_addr, &generation); 676 inode = new_inode(sdp->sd_vfs);
677 if (!inode) {
678 gfs2_glock_dq_uninit(ghs);
679 return -ENOMEM;
680 }
681 ip = GFS2_I(inode);
682 error = gfs2_rs_alloc(ip);
692 if (error) 683 if (error)
693 goto fail_gunlock; 684 goto fail_free_inode;
694 inum.no_formal_ino = generation; 685
686 set_bit(GIF_INVALID, &ip->i_flags);
687 inode->i_mode = mode;
688 inode->i_rdev = dev;
689 inode->i_size = size;
690 munge_mode_uid_gid(dip, inode);
691 ip->i_goal = dip->i_goal;
695 692
696 error = gfs2_glock_nq_num(sdp, inum.no_addr, &gfs2_inode_glops, 693 if ((GFS2_I(sdp->sd_root_dir->d_inode) == dip) ||
697 LM_ST_EXCLUSIVE, GL_SKIP, ghs + 1); 694 (dip->i_diskflags & GFS2_DIF_TOPDIR))
695 aflags |= GFS2_AF_ORLOV;
696
697 error = alloc_dinode(ip, aflags);
698 if (error) 698 if (error)
699 goto fail_gunlock; 699 goto fail_free_inode;
700 700
701 error = make_dinode(dip, ghs[1].gh_gl, mode, &inum, &generation, dev, symname, size, &bh); 701 error = gfs2_glock_get(sdp, ip->i_no_addr, &gfs2_inode_glops, CREATE, &ip->i_gl);
702 if (error) 702 if (error)
703 goto fail_gunlock2; 703 goto fail_free_inode;
704 704
705 inode = gfs2_inode_lookup(dir->i_sb, IF2DT(mode), inum.no_addr, 705 ip->i_gl->gl_object = ip;
706 inum.no_formal_ino, 0); 706 error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_SKIP, ghs + 1);
707 if (IS_ERR(inode)) 707 if (error)
708 goto fail_free_inode;
709
710 error = make_dinode(dip, ip, symname, &bh);
711 if (error)
708 goto fail_gunlock2; 712 goto fail_gunlock2;
709 713
710 ip = GFS2_I(inode); 714 error = gfs2_glock_get(sdp, ip->i_no_addr, &gfs2_iopen_glops, CREATE, &io_gl);
711 error = gfs2_inode_refresh(ip);
712 if (error) 715 if (error)
713 goto fail_gunlock2; 716 goto fail_gunlock2;
714 717
715 error = gfs2_rs_alloc(ip); 718 error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, GL_EXACT, &ip->i_iopen_gh);
716 if (error) 719 if (error)
717 goto fail_gunlock2; 720 goto fail_gunlock2;
718 721
722 ip->i_iopen_gh.gh_gl->gl_object = ip;
723 gfs2_glock_put(io_gl);
724 gfs2_set_iop(inode);
725 insert_inode_hash(inode);
726
727 error = gfs2_inode_refresh(ip);
728 if (error)
729 goto fail_gunlock3;
730
719 error = gfs2_acl_create(dip, inode); 731 error = gfs2_acl_create(dip, inode);
720 if (error) 732 if (error)
721 goto fail_gunlock2; 733 goto fail_gunlock3;
722 734
723 error = gfs2_security_init(dip, ip, name); 735 error = gfs2_security_init(dip, ip, name);
724 if (error) 736 if (error)
725 goto fail_gunlock2; 737 goto fail_gunlock3;
726 738
727 error = link_dinode(dip, name, ip); 739 error = link_dinode(dip, name, ip);
728 if (error) 740 if (error)
729 goto fail_gunlock2; 741 goto fail_gunlock3;
730 742
731 if (bh) 743 if (bh)
732 brelse(bh); 744 brelse(bh);
@@ -739,8 +751,20 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
739 d_instantiate(dentry, inode); 751 d_instantiate(dentry, inode);
740 return 0; 752 return 0;
741 753
754fail_gunlock3:
755 gfs2_glock_dq_uninit(ghs + 1);
756 if (ip->i_gl)
757 gfs2_glock_put(ip->i_gl);
758 goto fail_gunlock;
759
742fail_gunlock2: 760fail_gunlock2:
743 gfs2_glock_dq_uninit(ghs + 1); 761 gfs2_glock_dq_uninit(ghs + 1);
762fail_free_inode:
763 if (ip->i_gl)
764 gfs2_glock_put(ip->i_gl);
765 gfs2_rs_delete(ip);
766 free_inode_nonrcu(inode);
767 inode = NULL;
744fail_gunlock: 768fail_gunlock:
745 gfs2_glock_dq_uninit(ghs); 769 gfs2_glock_dq_uninit(ghs);
746 if (inode && !IS_ERR(inode)) { 770 if (inode && !IS_ERR(inode)) {
@@ -748,7 +772,6 @@ fail_gunlock:
748 iput(inode); 772 iput(inode);
749 } 773 }
750fail: 774fail:
751 gfs2_rs_delete(dip);
752 if (bh) 775 if (bh)
753 brelse(bh); 776 brelse(bh);
754 return error; 777 return error;
@@ -884,7 +907,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
884 if (error) 907 if (error)
885 goto out_gunlock; 908 goto out_gunlock;
886 909
887 error = gfs2_inplace_reserve(dip, sdp->sd_max_dirres); 910 error = gfs2_inplace_reserve(dip, sdp->sd_max_dirres, 0);
888 if (error) 911 if (error)
889 goto out_gunlock_q; 912 goto out_gunlock_q;
890 913
@@ -977,7 +1000,6 @@ static int gfs2_unlink_ok(struct gfs2_inode *dip, const struct qstr *name,
977 * gfs2_unlink_inode - Removes an inode from its parent dir and unlinks it 1000 * gfs2_unlink_inode - Removes an inode from its parent dir and unlinks it
978 * @dip: The parent directory 1001 * @dip: The parent directory
979 * @name: The name of the entry in the parent directory 1002 * @name: The name of the entry in the parent directory
980 * @bh: The inode buffer for the inode to be removed
981 * @inode: The inode to be removed 1003 * @inode: The inode to be removed
982 * 1004 *
983 * Called with all the locks and in a transaction. This will only be 1005 * Called with all the locks and in a transaction. This will only be
@@ -987,8 +1009,7 @@ static int gfs2_unlink_ok(struct gfs2_inode *dip, const struct qstr *name,
987 */ 1009 */
988 1010
989static int gfs2_unlink_inode(struct gfs2_inode *dip, 1011static int gfs2_unlink_inode(struct gfs2_inode *dip,
990 const struct dentry *dentry, 1012 const struct dentry *dentry)
991 struct buffer_head *bh)
992{ 1013{
993 struct inode *inode = dentry->d_inode; 1014 struct inode *inode = dentry->d_inode;
994 struct gfs2_inode *ip = GFS2_I(inode); 1015 struct gfs2_inode *ip = GFS2_I(inode);
@@ -1028,7 +1049,6 @@ static int gfs2_unlink(struct inode *dir, struct dentry *dentry)
1028 struct gfs2_sbd *sdp = GFS2_SB(dir); 1049 struct gfs2_sbd *sdp = GFS2_SB(dir);
1029 struct inode *inode = dentry->d_inode; 1050 struct inode *inode = dentry->d_inode;
1030 struct gfs2_inode *ip = GFS2_I(inode); 1051 struct gfs2_inode *ip = GFS2_I(inode);
1031 struct buffer_head *bh;
1032 struct gfs2_holder ghs[3]; 1052 struct gfs2_holder ghs[3];
1033 struct gfs2_rgrpd *rgd; 1053 struct gfs2_rgrpd *rgd;
1034 int error; 1054 int error;
@@ -1077,14 +1097,9 @@ static int gfs2_unlink(struct inode *dir, struct dentry *dentry)
1077 1097
1078 error = gfs2_trans_begin(sdp, 2*RES_DINODE + 3*RES_LEAF + RES_RG_BIT, 0); 1098 error = gfs2_trans_begin(sdp, 2*RES_DINODE + 3*RES_LEAF + RES_RG_BIT, 0);
1079 if (error) 1099 if (error)
1080 goto out_gunlock;
1081
1082 error = gfs2_meta_inode_buffer(ip, &bh);
1083 if (error)
1084 goto out_end_trans; 1100 goto out_end_trans;
1085 1101
1086 error = gfs2_unlink_inode(dip, dentry, bh); 1102 error = gfs2_unlink_inode(dip, dentry);
1087 brelse(bh);
1088 1103
1089out_end_trans: 1104out_end_trans:
1090 gfs2_trans_end(sdp); 1105 gfs2_trans_end(sdp);
@@ -1365,7 +1380,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
1365 if (error) 1380 if (error)
1366 goto out_gunlock; 1381 goto out_gunlock;
1367 1382
1368 error = gfs2_inplace_reserve(ndip, sdp->sd_max_dirres); 1383 error = gfs2_inplace_reserve(ndip, sdp->sd_max_dirres, 0);
1369 if (error) 1384 if (error)
1370 goto out_gunlock_q; 1385 goto out_gunlock_q;
1371 1386
@@ -1384,14 +1399,8 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
1384 1399
1385 /* Remove the target file, if it exists */ 1400 /* Remove the target file, if it exists */
1386 1401
1387 if (nip) { 1402 if (nip)
1388 struct buffer_head *bh; 1403 error = gfs2_unlink_inode(ndip, ndentry);
1389 error = gfs2_meta_inode_buffer(nip, &bh);
1390 if (error)
1391 goto out_end_trans;
1392 error = gfs2_unlink_inode(ndip, ndentry, bh);
1393 brelse(bh);
1394 }
1395 1404
1396 if (dir_rename) { 1405 if (dir_rename) {
1397 error = gfs2_dir_mvino(ip, &gfs2_qdotdot, ndip, DT_DIR); 1406 error = gfs2_dir_mvino(ip, &gfs2_qdotdot, ndip, DT_DIR);