]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/reiserfs/fix_node.c
[ARM] 4907/1: [AT91] SAM9/CAP9 reset reason
[linux-2.6-omap-h63xx.git] / fs / reiserfs / fix_node.c
index 2706e2adffab2df85da09f8884f68f38d5b9a747..0ee35c6c9b722ef225e666f63713e4d92cf29be6 100644 (file)
@@ -34,7 +34,6 @@
  ** 
  **/
 
-#include <linux/config.h>
 #include <linux/time.h>
 #include <linux/string.h>
 #include <linux/reiserfs_fs.h>
@@ -191,9 +190,7 @@ static void create_virtual_node(struct tree_balance *tb, int h)
                                               "vs-8045: create_virtual_node: rdkey %k, affected item==%d (mode==%c) Must be %c",
                                               key, vn->vn_affected_item_num,
                                               vn->vn_mode, M_DELETE);
-                       } else
-                               /* we can delete directory item, that has only one directory entry in it */
-                               ;
+                       }
                }
 #endif
 
@@ -960,7 +957,7 @@ static int get_far_parent(struct tree_balance *p_s_tb,
 {
        struct buffer_head *p_s_parent;
        INITIALIZE_PATH(s_path_to_neighbor_father);
-       struct path *p_s_path = p_s_tb->tb_path;
+       struct treepath *p_s_path = p_s_tb->tb_path;
        struct cpu_key s_lr_father_key;
        int n_counter,
            n_position = INT_MAX,
@@ -1077,7 +1074,7 @@ static int get_far_parent(struct tree_balance *p_s_tb,
  */
 static int get_parents(struct tree_balance *p_s_tb, int n_h)
 {
-       struct path *p_s_path = p_s_tb->tb_path;
+       struct treepath *p_s_path = p_s_tb->tb_path;
        int n_position,
            n_ret_value,
            n_path_offset = PATH_H_PATH_OFFSET(p_s_tb->tb_path, n_h);
@@ -1888,7 +1885,7 @@ static int check_balance(int mode,
 static int get_direct_parent(struct tree_balance *p_s_tb, int n_h)
 {
        struct buffer_head *p_s_bh;
-       struct path *p_s_path = p_s_tb->tb_path;
+       struct treepath *p_s_path = p_s_tb->tb_path;
        int n_position,
            n_path_offset = PATH_H_PATH_OFFSET(p_s_tb->tb_path, n_h);
 
@@ -2021,38 +2018,6 @@ static int get_neighbors(struct tree_balance *p_s_tb, int n_h)
        return CARRY_ON;
 }
 
-#ifdef CONFIG_REISERFS_CHECK
-void *reiserfs_kmalloc(size_t size, int flags, struct super_block *s)
-{
-       void *vp;
-       static size_t malloced;
-
-       vp = kmalloc(size, flags);
-       if (vp) {
-               REISERFS_SB(s)->s_kmallocs += size;
-               if (REISERFS_SB(s)->s_kmallocs > malloced + 200000) {
-                       reiserfs_warning(s,
-                                        "vs-8301: reiserfs_kmalloc: allocated memory %d",
-                                        REISERFS_SB(s)->s_kmallocs);
-                       malloced = REISERFS_SB(s)->s_kmallocs;
-               }
-       }
-       return vp;
-}
-
-void reiserfs_kfree(const void *vp, size_t size, struct super_block *s)
-{
-       kfree(vp);
-
-       REISERFS_SB(s)->s_kmallocs -= size;
-       if (REISERFS_SB(s)->s_kmallocs < 0)
-               reiserfs_warning(s,
-                                "vs-8302: reiserfs_kfree: allocated memory %d",
-                                REISERFS_SB(s)->s_kmallocs);
-
-}
-#endif
-
 static int get_virtual_node_size(struct super_block *sb, struct buffer_head *bh)
 {
        int max_num_of_items;
@@ -2086,7 +2051,7 @@ static int get_mem_for_virtual_node(struct tree_balance *tb)
                /* we have to allocate more memory for virtual node */
                if (tb->vn_buf) {
                        /* free memory allocated before */
-                       reiserfs_kfree(tb->vn_buf, tb->vn_buf_size, tb->tb_sb);
+                       kfree(tb->vn_buf);
                        /* this is not needed if kfree is atomic */
                        check_fs = 1;
                }
@@ -2095,24 +2060,15 @@ static int get_mem_for_virtual_node(struct tree_balance *tb)
                tb->vn_buf_size = size;
 
                /* get memory for virtual item */
-               buf =
-                   reiserfs_kmalloc(size, GFP_ATOMIC | __GFP_NOWARN,
-                                    tb->tb_sb);
+               buf = kmalloc(size, GFP_ATOMIC | __GFP_NOWARN);
                if (!buf) {
                        /* getting memory with GFP_KERNEL priority may involve
                           balancing now (due to indirect_to_direct conversion on
                           dcache shrinking). So, release path and collected
                           resources here */
                        free_buffers_in_tb(tb);
-                       buf = reiserfs_kmalloc(size, GFP_NOFS, tb->tb_sb);
+                       buf = kmalloc(size, GFP_NOFS);
                        if (!buf) {
-#ifdef CONFIG_REISERFS_CHECK
-                               reiserfs_warning(tb->tb_sb,
-                                                "vs-8345: get_mem_for_virtual_node: "
-                                                "kmalloc failed. reiserfs kmalloced %d bytes",
-                                                REISERFS_SB(tb->tb_sb)->
-                                                s_kmallocs);
-#endif
                                tb->vn_buf_size = 0;
                        }
                        tb->vn_buf = buf;
@@ -2619,7 +2575,6 @@ void unfix_nodes(struct tree_balance *tb)
                }
        }
 
-       if (tb->vn_buf)
-               reiserfs_kfree(tb->vn_buf, tb->vn_buf_size, tb->tb_sb);
+       kfree(tb->vn_buf);
 
 }