Commit d739b42b authored by Pekka Enberg's avatar Pekka Enberg Committed by Linus Torvalds

[PATCH] reiserfs: remove kmalloc wrapper

Remove kmalloc() wrapper from fs/reiserfs/.  Please note that a reiserfs
/proc entry format is changed because kmalloc statistics is removed.
Signed-off-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent d19720a9
...@@ -150,18 +150,15 @@ static int reiserfs_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -150,18 +150,15 @@ static int reiserfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
if (d_reclen <= 32) { if (d_reclen <= 32) {
local_buf = small_buf; local_buf = small_buf;
} else { } else {
local_buf = local_buf = kmalloc(d_reclen,
reiserfs_kmalloc(d_reclen, GFP_NOFS, GFP_NOFS);
inode->i_sb);
if (!local_buf) { if (!local_buf) {
pathrelse(&path_to_entry); pathrelse(&path_to_entry);
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
} }
if (item_moved(&tmp_ih, &path_to_entry)) { if (item_moved(&tmp_ih, &path_to_entry)) {
reiserfs_kfree(local_buf, kfree(local_buf);
d_reclen,
inode->i_sb);
goto research; goto research;
} }
} }
...@@ -174,15 +171,12 @@ static int reiserfs_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -174,15 +171,12 @@ static int reiserfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
(dirent, local_buf, d_reclen, d_off, d_ino, (dirent, local_buf, d_reclen, d_off, d_ino,
DT_UNKNOWN) < 0) { DT_UNKNOWN) < 0) {
if (local_buf != small_buf) { if (local_buf != small_buf) {
reiserfs_kfree(local_buf, kfree(local_buf);
d_reclen,
inode->i_sb);
} }
goto end; goto end;
} }
if (local_buf != small_buf) { if (local_buf != small_buf) {
reiserfs_kfree(local_buf, d_reclen, kfree(local_buf);
inode->i_sb);
} }
// next entry should be looked for with such offset // next entry should be looked for with such offset
next_pos = deh_offset(deh) + 1; next_pos = deh_offset(deh) + 1;
......
...@@ -2021,38 +2021,6 @@ static int get_neighbors(struct tree_balance *p_s_tb, int n_h) ...@@ -2021,38 +2021,6 @@ static int get_neighbors(struct tree_balance *p_s_tb, int n_h)
return CARRY_ON; return CARRY_ON;
} }
#ifdef CONFIG_REISERFS_CHECK
void *reiserfs_kmalloc(size_t size, gfp_t 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) static int get_virtual_node_size(struct super_block *sb, struct buffer_head *bh)
{ {
int max_num_of_items; int max_num_of_items;
...@@ -2086,7 +2054,7 @@ static int get_mem_for_virtual_node(struct tree_balance *tb) ...@@ -2086,7 +2054,7 @@ static int get_mem_for_virtual_node(struct tree_balance *tb)
/* we have to allocate more memory for virtual node */ /* we have to allocate more memory for virtual node */
if (tb->vn_buf) { if (tb->vn_buf) {
/* free memory allocated before */ /* 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 */ /* this is not needed if kfree is atomic */
check_fs = 1; check_fs = 1;
} }
...@@ -2095,24 +2063,15 @@ static int get_mem_for_virtual_node(struct tree_balance *tb) ...@@ -2095,24 +2063,15 @@ static int get_mem_for_virtual_node(struct tree_balance *tb)
tb->vn_buf_size = size; tb->vn_buf_size = size;
/* get memory for virtual item */ /* get memory for virtual item */
buf = buf = kmalloc(size, GFP_ATOMIC | __GFP_NOWARN);
reiserfs_kmalloc(size, GFP_ATOMIC | __GFP_NOWARN,
tb->tb_sb);
if (!buf) { if (!buf) {
/* getting memory with GFP_KERNEL priority may involve /* getting memory with GFP_KERNEL priority may involve
balancing now (due to indirect_to_direct conversion on balancing now (due to indirect_to_direct conversion on
dcache shrinking). So, release path and collected dcache shrinking). So, release path and collected
resources here */ resources here */
free_buffers_in_tb(tb); free_buffers_in_tb(tb);
buf = reiserfs_kmalloc(size, GFP_NOFS, tb->tb_sb); buf = kmalloc(size, GFP_NOFS);
if (!buf) { 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_size = 0;
} }
tb->vn_buf = buf; tb->vn_buf = buf;
...@@ -2619,7 +2578,6 @@ void unfix_nodes(struct tree_balance *tb) ...@@ -2619,7 +2578,6 @@ void unfix_nodes(struct tree_balance *tb)
} }
} }
if (tb->vn_buf) kfree(tb->vn_buf);
reiserfs_kfree(tb->vn_buf, tb->vn_buf_size, tb->tb_sb);
} }
...@@ -152,18 +152,16 @@ static struct reiserfs_bitmap_node *allocate_bitmap_node(struct super_block ...@@ -152,18 +152,16 @@ static struct reiserfs_bitmap_node *allocate_bitmap_node(struct super_block
struct reiserfs_bitmap_node *bn; struct reiserfs_bitmap_node *bn;
static int id; static int id;
bn = reiserfs_kmalloc(sizeof(struct reiserfs_bitmap_node), GFP_NOFS, bn = kmalloc(sizeof(struct reiserfs_bitmap_node), GFP_NOFS);
p_s_sb);
if (!bn) { if (!bn) {
return NULL; return NULL;
} }
bn->data = reiserfs_kmalloc(p_s_sb->s_blocksize, GFP_NOFS, p_s_sb); bn->data = kzalloc(p_s_sb->s_blocksize, GFP_NOFS);
if (!bn->data) { if (!bn->data) {
reiserfs_kfree(bn, sizeof(struct reiserfs_bitmap_node), p_s_sb); kfree(bn);
return NULL; return NULL;
} }
bn->id = id++; bn->id = id++;
memset(bn->data, 0, p_s_sb->s_blocksize);
INIT_LIST_HEAD(&bn->list); INIT_LIST_HEAD(&bn->list);
return bn; return bn;
} }
...@@ -197,8 +195,8 @@ static inline void free_bitmap_node(struct super_block *p_s_sb, ...@@ -197,8 +195,8 @@ static inline void free_bitmap_node(struct super_block *p_s_sb,
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb);
journal->j_used_bitmap_nodes--; journal->j_used_bitmap_nodes--;
if (journal->j_free_bitmap_nodes > REISERFS_MAX_BITMAP_NODES) { if (journal->j_free_bitmap_nodes > REISERFS_MAX_BITMAP_NODES) {
reiserfs_kfree(bn->data, p_s_sb->s_blocksize, p_s_sb); kfree(bn->data);
reiserfs_kfree(bn, sizeof(struct reiserfs_bitmap_node), p_s_sb); kfree(bn);
} else { } else {
list_add(&bn->list, &journal->j_bitmap_nodes); list_add(&bn->list, &journal->j_bitmap_nodes);
journal->j_free_bitmap_nodes++; journal->j_free_bitmap_nodes++;
...@@ -276,8 +274,8 @@ static int free_bitmap_nodes(struct super_block *p_s_sb) ...@@ -276,8 +274,8 @@ static int free_bitmap_nodes(struct super_block *p_s_sb)
while (next != &journal->j_bitmap_nodes) { while (next != &journal->j_bitmap_nodes) {
bn = list_entry(next, struct reiserfs_bitmap_node, list); bn = list_entry(next, struct reiserfs_bitmap_node, list);
list_del(next); list_del(next);
reiserfs_kfree(bn->data, p_s_sb->s_blocksize, p_s_sb); kfree(bn->data);
reiserfs_kfree(bn, sizeof(struct reiserfs_bitmap_node), p_s_sb); kfree(bn);
next = journal->j_bitmap_nodes.next; next = journal->j_bitmap_nodes.next;
journal->j_free_bitmap_nodes--; journal->j_free_bitmap_nodes--;
} }
...@@ -581,7 +579,7 @@ static inline void put_journal_list(struct super_block *s, ...@@ -581,7 +579,7 @@ static inline void put_journal_list(struct super_block *s,
jl->j_trans_id, jl->j_refcount); jl->j_trans_id, jl->j_refcount);
} }
if (--jl->j_refcount == 0) if (--jl->j_refcount == 0)
reiserfs_kfree(jl, sizeof(struct reiserfs_journal_list), s); kfree(jl);
} }
/* /*
...@@ -1818,8 +1816,7 @@ void remove_journal_hash(struct super_block *sb, ...@@ -1818,8 +1816,7 @@ void remove_journal_hash(struct super_block *sb,
static void free_journal_ram(struct super_block *p_s_sb) static void free_journal_ram(struct super_block *p_s_sb)
{ {
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb);
reiserfs_kfree(journal->j_current_jl, kfree(journal->j_current_jl);
sizeof(struct reiserfs_journal_list), p_s_sb);
journal->j_num_lists--; journal->j_num_lists--;
vfree(journal->j_cnode_free_orig); vfree(journal->j_cnode_free_orig);
...@@ -2093,21 +2090,15 @@ static int journal_read_transaction(struct super_block *p_s_sb, ...@@ -2093,21 +2090,15 @@ static int journal_read_transaction(struct super_block *p_s_sb,
} }
trans_id = get_desc_trans_id(desc); trans_id = get_desc_trans_id(desc);
/* now we know we've got a good transaction, and it was inside the valid time ranges */ /* now we know we've got a good transaction, and it was inside the valid time ranges */
log_blocks = log_blocks = kmalloc(get_desc_trans_len(desc) *
reiserfs_kmalloc(get_desc_trans_len(desc) * sizeof(struct buffer_head *), GFP_NOFS);
sizeof(struct buffer_head *), GFP_NOFS, p_s_sb); real_blocks = kmalloc(get_desc_trans_len(desc) *
real_blocks = sizeof(struct buffer_head *), GFP_NOFS);
reiserfs_kmalloc(get_desc_trans_len(desc) *
sizeof(struct buffer_head *), GFP_NOFS, p_s_sb);
if (!log_blocks || !real_blocks) { if (!log_blocks || !real_blocks) {
brelse(c_bh); brelse(c_bh);
brelse(d_bh); brelse(d_bh);
reiserfs_kfree(log_blocks, kfree(log_blocks);
get_desc_trans_len(desc) * kfree(real_blocks);
sizeof(struct buffer_head *), p_s_sb);
reiserfs_kfree(real_blocks,
get_desc_trans_len(desc) *
sizeof(struct buffer_head *), p_s_sb);
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb,
"journal-1169: kmalloc failed, unable to mount FS"); "journal-1169: kmalloc failed, unable to mount FS");
return -1; return -1;
...@@ -2145,12 +2136,8 @@ static int journal_read_transaction(struct super_block *p_s_sb, ...@@ -2145,12 +2136,8 @@ static int journal_read_transaction(struct super_block *p_s_sb,
brelse_array(real_blocks, i); brelse_array(real_blocks, i);
brelse(c_bh); brelse(c_bh);
brelse(d_bh); brelse(d_bh);
reiserfs_kfree(log_blocks, kfree(log_blocks);
get_desc_trans_len(desc) * kfree(real_blocks);
sizeof(struct buffer_head *), p_s_sb);
reiserfs_kfree(real_blocks,
get_desc_trans_len(desc) *
sizeof(struct buffer_head *), p_s_sb);
return -1; return -1;
} }
} }
...@@ -2166,12 +2153,8 @@ static int journal_read_transaction(struct super_block *p_s_sb, ...@@ -2166,12 +2153,8 @@ static int journal_read_transaction(struct super_block *p_s_sb,
brelse_array(real_blocks, get_desc_trans_len(desc)); brelse_array(real_blocks, get_desc_trans_len(desc));
brelse(c_bh); brelse(c_bh);
brelse(d_bh); brelse(d_bh);
reiserfs_kfree(log_blocks, kfree(log_blocks);
get_desc_trans_len(desc) * kfree(real_blocks);
sizeof(struct buffer_head *), p_s_sb);
reiserfs_kfree(real_blocks,
get_desc_trans_len(desc) *
sizeof(struct buffer_head *), p_s_sb);
return -1; return -1;
} }
memcpy(real_blocks[i]->b_data, log_blocks[i]->b_data, memcpy(real_blocks[i]->b_data, log_blocks[i]->b_data,
...@@ -2193,12 +2176,8 @@ static int journal_read_transaction(struct super_block *p_s_sb, ...@@ -2193,12 +2176,8 @@ static int journal_read_transaction(struct super_block *p_s_sb,
get_desc_trans_len(desc) - i); get_desc_trans_len(desc) - i);
brelse(c_bh); brelse(c_bh);
brelse(d_bh); brelse(d_bh);
reiserfs_kfree(log_blocks, kfree(log_blocks);
get_desc_trans_len(desc) * kfree(real_blocks);
sizeof(struct buffer_head *), p_s_sb);
reiserfs_kfree(real_blocks,
get_desc_trans_len(desc) *
sizeof(struct buffer_head *), p_s_sb);
return -1; return -1;
} }
brelse(real_blocks[i]); brelse(real_blocks[i]);
...@@ -2217,12 +2196,8 @@ static int journal_read_transaction(struct super_block *p_s_sb, ...@@ -2217,12 +2196,8 @@ static int journal_read_transaction(struct super_block *p_s_sb,
journal->j_trans_id = trans_id + 1; journal->j_trans_id = trans_id + 1;
brelse(c_bh); brelse(c_bh);
brelse(d_bh); brelse(d_bh);
reiserfs_kfree(log_blocks, kfree(log_blocks);
le32_to_cpu(desc->j_len) * sizeof(struct buffer_head *), kfree(real_blocks);
p_s_sb);
reiserfs_kfree(real_blocks,
le32_to_cpu(desc->j_len) * sizeof(struct buffer_head *),
p_s_sb);
return 0; return 0;
} }
...@@ -2472,13 +2447,11 @@ static struct reiserfs_journal_list *alloc_journal_list(struct super_block *s) ...@@ -2472,13 +2447,11 @@ static struct reiserfs_journal_list *alloc_journal_list(struct super_block *s)
{ {
struct reiserfs_journal_list *jl; struct reiserfs_journal_list *jl;
retry: retry:
jl = reiserfs_kmalloc(sizeof(struct reiserfs_journal_list), GFP_NOFS, jl = kzalloc(sizeof(struct reiserfs_journal_list), GFP_NOFS);
s);
if (!jl) { if (!jl) {
yield(); yield();
goto retry; goto retry;
} }
memset(jl, 0, sizeof(*jl));
INIT_LIST_HEAD(&jl->j_list); INIT_LIST_HEAD(&jl->j_list);
INIT_LIST_HEAD(&jl->j_working_list); INIT_LIST_HEAD(&jl->j_working_list);
INIT_LIST_HEAD(&jl->j_tail_bh_list); INIT_LIST_HEAD(&jl->j_tail_bh_list);
...@@ -3042,14 +3015,12 @@ struct reiserfs_transaction_handle *reiserfs_persistent_transaction(struct ...@@ -3042,14 +3015,12 @@ struct reiserfs_transaction_handle *reiserfs_persistent_transaction(struct
} }
return th; return th;
} }
th = reiserfs_kmalloc(sizeof(struct reiserfs_transaction_handle), th = kmalloc(sizeof(struct reiserfs_transaction_handle), GFP_NOFS);
GFP_NOFS, s);
if (!th) if (!th)
return NULL; return NULL;
ret = journal_begin(th, s, nblocks); ret = journal_begin(th, s, nblocks);
if (ret) { if (ret) {
reiserfs_kfree(th, sizeof(struct reiserfs_transaction_handle), kfree(th);
s);
return NULL; return NULL;
} }
...@@ -3067,8 +3038,7 @@ int reiserfs_end_persistent_transaction(struct reiserfs_transaction_handle *th) ...@@ -3067,8 +3038,7 @@ int reiserfs_end_persistent_transaction(struct reiserfs_transaction_handle *th)
ret = -EIO; ret = -EIO;
if (th->t_refcount == 0) { if (th->t_refcount == 0) {
SB_JOURNAL(s)->j_persistent_trans--; SB_JOURNAL(s)->j_persistent_trans--;
reiserfs_kfree(th, sizeof(struct reiserfs_transaction_handle), kfree(th);
s);
} }
return ret; return ret;
} }
......
...@@ -456,7 +456,7 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th, ...@@ -456,7 +456,7 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th,
/* get memory for composing the entry */ /* get memory for composing the entry */
buflen = DEH_SIZE + ROUND_UP(namelen); buflen = DEH_SIZE + ROUND_UP(namelen);
if (buflen > sizeof(small_buf)) { if (buflen > sizeof(small_buf)) {
buffer = reiserfs_kmalloc(buflen, GFP_NOFS, dir->i_sb); buffer = kmalloc(buflen, GFP_NOFS);
if (buffer == 0) if (buffer == 0)
return -ENOMEM; return -ENOMEM;
} else } else
...@@ -490,7 +490,7 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th, ...@@ -490,7 +490,7 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th,
retval = reiserfs_find_entry(dir, name, namelen, &path, &de); retval = reiserfs_find_entry(dir, name, namelen, &path, &de);
if (retval != NAME_NOT_FOUND) { if (retval != NAME_NOT_FOUND) {
if (buffer != small_buf) if (buffer != small_buf)
reiserfs_kfree(buffer, buflen, dir->i_sb); kfree(buffer);
pathrelse(&path); pathrelse(&path);
if (retval == IO_ERROR) { if (retval == IO_ERROR) {
...@@ -515,7 +515,7 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th, ...@@ -515,7 +515,7 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th,
reiserfs_warning(dir->i_sb, reiserfs_warning(dir->i_sb,
"reiserfs_add_entry: Congratulations! we have got hash function screwed up"); "reiserfs_add_entry: Congratulations! we have got hash function screwed up");
if (buffer != small_buf) if (buffer != small_buf)
reiserfs_kfree(buffer, buflen, dir->i_sb); kfree(buffer);
pathrelse(&path); pathrelse(&path);
return -EBUSY; return -EBUSY;
} }
...@@ -535,7 +535,7 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th, ...@@ -535,7 +535,7 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th,
&entry_key); &entry_key);
if (buffer != small_buf) if (buffer != small_buf)
reiserfs_kfree(buffer, buflen, dir->i_sb); kfree(buffer);
pathrelse(&path); pathrelse(&path);
return -EBUSY; return -EBUSY;
} }
...@@ -546,7 +546,7 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th, ...@@ -546,7 +546,7 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th,
reiserfs_paste_into_item(th, &path, &entry_key, dir, buffer, reiserfs_paste_into_item(th, &path, &entry_key, dir, buffer,
paste_size); paste_size);
if (buffer != small_buf) if (buffer != small_buf)
reiserfs_kfree(buffer, buflen, dir->i_sb); kfree(buffer);
if (retval) { if (retval) {
reiserfs_check_path(&path); reiserfs_check_path(&path);
return retval; return retval;
...@@ -1065,7 +1065,7 @@ static int reiserfs_symlink(struct inode *parent_dir, ...@@ -1065,7 +1065,7 @@ static int reiserfs_symlink(struct inode *parent_dir,
goto out_failed; goto out_failed;
} }
name = reiserfs_kmalloc(item_len, GFP_NOFS, parent_dir->i_sb); name = kmalloc(item_len, GFP_NOFS);
if (!name) { if (!name) {
drop_new_inode(inode); drop_new_inode(inode);
retval = -ENOMEM; retval = -ENOMEM;
...@@ -1079,14 +1079,14 @@ static int reiserfs_symlink(struct inode *parent_dir, ...@@ -1079,14 +1079,14 @@ static int reiserfs_symlink(struct inode *parent_dir,
retval = journal_begin(&th, parent_dir->i_sb, jbegin_count); retval = journal_begin(&th, parent_dir->i_sb, jbegin_count);
if (retval) { if (retval) {
drop_new_inode(inode); drop_new_inode(inode);
reiserfs_kfree(name, item_len, parent_dir->i_sb); kfree(name);
goto out_failed; goto out_failed;
} }
retval = retval =
reiserfs_new_inode(&th, parent_dir, mode, name, strlen(symname), reiserfs_new_inode(&th, parent_dir, mode, name, strlen(symname),
dentry, inode); dentry, inode);
reiserfs_kfree(name, item_len, parent_dir->i_sb); kfree(name);
if (retval) { /* reiserfs_new_inode iputs for us */ if (retval) { /* reiserfs_new_inode iputs for us */
goto out_failed; goto out_failed;
} }
......
...@@ -88,7 +88,6 @@ static int show_super(struct seq_file *m, struct super_block *sb) ...@@ -88,7 +88,6 @@ static int show_super(struct seq_file *m, struct super_block *sb)
seq_printf(m, "state: \t%s\n" seq_printf(m, "state: \t%s\n"
"mount options: \t%s%s%s%s%s%s%s%s%s%s%s\n" "mount options: \t%s%s%s%s%s%s%s%s%s%s%s\n"
"gen. counter: \t%i\n" "gen. counter: \t%i\n"
"s_kmallocs: \t%i\n"
"s_disk_reads: \t%i\n" "s_disk_reads: \t%i\n"
"s_disk_writes: \t%i\n" "s_disk_writes: \t%i\n"
"s_fix_nodes: \t%i\n" "s_fix_nodes: \t%i\n"
...@@ -128,7 +127,7 @@ static int show_super(struct seq_file *m, struct super_block *sb) ...@@ -128,7 +127,7 @@ static int show_super(struct seq_file *m, struct super_block *sb)
"SMALL_TAILS " : "NO_TAILS ", "SMALL_TAILS " : "NO_TAILS ",
replay_only(sb) ? "REPLAY_ONLY " : "", replay_only(sb) ? "REPLAY_ONLY " : "",
convert_reiserfs(sb) ? "CONV " : "", convert_reiserfs(sb) ? "CONV " : "",
atomic_read(&r->s_generation_counter), SF(s_kmallocs), atomic_read(&r->s_generation_counter),
SF(s_disk_reads), SF(s_disk_writes), SF(s_fix_nodes), SF(s_disk_reads), SF(s_disk_writes), SF(s_fix_nodes),
SF(s_do_balance), SF(s_unneeded_left_neighbor), SF(s_do_balance), SF(s_unneeded_left_neighbor),
SF(s_good_search_by_key_reada), SF(s_bmaps), SF(s_good_search_by_key_reada), SF(s_bmaps),
......
...@@ -472,12 +472,6 @@ static void reiserfs_put_super(struct super_block *s) ...@@ -472,12 +472,6 @@ static void reiserfs_put_super(struct super_block *s)
print_statistics(s); print_statistics(s);
if (REISERFS_SB(s)->s_kmallocs != 0) {
reiserfs_warning(s,
"vs-2004: reiserfs_put_super: allocated memory left %d",
REISERFS_SB(s)->s_kmallocs);
}
if (REISERFS_SB(s)->reserved_blocks != 0) { if (REISERFS_SB(s)->reserved_blocks != 0) {
reiserfs_warning(s, reiserfs_warning(s,
"green-2005: reiserfs_put_super: reserved blocks left %d", "green-2005: reiserfs_put_super: reserved blocks left %d",
......
...@@ -368,15 +368,13 @@ static int __xattr_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -368,15 +368,13 @@ static int __xattr_readdir(struct file *filp, void *dirent, filldir_t filldir)
if (d_reclen <= 32) { if (d_reclen <= 32) {
local_buf = small_buf; local_buf = small_buf;
} else { } else {
local_buf = local_buf = kmalloc(d_reclen, GFP_NOFS);
reiserfs_kmalloc(d_reclen, GFP_NOFS, inode->i_sb);
if (!local_buf) { if (!local_buf) {
pathrelse(&path_to_entry); pathrelse(&path_to_entry);
return -ENOMEM; return -ENOMEM;
} }
if (item_moved(&tmp_ih, &path_to_entry)) { if (item_moved(&tmp_ih, &path_to_entry)) {
reiserfs_kfree(local_buf, d_reclen, kfree(local_buf);
inode->i_sb);
/* sigh, must retry. Do this same offset again */ /* sigh, must retry. Do this same offset again */
next_pos = d_off; next_pos = d_off;
...@@ -399,13 +397,12 @@ static int __xattr_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -399,13 +397,12 @@ static int __xattr_readdir(struct file *filp, void *dirent, filldir_t filldir)
if (filldir(dirent, local_buf, d_reclen, d_off, d_ino, if (filldir(dirent, local_buf, d_reclen, d_off, d_ino,
DT_UNKNOWN) < 0) { DT_UNKNOWN) < 0) {
if (local_buf != small_buf) { if (local_buf != small_buf) {
reiserfs_kfree(local_buf, d_reclen, kfree(local_buf);
inode->i_sb);
} }
goto end; goto end;
} }
if (local_buf != small_buf) { if (local_buf != small_buf) {
reiserfs_kfree(local_buf, d_reclen, inode->i_sb); kfree(local_buf);
} }
} /* while */ } /* while */
......
...@@ -1971,22 +1971,6 @@ extern struct file_operations reiserfs_file_operations; ...@@ -1971,22 +1971,6 @@ extern struct file_operations reiserfs_file_operations;
extern struct address_space_operations reiserfs_address_space_operations; extern struct address_space_operations reiserfs_address_space_operations;
/* fix_nodes.c */ /* fix_nodes.c */
#ifdef CONFIG_REISERFS_CHECK
void *reiserfs_kmalloc(size_t size, gfp_t flags, struct super_block *s);
void reiserfs_kfree(const void *vp, size_t size, struct super_block *s);
#else
static inline void *reiserfs_kmalloc(size_t size, int flags,
struct super_block *s)
{
return kmalloc(size, flags);
}
static inline void reiserfs_kfree(const void *vp, size_t size,
struct super_block *s)
{
kfree(vp);
}
#endif
int fix_nodes(int n_op_mode, struct tree_balance *p_s_tb, int fix_nodes(int n_op_mode, struct tree_balance *p_s_tb,
struct item_head *p_s_ins_ih, const void *); struct item_head *p_s_ins_ih, const void *);
......
...@@ -382,7 +382,6 @@ struct reiserfs_sb_info { ...@@ -382,7 +382,6 @@ struct reiserfs_sb_info {
on-disk FS format */ on-disk FS format */
/* session statistics */ /* session statistics */
int s_kmallocs;
int s_disk_reads; int s_disk_reads;
int s_disk_writes; int s_disk_writes;
int s_fix_nodes; int s_fix_nodes;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment