[PATCH 2.6.11-rc2] dm-ioctl.c: use new kstrdup() from library

From: Matt Domsch (Matt_Domsch_at_dell.com)
Date: 01/31/05

  • Next message: Matthew Wilcox: "Re: pci: Arch hook to determine config space size"
    Date:	Mon, 31 Jan 2005 13:28:59 -0600
    To: dm-devel@redhat.com
    
    

    Removes private kstrdup() function, uses new implementation in lib/string.c.

    Required to build.

    Signed-off-by: Matt Domsch <Matt_Domsch@dell.com

    -- 
    Matt Domsch
    Software Architect
    Dell Linux Solutions linux.dell.com & www.dell.com/linux
    Linux on Dell mailing lists @ http://lists.us.dell.com
    ===== drivers/md/dm-ioctl.c 1.42 vs edited =====
    --- 1.42/drivers/md/dm-ioctl.c	2004-11-15 21:29:26 -06:00
    +++ edited/drivers/md/dm-ioctl.c	2005-01-27 19:27:26 -06:00
    @@ -13,6 +13,7 @@
     #include <linux/init.h>
     #include <linux/wait.h>
     #include <linux/slab.h>
    +#include <linux/string.h>
     #include <linux/devfs_fs_kernel.h>
     #include <linux/dm-ioctl.h>
     
    @@ -122,14 +123,6 @@
     /*-----------------------------------------------------------------
      * Inserting, removing and renaming a device.
      *---------------------------------------------------------------*/
    -static inline char *kstrdup(const char *str)
    -{
    -	char *r = kmalloc(strlen(str) + 1, GFP_KERNEL);
    -	if (r)
    -		strcpy(r, str);
    -	return r;
    -}
    -
     static struct hash_cell *alloc_cell(const char *name, const char *uuid,
     				    struct mapped_device *md)
     {
    @@ -139,7 +132,7 @@
     	if (!hc)
     		return NULL;
     
    -	hc->name = kstrdup(name);
    +	hc->name = kstrdup(name, GFP_KERNEL);
     	if (!hc->name) {
     		kfree(hc);
     		return NULL;
    @@ -149,7 +142,7 @@
     		hc->uuid = NULL;
     
     	else {
    -		hc->uuid = kstrdup(uuid);
    +		hc->uuid = kstrdup(uuid, GFP_KERNEL);
     		if (!hc->uuid) {
     			kfree(hc->name);
     			kfree(hc);
    @@ -273,7 +266,7 @@
     	/*
     	 * duplicate new.
     	 */
    -	new_name = kstrdup(new);
    +	new_name = kstrdup(new, GFP_KERNEL);
     	if (!new_name)
     		return -ENOMEM;
     
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Matthew Wilcox: "Re: pci: Arch hook to determine config space size"

    Relevant Pages

    • Re: 2.4.23-bk bogus edd changeset - Re: 2.4.23 compile error in edd
      ... >> finished the switch the computer reboots. ... Dell Linux Solutions www.dell.com/linux ... Linux on Dell mailing lists @ http://lists.us.dell.com ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Proposed enhancements to MD
      ... www.snia.org in the DDF TWG section, but requires you be a member of SNIA ... Dell Linux Solutions www.dell.com/linux ... Linux on Dell mailing lists @ http://lists.us.dell.com ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: PATCH (for 2.6.3-rc1) for cdrom driver dvd_read_struct
      ... People much prefer to see a quoting style as above (date, from line, ... Dell Linux Solutions linux.dell.com & www.dell.com/linux ... Linux on Dell mailing lists @ http://lists.us.dell.com ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: intel-agp: skip non-AGP devices
      ... Dell Linux Solutions linux.dell.com & www.dell.com/linux ... Linux on Dell mailing lists @ http://lists.us.dell.com ... struct agp_bridge_data *bridge; ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: aacraid hangs at boot on linux-2.4.27-pre1 20 second delay at lilo prompt makes it succeed
      ... It's possible that this is related to the firmware cache flush ... Dell Linux Solutions linux.dell.com & www.dell.com/linux ... Linux on Dell mailing lists @ http://lists.us.dell.com ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)