The patch titled dm: move idr_pre_get has been added to the -mm tree. Its filename is dm-move-idr_pre_get.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: dm: move idr_pre_get From: Jeff Mahoney <jeffm@xxxxxxxx> idr_pre_get() can sleep while allocating memory. The next patch will change _minor_lock into a spinlock, so this patch moves idr_pre_get() outside the lock in preparation. [akpm: too late for 2.6.17 - suitable for 2.6.17.x after it has settled] Signed-off-by: Jeff Mahoney <jeffm@xxxxxxxx> Signed-off-by: Alasdair G Kergon <agk@xxxxxxxxxx> Cc: <stable@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/md/dm.c | 23 +++++++++-------------- 1 files changed, 9 insertions(+), 14 deletions(-) diff -puN drivers/md/dm.c~dm-move-idr_pre_get drivers/md/dm.c --- devel/drivers/md/dm.c~dm-move-idr_pre_get 2006-05-25 15:15:24.000000000 -0700 +++ devel-akpm/drivers/md/dm.c 2006-05-25 15:15:24.000000000 -0700 @@ -766,6 +766,10 @@ static int specific_minor(struct mapped_ if (minor >= (1 << MINORBITS)) return -EINVAL; + r = idr_pre_get(&_minor_idr, GFP_KERNEL); + if (!r) + return -ENOMEM; + mutex_lock(&_minor_lock); if (idr_find(&_minor_idr, minor)) { @@ -773,16 +777,9 @@ static int specific_minor(struct mapped_ goto out; } - r = idr_pre_get(&_minor_idr, GFP_KERNEL); - if (!r) { - r = -ENOMEM; - goto out; - } - r = idr_get_new_above(&_minor_idr, MINOR_ALLOCED, minor, &m); - if (r) { + if (r) goto out; - } if (m != minor) { idr_remove(&_minor_idr, m); @@ -800,13 +797,11 @@ static int next_free_minor(struct mapped int r; unsigned int m; - mutex_lock(&_minor_lock); - r = idr_pre_get(&_minor_idr, GFP_KERNEL); - if (!r) { - r = -ENOMEM; - goto out; - } + if (!r) + return -ENOMEM; + + mutex_lock(&_minor_lock); r = idr_get_new(&_minor_idr, MINOR_ALLOCED, &m); if (r) { _ Patches currently in -mm which might be from jeffm@xxxxxxxx are lib-add-idr_replace.patch lib-add-idr_replace-tidy.patch dm-fix-idr-minor-allocation.patch dm-move-idr_pre_get.patch dm-change-minor_lock-to-spinlock.patch dm-add-dmf_freeing.patch dm-fix-mapped-device-ref-counting.patch dm-add-module-ref-counting.patch dm-fix-block-device-initialisation.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html