aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMatthew Garrett <mjg@redhat.com>2010-05-17 12:11:21 -0400
committerMatthew Garrett <mjg@redhat.com>2010-05-17 12:11:21 -0400
commita1e66dd0515c8cfa72b8e2a3834d59548cf84ba5 (patch)
treee1e1edf210c8dde6edbdfa32ed6ff59ac553729b /lib
parentd89d63a973986bf6c1d8b28ab62eb61491a3bb34 (diff)
parent6c62673cf58516e1b82329ac90ebf3ff3f485672 (diff)
Merge branch 'x86-platform-next' into x86-platform
Diffstat (limited to 'lib')
-rw-r--r--lib/btree.c3
-rw-r--r--lib/rwsem.c5
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/btree.c b/lib/btree.c
index 41859a820218..c9c6f0351526 100644
--- a/lib/btree.c
+++ b/lib/btree.c
@@ -95,7 +95,8 @@ static unsigned long *btree_node_alloc(struct btree_head *head, gfp_t gfp)
95 unsigned long *node; 95 unsigned long *node;
96 96
97 node = mempool_alloc(head->mempool, gfp); 97 node = mempool_alloc(head->mempool, gfp);
98 memset(node, 0, NODESIZE); 98 if (likely(node))
99 memset(node, 0, NODESIZE);
99 return node; 100 return node;
100} 101}
101 102
diff --git a/lib/rwsem.c b/lib/rwsem.c
index 3e3365e5665e..ceba8e28807a 100644
--- a/lib/rwsem.c
+++ b/lib/rwsem.c
@@ -136,9 +136,10 @@ __rwsem_do_wake(struct rw_semaphore *sem, int downgrading)
136 out: 136 out:
137 return sem; 137 return sem;
138 138
139 /* undo the change to count, but check for a transition 1->0 */ 139 /* undo the change to the active count, but check for a transition
140 * 1->0 */
140 undo: 141 undo:
141 if (rwsem_atomic_update(-RWSEM_ACTIVE_BIAS, sem) != 0) 142 if (rwsem_atomic_update(-RWSEM_ACTIVE_BIAS, sem) & RWSEM_ACTIVE_MASK)
142 goto out; 143 goto out;
143 goto try_again; 144 goto try_again;
144} 145}