]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - fs/xfs/xfs_dquot.c
xfs: return is not a function
[mirror_ubuntu-artful-kernel.git] / fs / xfs / xfs_dquot.c
index 868b19f096bfa412223b72ad6d75fd72c909647d..9dc5d3954cf725fcf29d342fdf5f0a61dd79cd6d 100644 (file)
@@ -327,7 +327,7 @@ xfs_qm_dqalloc(
         */
        if (!xfs_this_quota_on(dqp->q_mount, dqp->dq_flags)) {
                xfs_iunlock(quotip, XFS_ILOCK_EXCL);
-               return (ESRCH);
+               return ESRCH;
        }
 
        xfs_trans_ijoin(tp, quotip, XFS_ILOCK_EXCL);
@@ -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;
 
        /*
@@ -400,7 +400,7 @@ xfs_qm_dqalloc(
       error0:
        xfs_iunlock(quotip, XFS_ILOCK_EXCL);
 
-       return (error);
+       return error;
 }
 
 STATIC int
@@ -547,7 +547,7 @@ xfs_qm_dqtobp(
        *O_bpp = bp;
        *O_ddpp = bp->b_addr + dqp->q_bufoffset;
 
-       return (0);
+       return 0;
 }
 
 
@@ -715,7 +715,7 @@ xfs_qm_dqget(
        if ((! XFS_IS_UQUOTA_ON(mp) && type == XFS_DQ_USER) ||
            (! XFS_IS_PQUOTA_ON(mp) && type == XFS_DQ_PROJ) ||
            (! XFS_IS_GQUOTA_ON(mp) && type == XFS_DQ_GROUP)) {
-               return (ESRCH);
+               return ESRCH;
        }
 
 #ifdef DEBUG
@@ -723,7 +723,7 @@ xfs_qm_dqget(
                if ((xfs_dqerror_target == mp->m_ddev_targp) &&
                    (xfs_dqreq_num++ % xfs_dqerror_mod) == 0) {
                        xfs_debug(mp, "Returning error in dqget");
-                       return (EIO);
+                       return EIO;
                }
        }
 
@@ -829,48 +829,7 @@ restart:
        ASSERT((ip == NULL) || xfs_isilocked(ip, XFS_ILOCK_EXCL));
        trace_xfs_dqget_miss(dqp);
        *O_dqpp = dqp;
-       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);
+       return 0;
 }
 
 /*
@@ -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);
 }
 
 /*