Merge branch 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6

* 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6:
[XFS] fix nasty quota hashtable allocation bug
[XFS] fix sparse shadowed variable warnings
[XFS] fix ASSERT and ASSERT_ALWAYS
[XFS] Fix sparse warning in kmem_shake_allow
[XFS] Fix sparse NULL vs 0 warnings
[XFS] Set filestreams object timeout to something sane.

+26 -24
+1 -1
fs/xfs/linux-2.6/kmem.h
··· 103 103 static inline int 104 104 kmem_shake_allow(gfp_t gfp_mask) 105 105 { 106 - return (gfp_mask & __GFP_WAIT); 106 + return (gfp_mask & __GFP_WAIT) != 0; 107 107 } 108 108 109 109 #endif /* __XFS_SUPPORT_KMEM_H__ */
+4 -4
fs/xfs/linux-2.6/xfs_aops.c
··· 652 652 653 653 for (i = 0; i < pagevec_count(&pvec); i++) { 654 654 struct page *page = pvec.pages[i]; 655 - size_t pg_offset, len = 0; 655 + size_t pg_offset, pg_len = 0; 656 656 657 657 if (tindex == tlast) { 658 658 pg_offset = ··· 665 665 pg_offset = PAGE_CACHE_SIZE; 666 666 667 667 if (page->index == tindex && !TestSetPageLocked(page)) { 668 - len = xfs_probe_page(page, pg_offset, mapped); 668 + pg_len = xfs_probe_page(page, pg_offset, mapped); 669 669 unlock_page(page); 670 670 } 671 671 672 - if (!len) { 672 + if (!pg_len) { 673 673 done = 1; 674 674 break; 675 675 } 676 676 677 - total += len; 677 + total += pg_len; 678 678 tindex++; 679 679 } 680 680
+1 -1
fs/xfs/linux-2.6/xfs_globals.c
··· 46 46 .inherit_nosym = { 0, 0, 1 }, 47 47 .rotorstep = { 1, 1, 255 }, 48 48 .inherit_nodfrg = { 0, 1, 1 }, 49 - .fstrm_timer = { 1, 50, 3600*100}, 49 + .fstrm_timer = { 1, 30*100, 3600*100}, 50 50 }; 51 51 52 52 /*
+2 -1
fs/xfs/quota/xfs_qm.c
··· 120 120 * Initialize the dquot hash tables. 121 121 */ 122 122 udqhash = kmem_zalloc_greedy(&hsize, 123 - XFS_QM_HASHSIZE_LOW, XFS_QM_HASHSIZE_HIGH, 123 + XFS_QM_HASHSIZE_LOW * sizeof(xfs_dqhash_t), 124 + XFS_QM_HASHSIZE_HIGH * sizeof(xfs_dqhash_t), 124 125 KM_SLEEP | KM_MAYFAIL | KM_LARGE); 125 126 gdqhash = kmem_zalloc(hsize, KM_SLEEP | KM_LARGE); 126 127 hsize /= sizeof(xfs_dqhash_t);
+6 -4
fs/xfs/support/debug.h
··· 34 34 extern void assfail(char *expr, char *f, int l); 35 35 36 36 #define ASSERT_ALWAYS(expr) \ 37 - (unlikely((expr) != 0) ? (void)0 : assfail(#expr, __FILE__, __LINE__)) 37 + (unlikely(expr) ? (void)0 : assfail(#expr, __FILE__, __LINE__)) 38 38 39 39 #ifndef DEBUG 40 - # define ASSERT(expr) ((void)0) 40 + #define ASSERT(expr) ((void)0) 41 41 42 42 #ifndef STATIC 43 43 # define STATIC static noinline ··· 49 49 50 50 #else /* DEBUG */ 51 51 52 - # define ASSERT(expr) ASSERT_ALWAYS(expr) 53 - # include <linux/random.h> 52 + #include <linux/random.h> 53 + 54 + #define ASSERT(expr) \ 55 + (unlikely(expr) ? (void)0 : assfail(#expr, __FILE__, __LINE__)) 54 56 55 57 #ifndef STATIC 56 58 # define STATIC noinline
-1
fs/xfs/xfs_da_btree.c
··· 1975 1975 error = mappedbno == -2 ? 0 : XFS_ERROR(EFSCORRUPTED); 1976 1976 if (unlikely(error == EFSCORRUPTED)) { 1977 1977 if (xfs_error_level >= XFS_ERRLEVEL_LOW) { 1978 - int i; 1979 1978 cmn_err(CE_ALERT, "xfs_da_do_buf: bno %lld\n", 1980 1979 (long long)bno); 1981 1980 cmn_err(CE_ALERT, "dir: inode %lld\n",
+6 -6
fs/xfs/xfs_log.c
··· 2185 2185 } 2186 2186 cb = iclog->ic_callback; 2187 2187 2188 - while (cb != 0) { 2188 + while (cb) { 2189 2189 iclog->ic_callback_tail = &(iclog->ic_callback); 2190 2190 iclog->ic_callback = NULL; 2191 2191 LOG_UNLOCK(log, s); 2192 2192 2193 2193 /* perform callbacks in the order given */ 2194 - for (; cb != 0; cb = cb_next) { 2194 + for (; cb; cb = cb_next) { 2195 2195 cb_next = cb->cb_next; 2196 2196 cb->cb_func(cb->cb_arg, aborted); 2197 2197 } ··· 2202 2202 loopdidcallbacks++; 2203 2203 funcdidcallbacks++; 2204 2204 2205 - ASSERT(iclog->ic_callback == 0); 2205 + ASSERT(iclog->ic_callback == NULL); 2206 2206 if (!(iclog->ic_state & XLOG_STATE_IOERROR)) 2207 2207 iclog->ic_state = XLOG_STATE_DIRTY; 2208 2208 ··· 3242 3242 #else 3243 3243 /* When we debug, it is easier if tickets are cycled */ 3244 3244 ticket->t_next = NULL; 3245 - if (log->l_tail != 0) { 3245 + if (log->l_tail) { 3246 3246 log->l_tail->t_next = ticket; 3247 3247 } else { 3248 - ASSERT(log->l_freelist == 0); 3248 + ASSERT(log->l_freelist == NULL); 3249 3249 log->l_freelist = ticket; 3250 3250 } 3251 3251 log->l_tail = ticket; ··· 3463 3463 s = LOG_LOCK(log); 3464 3464 icptr = log->l_iclog; 3465 3465 for (i=0; i < log->l_iclog_bufs; i++) { 3466 - if (icptr == 0) 3466 + if (icptr == NULL) 3467 3467 xlog_panic("xlog_verify_iclog: invalid ptr"); 3468 3468 icptr = icptr->ic_next; 3469 3469 }
+6 -6
fs/xfs/xfs_log_recover.c
··· 1366 1366 int old_len; 1367 1367 1368 1368 item = trans->r_itemq; 1369 - if (item == 0) { 1369 + if (item == NULL) { 1370 1370 /* finish copying rest of trans header */ 1371 1371 xlog_recover_add_item(&trans->r_itemq); 1372 1372 ptr = (xfs_caddr_t) &trans->r_theader + ··· 1412 1412 if (!len) 1413 1413 return 0; 1414 1414 item = trans->r_itemq; 1415 - if (item == 0) { 1415 + if (item == NULL) { 1416 1416 ASSERT(*(uint *)dp == XFS_TRANS_HEADER_MAGIC); 1417 1417 if (len == sizeof(xfs_trans_header_t)) 1418 1418 xlog_recover_add_item(&trans->r_itemq); ··· 1467 1467 xlog_recover_t *tp; 1468 1468 int found = 0; 1469 1469 1470 - ASSERT(trans != 0); 1470 + ASSERT(trans != NULL); 1471 1471 if (trans == *q) { 1472 1472 *q = (*q)->r_next; 1473 1473 } else { 1474 1474 tp = *q; 1475 - while (tp != 0) { 1475 + while (tp) { 1476 1476 if (tp->r_next == trans) { 1477 1477 found = 1; 1478 1478 break; ··· 1495 1495 xlog_recover_item_t **q, 1496 1496 xlog_recover_item_t *item) 1497 1497 { 1498 - if (*q == 0) { 1498 + if (*q == NULL) { 1499 1499 item->ri_prev = item->ri_next = item; 1500 1500 *q = item; 1501 1501 } else { ··· 1899 1899 break; 1900 1900 nbits = xfs_contig_bits(data_map, map_size, bit); 1901 1901 ASSERT(nbits > 0); 1902 - ASSERT(item->ri_buf[i].i_addr != 0); 1902 + ASSERT(item->ri_buf[i].i_addr != NULL); 1903 1903 ASSERT(item->ri_buf[i].i_len % XFS_BLI_CHUNK == 0); 1904 1904 ASSERT(XFS_BUF_COUNT(bp) >= 1905 1905 ((uint)bit << XFS_BLI_SHIFT)+(nbits<<XFS_BLI_SHIFT));