]> err.no Git - linux-2.6/commitdiff
[XFS] Unwrap XFS_DQ_PINUNLOCK.
authorEric Sandeen <sandeen@sandeen.net>
Thu, 11 Oct 2007 07:38:18 +0000 (17:38 +1000)
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>
Thu, 7 Feb 2008 05:44:50 +0000 (16:44 +1100)
Un-obfuscate DQ_PINLOCK, remove DQ_PINLOCK->mutex_lock->spin_lock macros,
call spin_lock directly, remove extraneous cookie holdover from old xfs
code, and change lock type to spinlock_t.

SGI-PV: 970382
SGI-Modid: xfs-linux-melb:xfs-kern:29742a

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Signed-off-by: Donald Douwsma <donaldd@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
fs/xfs/quota/xfs_dquot.h
fs/xfs/quota/xfs_dquot_item.c
fs/xfs/quota/xfs_qm.h

index 78d3ab95c5fda9224c9927e3cb6816aac907d7b8..5c371a92e3e24c010cbed274fb8b3f37169a466e 100644 (file)
@@ -123,11 +123,6 @@ XFS_DQ_IS_LOCKED(xfs_dquot_t *dqp)
                                   vsema(&((dqp)->q_flock)); \
                                   (dqp)->dq_flags &= ~(XFS_DQ_FLOCKED); }
 
-#define XFS_DQ_PINLOCK(dqp)       mutex_spinlock( \
-                                    &(XFS_DQ_TO_QINF(dqp)->qi_pinlock))
-#define XFS_DQ_PINUNLOCK(dqp, s)   mutex_spinunlock( \
-                                    &(XFS_DQ_TO_QINF(dqp)->qi_pinlock), s)
-
 #define XFS_DQ_IS_FLUSH_LOCKED(dqp) (issemalocked(&((dqp)->q_flock)))
 #define XFS_DQ_IS_ON_FREELIST(dqp)  ((dqp)->dq_flnext != (dqp))
 #define XFS_DQ_IS_DIRTY(dqp)   ((dqp)->dq_flags & XFS_DQ_DIRTY)
index a00b71b05a37455b8d82c33354f6cdb3633d2c38..1800e8d1f646f09448f8686267f5a1574645683d 100644 (file)
@@ -94,14 +94,13 @@ STATIC void
 xfs_qm_dquot_logitem_pin(
        xfs_dq_logitem_t *logitem)
 {
-       unsigned long   s;
        xfs_dquot_t *dqp;
 
        dqp = logitem->qli_dquot;
        ASSERT(XFS_DQ_IS_LOCKED(dqp));
-       s = XFS_DQ_PINLOCK(dqp);
+       spin_lock(&(XFS_DQ_TO_QINF(dqp)->qi_pinlock));
        dqp->q_pincount++;
-       XFS_DQ_PINUNLOCK(dqp, s);
+       spin_unlock(&(XFS_DQ_TO_QINF(dqp)->qi_pinlock));
 }
 
 /*
@@ -115,17 +114,16 @@ xfs_qm_dquot_logitem_unpin(
        xfs_dq_logitem_t *logitem,
        int               stale)
 {
-       unsigned long   s;
        xfs_dquot_t *dqp;
 
        dqp = logitem->qli_dquot;
        ASSERT(dqp->q_pincount > 0);
-       s = XFS_DQ_PINLOCK(dqp);
+       spin_lock(&(XFS_DQ_TO_QINF(dqp)->qi_pinlock));
        dqp->q_pincount--;
        if (dqp->q_pincount == 0) {
                sv_broadcast(&dqp->q_pinwait);
        }
-       XFS_DQ_PINUNLOCK(dqp, s);
+       spin_unlock(&(XFS_DQ_TO_QINF(dqp)->qi_pinlock));
 }
 
 /* ARGSUSED */
@@ -189,8 +187,6 @@ void
 xfs_qm_dqunpin_wait(
        xfs_dquot_t     *dqp)
 {
-       SPLDECL(s);
-
        ASSERT(XFS_DQ_IS_LOCKED(dqp));
        if (dqp->q_pincount == 0) {
                return;
@@ -200,9 +196,9 @@ xfs_qm_dqunpin_wait(
         * Give the log a push so we don't wait here too long.
         */
        xfs_log_force(dqp->q_mount, (xfs_lsn_t)0, XFS_LOG_FORCE);
-       s = XFS_DQ_PINLOCK(dqp);
+       spin_lock(&(XFS_DQ_TO_QINF(dqp)->qi_pinlock));
        if (dqp->q_pincount == 0) {
-               XFS_DQ_PINUNLOCK(dqp, s);
+               spin_unlock(&(XFS_DQ_TO_QINF(dqp)->qi_pinlock));
                return;
        }
        sv_wait(&(dqp->q_pinwait), PINOD,
index 23ccaa5fceaf8fce92ba713ff0b263dd86ba6132..023400aa55a3d26651bf1efd7304db757a5f249f 100644 (file)
@@ -106,7 +106,7 @@ typedef struct xfs_qm {
 typedef struct xfs_quotainfo {
        xfs_inode_t     *qi_uquotaip;    /* user quota inode */
        xfs_inode_t     *qi_gquotaip;    /* group quota inode */
-       lock_t           qi_pinlock;     /* dquot pinning mutex */
+       spinlock_t       qi_pinlock;     /* dquot pinning lock */
        xfs_dqlist_t     qi_dqlist;      /* all dquots in filesys */
        int              qi_dqreclaims;  /* a change here indicates
                                            a removal in the dqlist */