]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/gfs2/ops_inode.c
FRV: Don't make smp_{r, w, }mb() interpolate MEMBAR when CONFIG_SMP=n [try #2]
[linux-2.6-omap-h63xx.git] / fs / gfs2 / ops_inode.c
index 291f0c7eaa3bcf8249876a73e43f8920dbfa1f24..e87412902bed76313428bdeb7d7c3e9e1f476d59 100644 (file)
@@ -61,7 +61,7 @@ static int gfs2_create(struct inode *dir, struct dentry *dentry,
                inode = gfs2_createi(ghs, &dentry->d_name, S_IFREG | mode, 0);
                if (!IS_ERR(inode)) {
                        gfs2_trans_end(sdp);
-                       if (dip->i_alloc.al_rgd)
+                       if (dip->i_alloc->al_rgd)
                                gfs2_inplace_release(dip);
                        gfs2_quota_unlock(dip);
                        gfs2_alloc_put(dip);
@@ -111,10 +111,20 @@ static struct dentry *gfs2_lookup(struct inode *dir, struct dentry *dentry,
 
        inode = gfs2_lookupi(dir, &dentry->d_name, 0, nd);
        if (inode && IS_ERR(inode))
-               return ERR_PTR(PTR_ERR(inode));
-
-       if (inode)
+               return ERR_CAST(inode);
+
+       if (inode) {
+               struct gfs2_glock *gl = GFS2_I(inode)->i_gl;
+               struct gfs2_holder gh;
+               int error;
+               error = gfs2_glock_nq_init(gl, LM_ST_SHARED, LM_FLAG_ANY, &gh);
+               if (error) {
+                       iput(inode);
+                       return ERR_PTR(error);
+               }
+               gfs2_glock_dq_uninit(&gh);
                return d_splice_alias(inode, dentry);
+       }
        d_add(dentry, inode);
 
        return NULL;
@@ -366,7 +376,7 @@ static int gfs2_symlink(struct inode *dir, struct dentry *dentry,
        }
 
        gfs2_trans_end(sdp);
-       if (dip->i_alloc.al_rgd)
+       if (dip->i_alloc->al_rgd)
                gfs2_inplace_release(dip);
        gfs2_quota_unlock(dip);
        gfs2_alloc_put(dip);
@@ -442,7 +452,7 @@ static int gfs2_mkdir(struct inode *dir, struct dentry *dentry, int mode)
        gfs2_assert_withdraw(sdp, !error); /* dip already pinned */
 
        gfs2_trans_end(sdp);
-       if (dip->i_alloc.al_rgd)
+       if (dip->i_alloc->al_rgd)
                gfs2_inplace_release(dip);
        gfs2_quota_unlock(dip);
        gfs2_alloc_put(dip);
@@ -548,7 +558,7 @@ static int gfs2_mknod(struct inode *dir, struct dentry *dentry, int mode,
        }
 
        gfs2_trans_end(sdp);
-       if (dip->i_alloc.al_rgd)
+       if (dip->i_alloc->al_rgd)
                gfs2_inplace_release(dip);
        gfs2_quota_unlock(dip);
        gfs2_alloc_put(dip);