aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jbd
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-10-18 06:07:05 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-18 17:37:31 -0400
commitc80544dc0b87bb65038355e7aafdc30be16b26ab (patch)
tree176349304bec88a9de16e650c9919462e0dd453c /fs/jbd
parent0e9663ee452ffce0d429656ebbcfe69417a30e92 (diff)
sparse pointer use of zero as null
Get rid of sparse related warnings from places that use integer as NULL pointer. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Cc: Andi Kleen <ak@suse.de> Cc: Jeff Garzik <jeff@garzik.org> Cc: Matt Mackall <mpm@selenic.com> Cc: Ian Kent <raven@themaw.net> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Davide Libenzi <davidel@xmailserver.org> Cc: Stephen Smalley <sds@tycho.nsa.gov> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/jbd')
-rw-r--r--fs/jbd/journal.c9
-rw-r--r--fs/jbd/transaction.c12
2 files changed, 11 insertions, 10 deletions
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
index 65c290470664..5d9fec0b7ebd 100644
--- a/fs/jbd/journal.c
+++ b/fs/jbd/journal.c
@@ -217,7 +217,7 @@ static int journal_start_thread(journal_t *journal)
217 if (IS_ERR(t)) 217 if (IS_ERR(t))
218 return PTR_ERR(t); 218 return PTR_ERR(t);
219 219
220 wait_event(journal->j_wait_done_commit, journal->j_task != 0); 220 wait_event(journal->j_wait_done_commit, journal->j_task != NULL);
221 return 0; 221 return 0;
222} 222}
223 223
@@ -229,7 +229,8 @@ static void journal_kill_thread(journal_t *journal)
229 while (journal->j_task) { 229 while (journal->j_task) {
230 wake_up(&journal->j_wait_commit); 230 wake_up(&journal->j_wait_commit);
231 spin_unlock(&journal->j_state_lock); 231 spin_unlock(&journal->j_state_lock);
232 wait_event(journal->j_wait_done_commit, journal->j_task == 0); 232 wait_event(journal->j_wait_done_commit,
233 journal->j_task == NULL);
233 spin_lock(&journal->j_state_lock); 234 spin_lock(&journal->j_state_lock);
234 } 235 }
235 spin_unlock(&journal->j_state_lock); 236 spin_unlock(&journal->j_state_lock);
@@ -1651,14 +1652,14 @@ static struct journal_head *journal_alloc_journal_head(void)
1651 atomic_inc(&nr_journal_heads); 1652 atomic_inc(&nr_journal_heads);
1652#endif 1653#endif
1653 ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS); 1654 ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);
1654 if (ret == 0) { 1655 if (ret == NULL) {
1655 jbd_debug(1, "out of memory for journal_head\n"); 1656 jbd_debug(1, "out of memory for journal_head\n");
1656 if (time_after(jiffies, last_warning + 5*HZ)) { 1657 if (time_after(jiffies, last_warning + 5*HZ)) {
1657 printk(KERN_NOTICE "ENOMEM in %s, retrying.\n", 1658 printk(KERN_NOTICE "ENOMEM in %s, retrying.\n",
1658 __FUNCTION__); 1659 __FUNCTION__);
1659 last_warning = jiffies; 1660 last_warning = jiffies;
1660 } 1661 }
1661 while (ret == 0) { 1662 while (ret == NULL) {
1662 yield(); 1663 yield();
1663 ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS); 1664 ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);
1664 } 1665 }
diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c
index 0282deb8ff2d..9841b1e5af03 100644
--- a/fs/jbd/transaction.c
+++ b/fs/jbd/transaction.c
@@ -1172,7 +1172,7 @@ int journal_dirty_metadata(handle_t *handle, struct buffer_head *bh)
1172 } 1172 }
1173 1173
1174 /* That test should have eliminated the following case: */ 1174 /* That test should have eliminated the following case: */
1175 J_ASSERT_JH(jh, jh->b_frozen_data == 0); 1175 J_ASSERT_JH(jh, jh->b_frozen_data == NULL);
1176 1176
1177 JBUFFER_TRACE(jh, "file as BJ_Metadata"); 1177 JBUFFER_TRACE(jh, "file as BJ_Metadata");
1178 spin_lock(&journal->j_list_lock); 1178 spin_lock(&journal->j_list_lock);
@@ -1522,7 +1522,7 @@ static void __journal_temp_unlink_buffer(struct journal_head *jh)
1522 1522
1523 J_ASSERT_JH(jh, jh->b_jlist < BJ_Types); 1523 J_ASSERT_JH(jh, jh->b_jlist < BJ_Types);
1524 if (jh->b_jlist != BJ_None) 1524 if (jh->b_jlist != BJ_None)
1525 J_ASSERT_JH(jh, transaction != 0); 1525 J_ASSERT_JH(jh, transaction != NULL);
1526 1526
1527 switch (jh->b_jlist) { 1527 switch (jh->b_jlist) {
1528 case BJ_None: 1528 case BJ_None:
@@ -1591,11 +1591,11 @@ __journal_try_to_free_buffer(journal_t *journal, struct buffer_head *bh)
1591 if (buffer_locked(bh) || buffer_dirty(bh)) 1591 if (buffer_locked(bh) || buffer_dirty(bh))
1592 goto out; 1592 goto out;
1593 1593
1594 if (jh->b_next_transaction != 0) 1594 if (jh->b_next_transaction != NULL)
1595 goto out; 1595 goto out;
1596 1596
1597 spin_lock(&journal->j_list_lock); 1597 spin_lock(&journal->j_list_lock);
1598 if (jh->b_transaction != 0 && jh->b_cp_transaction == 0) { 1598 if (jh->b_transaction != NULL && jh->b_cp_transaction == NULL) {
1599 if (jh->b_jlist == BJ_SyncData || jh->b_jlist == BJ_Locked) { 1599 if (jh->b_jlist == BJ_SyncData || jh->b_jlist == BJ_Locked) {
1600 /* A written-back ordered data buffer */ 1600 /* A written-back ordered data buffer */
1601 JBUFFER_TRACE(jh, "release data"); 1601 JBUFFER_TRACE(jh, "release data");
@@ -1603,7 +1603,7 @@ __journal_try_to_free_buffer(journal_t *journal, struct buffer_head *bh)
1603 journal_remove_journal_head(bh); 1603 journal_remove_journal_head(bh);
1604 __brelse(bh); 1604 __brelse(bh);
1605 } 1605 }
1606 } else if (jh->b_cp_transaction != 0 && jh->b_transaction == 0) { 1606 } else if (jh->b_cp_transaction != NULL && jh->b_transaction == NULL) {
1607 /* written-back checkpointed metadata buffer */ 1607 /* written-back checkpointed metadata buffer */
1608 if (jh->b_jlist == BJ_None) { 1608 if (jh->b_jlist == BJ_None) {
1609 JBUFFER_TRACE(jh, "remove from checkpoint list"); 1609 JBUFFER_TRACE(jh, "remove from checkpoint list");
@@ -1963,7 +1963,7 @@ void __journal_file_buffer(struct journal_head *jh,
1963 1963
1964 J_ASSERT_JH(jh, jh->b_jlist < BJ_Types); 1964 J_ASSERT_JH(jh, jh->b_jlist < BJ_Types);
1965 J_ASSERT_JH(jh, jh->b_transaction == transaction || 1965 J_ASSERT_JH(jh, jh->b_transaction == transaction ||
1966 jh->b_transaction == 0); 1966 jh->b_transaction == NULL);
1967 1967
1968 if (jh->b_transaction && jh->b_jlist == jlist) 1968 if (jh->b_transaction && jh->b_jlist == jlist)
1969 return; 1969 return;