]> git.ipfire.org Git - people/ms/linux.git/blobdiff - fs/gfs2/glops.c
Merge branch 'for-6.0/dax' into libnvdimm-fixes
[people/ms/linux.git] / fs / gfs2 / glops.c
index 392800f082a6b97464b8dcdc09e28b82ac3a2e79..49210a2e7ce753784483b43ad59a2d2f81fc8506 100644 (file)
@@ -485,35 +485,33 @@ int gfs2_inode_refresh(struct gfs2_inode *ip)
  * Returns: errno
  */
 
-static int inode_go_instantiate(struct gfs2_holder *gh)
+static int inode_go_instantiate(struct gfs2_glock *gl)
+{
+       struct gfs2_inode *ip = gl->gl_object;
+
+       if (!ip) /* no inode to populate - read it in later */
+               return 0;
+
+       return gfs2_inode_refresh(ip);
+}
+
+static int inode_go_held(struct gfs2_holder *gh)
 {
        struct gfs2_glock *gl = gh->gh_gl;
-       struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
        struct gfs2_inode *ip = gl->gl_object;
        int error = 0;
 
        if (!ip) /* no inode to populate - read it in later */
-               goto out;
-
-       error = gfs2_inode_refresh(ip);
-       if (error)
-               goto out;
+               return 0;
 
        if (gh->gh_state != LM_ST_DEFERRED)
                inode_dio_wait(&ip->i_inode);
 
        if ((ip->i_diskflags & GFS2_DIF_TRUNC_IN_PROG) &&
            (gl->gl_state == LM_ST_EXCLUSIVE) &&
-           (gh->gh_state == LM_ST_EXCLUSIVE)) {
-               spin_lock(&sdp->sd_trunc_lock);
-               if (list_empty(&ip->i_trunc_list))
-                       list_add(&ip->i_trunc_list, &sdp->sd_trunc_list);
-               spin_unlock(&sdp->sd_trunc_lock);
-               wake_up(&sdp->sd_quota_wait);
-               error = 1;
-       }
+           (gh->gh_state == LM_ST_EXCLUSIVE))
+               error = gfs2_truncatei_resume(ip);
 
-out:
        return error;
 }
 
@@ -737,6 +735,7 @@ const struct gfs2_glock_operations gfs2_inode_glops = {
        .go_inval = inode_go_inval,
        .go_demote_ok = inode_go_demote_ok,
        .go_instantiate = inode_go_instantiate,
+       .go_held = inode_go_held,
        .go_dump = inode_go_dump,
        .go_type = LM_TYPE_INODE,
        .go_flags = GLOF_ASPACE | GLOF_LRU | GLOF_LVB,