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.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c
index 291f0c7eaa3b..9f71372c1757 100644
--- a/fs/gfs2/ops_inode.c
+++ b/fs/gfs2/ops_inode.c
@@ -61,7 +61,7 @@ static int gfs2_create(struct inode *dir, struct dentry *dentry,
61 inode = gfs2_createi(ghs, &dentry->d_name, S_IFREG | mode, 0); 61 inode = gfs2_createi(ghs, &dentry->d_name, S_IFREG | mode, 0);
62 if (!IS_ERR(inode)) { 62 if (!IS_ERR(inode)) {
63 gfs2_trans_end(sdp); 63 gfs2_trans_end(sdp);
64 if (dip->i_alloc.al_rgd) 64 if (dip->i_alloc->al_rgd)
65 gfs2_inplace_release(dip); 65 gfs2_inplace_release(dip);
66 gfs2_quota_unlock(dip); 66 gfs2_quota_unlock(dip);
67 gfs2_alloc_put(dip); 67 gfs2_alloc_put(dip);
@@ -113,8 +113,18 @@ static struct dentry *gfs2_lookup(struct inode *dir, struct dentry *dentry,
113 if (inode && IS_ERR(inode)) 113 if (inode && IS_ERR(inode))
114 return ERR_PTR(PTR_ERR(inode)); 114 return ERR_PTR(PTR_ERR(inode));
115 115
116 if (inode) 116 if (inode) {
117 struct gfs2_glock *gl = GFS2_I(inode)->i_gl;
118 struct gfs2_holder gh;
119 int error;
120 error = gfs2_glock_nq_init(gl, LM_ST_SHARED, LM_FLAG_ANY, &gh);
121 if (error) {
122 iput(inode);
123 return ERR_PTR(error);
124 }
125 gfs2_glock_dq_uninit(&gh);
117 return d_splice_alias(inode, dentry); 126 return d_splice_alias(inode, dentry);
127 }
118 d_add(dentry, inode); 128 d_add(dentry, inode);
119 129
120 return NULL; 130 return NULL;
@@ -366,7 +376,7 @@ static int gfs2_symlink(struct inode *dir, struct dentry *dentry,
366 } 376 }
367 377
368 gfs2_trans_end(sdp); 378 gfs2_trans_end(sdp);
369 if (dip->i_alloc.al_rgd) 379 if (dip->i_alloc->al_rgd)
370 gfs2_inplace_release(dip); 380 gfs2_inplace_release(dip);
371 gfs2_quota_unlock(dip); 381 gfs2_quota_unlock(dip);
372 gfs2_alloc_put(dip); 382 gfs2_alloc_put(dip);
@@ -442,7 +452,7 @@ static int gfs2_mkdir(struct inode *dir, struct dentry *dentry, int mode)
442 gfs2_assert_withdraw(sdp, !error); /* dip already pinned */ 452 gfs2_assert_withdraw(sdp, !error); /* dip already pinned */
443 453
444 gfs2_trans_end(sdp); 454 gfs2_trans_end(sdp);
445 if (dip->i_alloc.al_rgd) 455 if (dip->i_alloc->al_rgd)
446 gfs2_inplace_release(dip); 456 gfs2_inplace_release(dip);
447 gfs2_quota_unlock(dip); 457 gfs2_quota_unlock(dip);
448 gfs2_alloc_put(dip); 458 gfs2_alloc_put(dip);
@@ -548,7 +558,7 @@ static int gfs2_mknod(struct inode *dir, struct dentry *dentry, int mode,
548 } 558 }
549 559
550 gfs2_trans_end(sdp); 560 gfs2_trans_end(sdp);
551 if (dip->i_alloc.al_rgd) 561 if (dip->i_alloc->al_rgd)
552 gfs2_inplace_release(dip); 562 gfs2_inplace_release(dip);
553 gfs2_quota_unlock(dip); 563 gfs2_quota_unlock(dip);
554 gfs2_alloc_put(dip); 564 gfs2_alloc_put(dip);