diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-05 09:52:46 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-05 09:52:46 -0800 |
commit | 488823f114a3cef58e7eb932cac977440a2a59cb (patch) | |
tree | f6cb0840c927ba0234949b8f8728600a474cb1b2 /drivers/infiniband/core/fmr_pool.c | |
parent | 827b3f6abc21246928e38480bb308936701a2ad4 (diff) | |
parent | 3c2d774cad5bf4fad576363da77870e9e6530b7a (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
RDMA/nes: Add a driver for NetEffect RNICs
IB/mthca: Return proper error codes from mthca_fmr_alloc()
IB: Avoid marking __devinitdata as const
IB/mlx4: Actually print out the driver version
IB/ib_mthca: Pre-link receive WQEs in Tavor mode
IB/mthca: Remove checks for srq->first_free < 0
IB/fmr_pool: Allocate page list for pool FMRs only when caching enabled
IB/srp: Retry stale connections
mlx4_core: Don't read reserved fields in mlx4_QUERY_ADAPTER()
IB/mthca: Don't read reserved fields in mthca_QUERY_ADAPTER()
IPoIB: Remove a misleading debug print
IPoIB: Handle bonding failover race for connected neighbours too
IB/mthca: Fix and simplify page size calculation in mthca_reg_phys_mr()
IB/ehca: Add PMA support
IB/ehca: Update sma_attr also in case of disruptive config change
IB/ehca: Prevent sending UD packets to QP0
IB/cm: Add interim support for routed paths
mlx4_core: Fix more section mismatches
Diffstat (limited to 'drivers/infiniband/core/fmr_pool.c')
-rw-r--r-- | drivers/infiniband/core/fmr_pool.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/infiniband/core/fmr_pool.c b/drivers/infiniband/core/fmr_pool.c index 6c7aa59794d..7f00347364f 100644 --- a/drivers/infiniband/core/fmr_pool.c +++ b/drivers/infiniband/core/fmr_pool.c @@ -320,10 +320,13 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd, .max_maps = pool->max_remaps, .page_shift = params->page_shift }; + int bytes_per_fmr = sizeof *fmr; + + if (pool->cache_bucket) + bytes_per_fmr += params->max_pages_per_fmr * sizeof (u64); for (i = 0; i < params->pool_size; ++i) { - fmr = kmalloc(sizeof *fmr + params->max_pages_per_fmr * sizeof (u64), - GFP_KERNEL); + fmr = kmalloc(bytes_per_fmr, GFP_KERNEL); if (!fmr) { printk(KERN_WARNING PFX "failed to allocate fmr " "struct for FMR %d\n", i); |