aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/ops_inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/ops_inode.c')
-rw-r--r--fs/gfs2/ops_inode.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c
index c10b914bf8cc..cf7a5bae3957 100644
--- a/fs/gfs2/ops_inode.c
+++ b/fs/gfs2/ops_inode.c
@@ -144,7 +144,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
144 int alloc_required; 144 int alloc_required;
145 int error; 145 int error;
146 146
147 if (S_ISDIR(ip->i_di.di_mode)) 147 if (S_ISDIR(inode->i_mode))
148 return -EPERM; 148 return -EPERM;
149 149
150 gfs2_holder_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, ghs); 150 gfs2_holder_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, ghs);
@@ -220,7 +220,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
220 } 220 }
221 221
222 error = gfs2_dir_add(dir, &dentry->d_name, &ip->i_num, 222 error = gfs2_dir_add(dir, &dentry->d_name, &ip->i_num,
223 IF2DT(ip->i_di.di_mode)); 223 IF2DT(inode->i_mode));
224 if (error) 224 if (error)
225 goto out_end_trans; 225 goto out_end_trans;
226 226
@@ -564,11 +564,10 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
564 564
565 /* Make sure we aren't trying to move a dirctory into it's subdir */ 565 /* Make sure we aren't trying to move a dirctory into it's subdir */
566 566
567 if (S_ISDIR(ip->i_di.di_mode) && odip != ndip) { 567 if (S_ISDIR(ip->i_inode.i_mode) && odip != ndip) {
568 dir_rename = 1; 568 dir_rename = 1;
569 569
570 error = gfs2_glock_nq_init(sdp->sd_rename_gl, 570 error = gfs2_glock_nq_init(sdp->sd_rename_gl, LM_ST_EXCLUSIVE, 0,
571 LM_ST_EXCLUSIVE, 0,
572 &r_gh); 571 &r_gh);
573 if (error) 572 if (error)
574 goto out; 573 goto out;
@@ -609,7 +608,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
609 if (error) 608 if (error)
610 goto out_gunlock; 609 goto out_gunlock;
611 610
612 if (S_ISDIR(nip->i_di.di_mode)) { 611 if (S_ISDIR(nip->i_inode.i_mode)) {
613 if (nip->i_di.di_entries < 2) { 612 if (nip->i_di.di_entries < 2) {
614 if (gfs2_consist_inode(nip)) 613 if (gfs2_consist_inode(nip))
615 gfs2_dinode_print(nip); 614 gfs2_dinode_print(nip);
@@ -646,7 +645,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
646 error = -EFBIG; 645 error = -EFBIG;
647 goto out_gunlock; 646 goto out_gunlock;
648 } 647 }
649 if (S_ISDIR(ip->i_di.di_mode) && 648 if (S_ISDIR(ip->i_inode.i_mode) &&
650 ndip->i_di.di_nlink == (u32)-1) { 649 ndip->i_di.di_nlink == (u32)-1) {
651 error = -EMLINK; 650 error = -EMLINK;
652 goto out_gunlock; 651 goto out_gunlock;
@@ -701,7 +700,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
701 /* Remove the target file, if it exists */ 700 /* Remove the target file, if it exists */
702 701
703 if (nip) { 702 if (nip) {
704 if (S_ISDIR(nip->i_di.di_mode)) 703 if (S_ISDIR(nip->i_inode.i_mode))
705 error = gfs2_rmdiri(ndip, &ndentry->d_name, nip); 704 error = gfs2_rmdiri(ndip, &ndentry->d_name, nip);
706 else { 705 else {
707 error = gfs2_dir_del(ndip, &ndentry->d_name); 706 error = gfs2_dir_del(ndip, &ndentry->d_name);
@@ -743,7 +742,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
743 goto out_end_trans; 742 goto out_end_trans;
744 743
745 error = gfs2_dir_add(ndir, &ndentry->d_name, &ip->i_num, 744 error = gfs2_dir_add(ndir, &ndentry->d_name, &ip->i_num,
746 IF2DT(ip->i_di.di_mode)); 745 IF2DT(ip->i_inode.i_mode));
747 if (error) 746 if (error)
748 goto out_end_trans; 747 goto out_end_trans;
749 748