diff options
author | Olof Johansson <olof@lixom.net> | 2012-03-08 09:20:29 -0800 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2012-03-08 09:20:29 -0800 |
commit | acf346084bca289a00020a5c29c23673b801b380 (patch) | |
tree | 1ab7f6eeefd0564d8fb708b858dc19c8b7e0a67c /fs/gfs2/glock.c | |
parent | c71656c018c8551eca45b2f873b239f0303d74cb (diff) | |
parent | 38bb3630bcba25f16106166a4aaf211c1d195863 (diff) | |
download | blackbird-op-linux-acf346084bca289a00020a5c29c23673b801b380.tar.gz blackbird-op-linux-acf346084bca289a00020a5c29c23673b801b380.zip |
Merge tag 'imx35-imx5-aips-setup' of git://git.pengutronix.de/git/imx/linux-2.6 into next/soc
i.MX35/5 AIPS setup
Includes sync up to 3.3-rc6
* tag 'imx35-imx5-aips-setup' of git://git.pengutronix.de/git/imx/linux-2.6:
ARM: mx35: Setup the AIPS registers
ARM: mx5: Use common function for configuring AIPS
Diffstat (limited to 'fs/gfs2/glock.c')
-rw-r--r-- | fs/gfs2/glock.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 376816fcd040..351a3e797789 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -167,14 +167,19 @@ void gfs2_glock_add_to_lru(struct gfs2_glock *gl) spin_unlock(&lru_lock); } -static void gfs2_glock_remove_from_lru(struct gfs2_glock *gl) +static void __gfs2_glock_remove_from_lru(struct gfs2_glock *gl) { - spin_lock(&lru_lock); if (!list_empty(&gl->gl_lru)) { list_del_init(&gl->gl_lru); atomic_dec(&lru_count); clear_bit(GLF_LRU, &gl->gl_flags); } +} + +static void gfs2_glock_remove_from_lru(struct gfs2_glock *gl) +{ + spin_lock(&lru_lock); + __gfs2_glock_remove_from_lru(gl); spin_unlock(&lru_lock); } @@ -217,11 +222,12 @@ void gfs2_glock_put(struct gfs2_glock *gl) struct gfs2_sbd *sdp = gl->gl_sbd; struct address_space *mapping = gfs2_glock2aspace(gl); - if (atomic_dec_and_test(&gl->gl_ref)) { + if (atomic_dec_and_lock(&gl->gl_ref, &lru_lock)) { + __gfs2_glock_remove_from_lru(gl); + spin_unlock(&lru_lock); spin_lock_bucket(gl->gl_hash); hlist_bl_del_rcu(&gl->gl_list); spin_unlock_bucket(gl->gl_hash); - gfs2_glock_remove_from_lru(gl); GLOCK_BUG_ON(gl, !list_empty(&gl->gl_holders)); GLOCK_BUG_ON(gl, mapping && mapping->nrpages); trace_gfs2_glock_put(gl); |