From: Peng Tao Date: Thu, 12 Jan 2012 15:18:45 +0000 (+0800) Subject: pnfsblock: clean up _add_entry X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=57582b372f63d0f655b1a35b0d306d73d1a46775;p=linux-beck.git 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: Peng Tao Signed-off-by: Benny Halevy Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/blocklayout/extents.c b/fs/nfs/blocklayout/extents.c index c69682a4262a..369ef53e89e1 100644 --- a/fs/nfs/blocklayout/extents.c +++ b/fs/nfs/blocklayout/extents.c @@ -110,13 +110,7 @@ static int _add_entry(struct my_tree *tree, u64 s, int32_t tag, return 0; } else { struct pnfs_inval_tracking *new; - if (storage) - new = storage; - else { - new = kmalloc(sizeof(*new), GFP_NOFS); - if (!new) - return -ENOMEM; - } + new = storage; new->it_sector = s; new->it_tags = (1 << tag); list_add(&new->it_link, &pos->it_link);