rcu: Check both root and current rcu_node when setting up future grace period
[firefly-linux-kernel-4.4.55.git] / fs / xfs / xfs_dquot.c
index 868b19f096bfa412223b72ad6d75fd72c909647d..3ee0cd43edc00a00889c94fd08b87b0087ab7568 100644 (file)
@@ -353,10 +353,10 @@ xfs_qm_dqalloc(
                               dqp->q_blkno,
                               mp->m_quotainfo->qi_dqchunklen,
                               0);
-
-       error = xfs_buf_geterror(bp);
-       if (error)
+       if (!bp) {
+               error = ENOMEM;
                goto error1;
+       }
        bp->b_ops = &xfs_dquot_buf_ops;
 
        /*
@@ -832,47 +832,6 @@ restart:
        return (0);
 }
 
-
-STATIC void
-xfs_qm_dqput_final(
-       struct xfs_dquot        *dqp)
-{
-       struct xfs_quotainfo    *qi = dqp->q_mount->m_quotainfo;
-       struct xfs_dquot        *gdqp;
-       struct xfs_dquot        *pdqp;
-
-       trace_xfs_dqput_free(dqp);
-
-       if (list_lru_add(&qi->qi_lru, &dqp->q_lru))
-               XFS_STATS_INC(xs_qm_dquot_unused);
-
-       /*
-        * If we just added a udquot to the freelist, then we want to release
-        * the gdquot/pdquot reference that it (probably) has. Otherwise it'll
-        * keep the gdquot/pdquot from getting reclaimed.
-        */
-       gdqp = dqp->q_gdquot;
-       if (gdqp) {
-               xfs_dqlock(gdqp);
-               dqp->q_gdquot = NULL;
-       }
-
-       pdqp = dqp->q_pdquot;
-       if (pdqp) {
-               xfs_dqlock(pdqp);
-               dqp->q_pdquot = NULL;
-       }
-       xfs_dqunlock(dqp);
-
-       /*
-        * If we had a group/project quota hint, release it now.
-        */
-       if (gdqp)
-               xfs_qm_dqput(gdqp);
-       if (pdqp)
-               xfs_qm_dqput(pdqp);
-}
-
 /*
  * Release a reference to the dquot (decrement ref-count) and unlock it.
  *
@@ -888,10 +847,14 @@ xfs_qm_dqput(
 
        trace_xfs_dqput(dqp);
 
-       if (--dqp->q_nrefs > 0)
-               xfs_dqunlock(dqp);
-       else
-               xfs_qm_dqput_final(dqp);
+       if (--dqp->q_nrefs == 0) {
+               struct xfs_quotainfo    *qi = dqp->q_mount->m_quotainfo;
+               trace_xfs_dqput_free(dqp);
+
+               if (list_lru_add(&qi->qi_lru, &dqp->q_lru))
+                       XFS_STATS_INC(xs_qm_dquot_unused);
+       }
+       xfs_dqunlock(dqp);
 }
 
 /*