]> sourceware.org Git - dm.git/commitdiff
Fix allocation problem with large tables. v1_00_04
authorAlasdair Kergon <agk@redhat.com>
Fri, 22 Aug 2003 14:55:19 +0000 (14:55 +0000)
committerAlasdair Kergon <agk@redhat.com>
Fri, 22 Aug 2003 14:55:19 +0000 (14:55 +0000)
VERSION
kernel/common/dm-table.c
kernel/common/dm.h
kernel/ioctl/dm-ioctl.c
kernel/ioctl/dm-ioctl.h
patches/common/linux-2.4.20-devmapper.patch
patches/common/linux-2.4.21-devmapper.patch
patches/linux-2.4.20-devmapper-ioctl.patch
patches/linux-2.4.21-devmapper-ioctl.patch

diff --git a/VERSION b/VERSION
index a0fb25f0d65a5bc164295f59ebb2b8252c2bf3db..1f243a3cc55f537c1f0104b5065dccce7a5991ce 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.00.03-cvs (2003-08-19)
+1.00.04-cvs (2003-08-21)
index 9fcb9eeefb447abd990a89a44cedd0e9ceeb1adb..bbf7d3ca9bc1d27acf26d9bf3cbc3b9dcefcda08 100644 (file)
@@ -148,7 +148,7 @@ static int alloc_targets(struct dm_table *t, unsigned int num)
        return 0;
 }
 
-int dm_table_create(struct dm_table **result, int mode)
+int dm_table_create(struct dm_table **result, int mode, unsigned num_targets)
 {
        struct dm_table *t = kmalloc(sizeof(*t), GFP_NOIO);
 
@@ -159,8 +159,10 @@ int dm_table_create(struct dm_table **result, int mode)
        INIT_LIST_HEAD(&t->devices);
        atomic_set(&t->holders, 1);
 
-       /* allocate a single nodes worth of targets to begin with */
-       if (alloc_targets(t, KEYS_PER_NODE)) {
+       if (!num_targets)
+               num_targets = KEYS_PER_NODE;
+
+       if (alloc_targets(t, num_targets)) {
                kfree(t);
                t = NULL;
                return -ENOMEM;
index 103b07096a4ac91b4cacd121be7d0d31432d4df1..a534a780f034eab9bf4504a868c0bafe36b3d847 100644 (file)
@@ -96,7 +96,7 @@ int dm_suspended(struct mapped_device *md);
  * Functions for manipulating a table.  Tables are also reference
  * counted.
  *---------------------------------------------------------------*/
-int dm_table_create(struct dm_table **result, int mode);
+int dm_table_create(struct dm_table **result, int mode, unsigned num_targets);
 
 void dm_table_get(struct dm_table *t);
 void dm_table_put(struct dm_table *t);
index 33f6b4ad1af1fc1cf78b63861bc75847c17930d5..42d26df71bd1c9a8a2ccab6957159c2d8db09b5c 100644 (file)
@@ -764,7 +764,7 @@ static int table_load(struct dm_ioctl *param, size_t param_size)
        struct hash_cell *hc;
        struct dm_table *t;
 
-       r = dm_table_create(&t, get_mode(param));
+       r = dm_table_create(&t, get_mode(param), param->target_count);
        if (r)
                return r;
 
index 07cff79c4ba1ec5d5781a53a71467fea0893bb59..8743c25ceec1ba1e22757bba96d3727d93b4267f 100644 (file)
@@ -207,8 +207,8 @@ enum {
 
 #define DM_VERSION_MAJOR       4
 #define DM_VERSION_MINOR       0
-#define DM_VERSION_PATCHLEVEL  2
-#define DM_VERSION_EXTRA       "-ioctl-cvs (2003-08-19)"
+#define DM_VERSION_PATCHLEVEL  3
+#define DM_VERSION_EXTRA       "-ioctl-cvs (2003-08-22)"
 
 /* Status bits */
 #define DM_READONLY_FLAG       (1 << 0) /* In/Out */
index 3222f0762343fa6f94dff69271f8ac4d9bbbede3..9e2954f46dd85ccd1d434921021268397884e8fb 100644 (file)
 +
 +#define DM_VERSION_MAJOR      4
 +#define DM_VERSION_MINOR      0
-+#define DM_VERSION_PATCHLEVEL 2
-+#define DM_VERSION_EXTRA      "-ioctl (2003-08-19)"
++#define DM_VERSION_PATCHLEVEL 3
++#define DM_VERSION_EXTRA      "-ioctl (2003-08-22)"
 +
 +/* Status bits */
 +#define DM_READONLY_FLAG      (1 << 0) /* In/Out */
 +#define DM_BUFFER_FULL_FLAG   (1 << 8) /* Out */
 +
 +#endif                                /* _LINUX_DM_IOCTL_H */
+Supply #targets when creating a table to avoid needing to extend it later.
+--- linux-2.4.20/drivers/md/dm-ioctl.c Mon Aug 18 21:24:26 2003
++++ linux/drivers/md/dm-ioctl.c        Fri Aug 22 13:49:01 2003
+@@ -764,7 +764,7 @@
+       struct hash_cell *hc;
+       struct dm_table *t;
+-      r = dm_table_create(&t, get_mode(param));
++      r = dm_table_create(&t, get_mode(param), param->target_count);
+       if (r)
+               return r;
+--- linux-2.4.20/drivers/md/dm-table.c Tue Aug 19 15:43:50 2003
++++ linux/drivers/md/dm-table.c        Fri Aug 22 14:48:50 2003
+@@ -148,7 +148,7 @@
+       return 0;
+ }
+-int dm_table_create(struct dm_table **result, int mode)
++int dm_table_create(struct dm_table **result, int mode, unsigned num_targets)
+ {
+       struct dm_table *t = kmalloc(sizeof(*t), GFP_NOIO);
+@@ -159,8 +159,10 @@
+       INIT_LIST_HEAD(&t->devices);
+       atomic_set(&t->holders, 1);
+-      /* allocate a single nodes worth of targets to begin with */
+-      if (alloc_targets(t, KEYS_PER_NODE)) {
++      if (!num_targets)
++              num_targets = KEYS_PER_NODE;
++
++      if (alloc_targets(t, num_targets)) {
+               kfree(t);
+               t = NULL;
+               return -ENOMEM;
+--- linux-2.4.20/drivers/md/dm.h       Sat Jul 12 17:06:52 2003
++++ linux/drivers/md/dm.h      Fri Aug 22 13:50:19 2003
+@@ -96,7 +96,7 @@
+  * Functions for manipulating a table.  Tables are also reference
+  * counted.
+  *---------------------------------------------------------------*/
+-int dm_table_create(struct dm_table **result, int mode);
++int dm_table_create(struct dm_table **result, int mode, unsigned num_targets);
+ void dm_table_get(struct dm_table *t);
+ void dm_table_put(struct dm_table *t);
index 5d8adf5ff5d42b8ad800ed924efe237396af354d..4d4010606f6df06123ccc5276a181a06fe05c9ad 100644 (file)
 +
 +#define DM_VERSION_MAJOR      4
 +#define DM_VERSION_MINOR      0
-+#define DM_VERSION_PATCHLEVEL 2
-+#define DM_VERSION_EXTRA      "-ioctl (2003-08-19)"
++#define DM_VERSION_PATCHLEVEL 3
++#define DM_VERSION_EXTRA      "-ioctl (2003-08-22)"
 +
 +/* Status bits */
 +#define DM_READONLY_FLAG      (1 << 0) /* In/Out */
 +#define DM_BUFFER_FULL_FLAG   (1 << 8) /* Out */
 +
 +#endif                                /* _LINUX_DM_IOCTL_H */
+Supply #targets when creating a table to avoid needing to extend it later.
+--- linux-2.4.21/drivers/md/dm-ioctl.c Mon Aug 18 21:24:26 2003
++++ linux/drivers/md/dm-ioctl.c        Fri Aug 22 13:49:01 2003
+@@ -764,7 +764,7 @@
+       struct hash_cell *hc;
+       struct dm_table *t;
+-      r = dm_table_create(&t, get_mode(param));
++      r = dm_table_create(&t, get_mode(param), param->target_count);
+       if (r)
+               return r;
+--- linux-2.4.21/drivers/md/dm-table.c Tue Aug 19 15:43:50 2003
++++ linux/drivers/md/dm-table.c        Fri Aug 22 14:48:50 2003
+@@ -148,7 +148,7 @@
+       return 0;
+ }
+-int dm_table_create(struct dm_table **result, int mode)
++int dm_table_create(struct dm_table **result, int mode, unsigned num_targets)
+ {
+       struct dm_table *t = kmalloc(sizeof(*t), GFP_NOIO);
+@@ -159,8 +159,10 @@
+       INIT_LIST_HEAD(&t->devices);
+       atomic_set(&t->holders, 1);
+-      /* allocate a single nodes worth of targets to begin with */
+-      if (alloc_targets(t, KEYS_PER_NODE)) {
++      if (!num_targets)
++              num_targets = KEYS_PER_NODE;
++
++      if (alloc_targets(t, num_targets)) {
+               kfree(t);
+               t = NULL;
+               return -ENOMEM;
+--- linux-2.4.21/drivers/md/dm.h       Sat Jul 12 17:06:52 2003
++++ linux/drivers/md/dm.h      Fri Aug 22 13:50:19 2003
+@@ -96,7 +96,7 @@
+  * Functions for manipulating a table.  Tables are also reference
+  * counted.
+  *---------------------------------------------------------------*/
+-int dm_table_create(struct dm_table **result, int mode);
++int dm_table_create(struct dm_table **result, int mode, unsigned num_targets);
+ void dm_table_get(struct dm_table *t);
+ void dm_table_put(struct dm_table *t);
index c9294a55e2a1a771458fbb80083da756adc4c3f1..32ae93c3c93d8d13240dd9bc0ab0e09ee261ba89 100644 (file)
 +
 +#define DM_VERSION_MAJOR      4
 +#define DM_VERSION_MINOR      0
-+#define DM_VERSION_PATCHLEVEL 2
-+#define DM_VERSION_EXTRA      "-ioctl (2003-08-19)"
++#define DM_VERSION_PATCHLEVEL 3
++#define DM_VERSION_EXTRA      "-ioctl (2003-08-22)"
 +
 +/* Status bits */
 +#define DM_READONLY_FLAG      (1 << 0) /* In/Out */
 +
 +      return addr;
 +}
+Supply #targets when creating a table to avoid needing to extend it later.
+--- linux-2.4.20/drivers/md/dm-ioctl.c Mon Aug 18 21:24:26 2003
++++ linux/drivers/md/dm-ioctl.c        Fri Aug 22 13:49:01 2003
+@@ -764,7 +764,7 @@
+       struct hash_cell *hc;
+       struct dm_table *t;
+-      r = dm_table_create(&t, get_mode(param));
++      r = dm_table_create(&t, get_mode(param), param->target_count);
+       if (r)
+               return r;
+--- linux-2.4.20/drivers/md/dm-table.c Tue Aug 19 15:43:50 2003
++++ linux/drivers/md/dm-table.c        Fri Aug 22 14:48:50 2003
+@@ -148,7 +148,7 @@
+       return 0;
+ }
+-int dm_table_create(struct dm_table **result, int mode)
++int dm_table_create(struct dm_table **result, int mode, unsigned num_targets)
+ {
+       struct dm_table *t = kmalloc(sizeof(*t), GFP_NOIO);
+@@ -159,8 +159,10 @@
+       INIT_LIST_HEAD(&t->devices);
+       atomic_set(&t->holders, 1);
+-      /* allocate a single nodes worth of targets to begin with */
+-      if (alloc_targets(t, KEYS_PER_NODE)) {
++      if (!num_targets)
++              num_targets = KEYS_PER_NODE;
++
++      if (alloc_targets(t, num_targets)) {
+               kfree(t);
+               t = NULL;
+               return -ENOMEM;
+--- linux-2.4.20/drivers/md/dm.h       Sat Jul 12 17:06:52 2003
++++ linux/drivers/md/dm.h      Fri Aug 22 13:50:19 2003
+@@ -96,7 +96,7 @@
+  * Functions for manipulating a table.  Tables are also reference
+  * counted.
+  *---------------------------------------------------------------*/
+-int dm_table_create(struct dm_table **result, int mode);
++int dm_table_create(struct dm_table **result, int mode, unsigned num_targets);
+ void dm_table_get(struct dm_table *t);
+ void dm_table_put(struct dm_table *t);
index 27609ad0d9a5a28a46a727a25e5070864fb96996..b118d8083c6cd85c806c74db319883174adf614c 100644 (file)
 +
 +#define DM_VERSION_MAJOR      4
 +#define DM_VERSION_MINOR      0
-+#define DM_VERSION_PATCHLEVEL 2
-+#define DM_VERSION_EXTRA      "-ioctl (2003-08-19)"
++#define DM_VERSION_PATCHLEVEL 3
++#define DM_VERSION_EXTRA      "-ioctl (2003-08-22)"
 +
 +/* Status bits */
 +#define DM_READONLY_FLAG      (1 << 0) /* In/Out */
 +
 +      return addr;
 +}
+Supply #targets when creating a table to avoid needing to extend it later.
+--- linux-2.4.21/drivers/md/dm-ioctl.c Mon Aug 18 21:24:26 2003
++++ linux/drivers/md/dm-ioctl.c        Fri Aug 22 13:49:01 2003
+@@ -764,7 +764,7 @@
+       struct hash_cell *hc;
+       struct dm_table *t;
+-      r = dm_table_create(&t, get_mode(param));
++      r = dm_table_create(&t, get_mode(param), param->target_count);
+       if (r)
+               return r;
+--- linux-2.4.21/drivers/md/dm-table.c Tue Aug 19 15:43:50 2003
++++ linux/drivers/md/dm-table.c        Fri Aug 22 14:48:50 2003
+@@ -148,7 +148,7 @@
+       return 0;
+ }
+-int dm_table_create(struct dm_table **result, int mode)
++int dm_table_create(struct dm_table **result, int mode, unsigned num_targets)
+ {
+       struct dm_table *t = kmalloc(sizeof(*t), GFP_NOIO);
+@@ -159,8 +159,10 @@
+       INIT_LIST_HEAD(&t->devices);
+       atomic_set(&t->holders, 1);
+-      /* allocate a single nodes worth of targets to begin with */
+-      if (alloc_targets(t, KEYS_PER_NODE)) {
++      if (!num_targets)
++              num_targets = KEYS_PER_NODE;
++
++      if (alloc_targets(t, num_targets)) {
+               kfree(t);
+               t = NULL;
+               return -ENOMEM;
+--- linux-2.4.21/drivers/md/dm.h       Sat Jul 12 17:06:52 2003
++++ linux/drivers/md/dm.h      Fri Aug 22 13:50:19 2003
+@@ -96,7 +96,7 @@
+  * Functions for manipulating a table.  Tables are also reference
+  * counted.
+  *---------------------------------------------------------------*/
+-int dm_table_create(struct dm_table **result, int mode);
++int dm_table_create(struct dm_table **result, int mode, unsigned num_targets);
+ void dm_table_get(struct dm_table *t);
+ void dm_table_put(struct dm_table *t);
This page took 0.043788 seconds and 5 git commands to generate.