Commit 57582b37 authored by Peng Tao's avatar Peng Tao Committed by Trond Myklebust

pnfsblock: clean up _add_entry

It is wrong to kmalloc in _add_entry() as it is inside
spinlock. memory should be already allocated _add_entry() is called.
Signed-off-by: default avatarPeng Tao <peng_tao@emc.com>
Signed-off-by: default avatarBenny Halevy <bhalevy@tonian.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 82b906d6
...@@ -110,13 +110,7 @@ static int _add_entry(struct my_tree *tree, u64 s, int32_t tag, ...@@ -110,13 +110,7 @@ static int _add_entry(struct my_tree *tree, u64 s, int32_t tag,
return 0; return 0;
} else { } else {
struct pnfs_inval_tracking *new; struct pnfs_inval_tracking *new;
if (storage) new = storage;
new = storage;
else {
new = kmalloc(sizeof(*new), GFP_NOFS);
if (!new)
return -ENOMEM;
}
new->it_sector = s; new->it_sector = s;
new->it_tags = (1 << tag); new->it_tags = (1 << tag);
list_add(&new->it_link, &pos->it_link); list_add(&new->it_link, &pos->it_link);
......
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