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