pnfsblock: clean up _add_entry
authorPeng Tao <bergwolf@gmail.com>
Thu, 12 Jan 2012 15:18:45 +0000 (23:18 +0800)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Thu, 12 Jan 2012 21:38:55 +0000 (16:38 -0500)
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 <peng_tao@emc.com>
Signed-off-by: Benny Halevy <bhalevy@tonian.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/blocklayout/extents.c

index c69682a..369ef53 100644 (file)
@@ -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);