Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cc92e7ac8d96418d99f0c31a9a132e9fccc54553
Commit:     cc92e7ac8d96418d99f0c31a9a132e9fccc54553
Parent:     0adba5363ccbee073f127feb1d6942e64ee63ab3
Author:     Christoph Hellwig <[EMAIL PROTECTED]>
AuthorDate: Thu Aug 30 17:21:54 2007 +1000
Committer:  Tim Shimmin <[EMAIL PROTECTED]>
CommitDate: Tue Oct 16 12:18:09 2007 +1000

    [XFS] growlock should be a mutex
    
    m_growlock only needs plain binary mutex semantics, so use a struct mutex
    instead of a semaphore for it.
    
    SGI-PV: 968563
    SGI-Modid: xfs-linux-melb:xfs-kern:29512a
    
    Signed-off-by: Christoph Hellwig <[EMAIL PROTECTED]>
    Signed-off-by: David Chinner <[EMAIL PROTECTED]>
    Signed-off-by: Tim Shimmin <[EMAIL PROTECTED]>
---
 fs/xfs/xfs_fsops.c |    8 ++++----
 fs/xfs/xfs_mount.c |    4 ++--
 fs/xfs/xfs_mount.h |    2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
index 94bd9f2..c92d5b8 100644
--- a/fs/xfs/xfs_fsops.c
+++ b/fs/xfs/xfs_fsops.c
@@ -433,10 +433,10 @@ xfs_growfs_data(
        xfs_growfs_data_t       *in)
 {
        int error;
-       if (!cpsema(&mp->m_growlock))
+       if (!mutex_trylock(&mp->m_growlock))
                return XFS_ERROR(EWOULDBLOCK);
        error = xfs_growfs_data_private(mp, in);
-       vsema(&mp->m_growlock);
+       mutex_unlock(&mp->m_growlock);
        return error;
 }
 
@@ -446,10 +446,10 @@ xfs_growfs_log(
        xfs_growfs_log_t        *in)
 {
        int error;
-       if (!cpsema(&mp->m_growlock))
+       if (!mutex_trylock(&mp->m_growlock))
                return XFS_ERROR(EWOULDBLOCK);
        error = xfs_growfs_log_private(mp, in);
-       vsema(&mp->m_growlock);
+       mutex_unlock(&mp->m_growlock);
        return error;
 }
 
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index ba8df2f..ebdb76d 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -139,7 +139,7 @@ xfs_mount_init(void)
        AIL_LOCKINIT(&mp->m_ail_lock, "xfs_ail");
        spinlock_init(&mp->m_sb_lock, "xfs_sb");
        mutex_init(&mp->m_ilock);
-       initnsema(&mp->m_growlock, 1, "xfs_grow");
+       mutex_init(&mp->m_growlock);
        /*
         * Initialize the AIL.
         */
@@ -174,7 +174,7 @@ xfs_mount_free(
        AIL_LOCK_DESTROY(&mp->m_ail_lock);
        spinlock_destroy(&mp->m_sb_lock);
        mutex_destroy(&mp->m_ilock);
-       freesema(&mp->m_growlock);
+       mutex_destroy(&mp->m_growlock);
        if (mp->m_quotainfo)
                XFS_QM_DONE(mp);
 
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index 7f671f8..c618f7c 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -384,7 +384,7 @@ typedef struct xfs_mount {
        uint                    m_in_maxlevels; /* XFS_IN_MAXLEVELS */
        struct xfs_perag        *m_perag;       /* per-ag accounting info */
        struct rw_semaphore     m_peraglock;    /* lock for m_perag (pointer) */
-       sema_t                  m_growlock;     /* growfs mutex */
+       struct mutex            m_growlock;     /* growfs mutex */
        int                     m_fixedfsid[2]; /* unchanged for life of FS */
        uint                    m_dmevmask;     /* DMI events for this FS */
        __uint64_t              m_flags;        /* global mount flags */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to