linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / fs / reiserfs / prints.c
index bc808a9..d55e164 100644 (file)
@@ -2,6 +2,7 @@
  * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
  */
 
+#include <linux/config.h>
 #include <linux/time.h>
 #include <linux/fs.h>
 #include <linux/reiserfs_fs.h>
@@ -142,7 +143,7 @@ static void sprintf_buffer_head(char *buf, struct buffer_head *bh)
        char b[BDEVNAME_SIZE];
 
        sprintf(buf,
-               "dev %s, size %zd, blocknr %llu, count %d, state 0x%lx, page %p, (%s, %s, %s)",
+               "dev %s, size %d, blocknr %llu, count %d, state 0x%lx, page %p, (%s, %s, %s)",
                bdevname(bh->b_bdev, b), bh->b_size,
                (unsigned long long)bh->b_blocknr, atomic_read(&(bh->b_count)),
                bh->b_state, bh->b_page,
@@ -600,7 +601,8 @@ void store_print_tb(struct tree_balance *tb)
                tb->tb_mode, PATH_LAST_POSITION(tb->tb_path),
                tb->tb_path->pos_in_item);
 
-       for (h = 0; h < ARRAY_SIZE(tb->insert_size); h++) {
+       for (h = 0; h < sizeof(tb->insert_size) / sizeof(tb->insert_size[0]);
+            h++) {
                if (PATH_H_PATH_OFFSET(tb->tb_path, h) <=
                    tb->tb_path->path_length
                    && PATH_H_PATH_OFFSET(tb->tb_path,
@@ -656,13 +658,15 @@ void store_print_tb(struct tree_balance *tb)
 
        /* print FEB list (list of buffers in form (bh (b_blocknr, b_count), that will be used for new nodes) */
        h = 0;
-       for (i = 0; i < ARRAY_SIZE(tb->FEB); i++)
+       for (i = 0; i < sizeof(tb->FEB) / sizeof(tb->FEB[0]); i++)
                sprintf(print_tb_buf + strlen(print_tb_buf),
                        "%p (%llu %d)%s", tb->FEB[i],
                        tb->FEB[i] ? (unsigned long long)tb->FEB[i]->
                        b_blocknr : 0ULL,
                        tb->FEB[i] ? atomic_read(&(tb->FEB[i]->b_count)) : 0,
-                       (i == ARRAY_SIZE(tb->FEB) - 1) ? "\n" : ", ");
+                       (i ==
+                        sizeof(tb->FEB) / sizeof(tb->FEB[0]) -
+                        1) ? "\n" : ", ");
 
        sprintf(print_tb_buf + strlen(print_tb_buf),
                "======================== the end ====================================\n");