All of lore.kernel.org
 help / color / mirror / Atom feed
* [-mm patch] inotify: fsnotify.h: use kstrdup
@ 2005-07-01 22:55 Adrian Bunk
  2005-07-01 23:20 ` Roland Dreier
  2005-07-01 23:36 ` Robert Love
  0 siblings, 2 replies; 5+ messages in thread
From: Adrian Bunk @ 2005-07-01 22:55 UTC (permalink / raw)
  To: Robert Love; +Cc: linux-kernel

kstrdup was added in 2.6.13-rc1.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

--- linux-2.6.12-mm2-full/include/linux/fsnotify.h.old	2005-06-30 22:26:07.000000000 +0200
+++ linux-2.6.12-mm2-full/include/linux/fsnotify.h	2005-06-30 22:27:26.000000000 +0200
@@ -216,19 +216,10 @@
 
 /*
  * fsnotify_oldname_init - save off the old filename before we change it
- *
- * XXX: This could be kstrdup if only we could add that to lib/string.c
  */
 static inline const char *fsnotify_oldname_init(const char *name)
 {
-	size_t len;
-	char *buf;
-
-	len = strlen(name) + 1;
-	buf = kmalloc(len, GFP_KERNEL);
-	if (likely(buf))
-		memcpy(buf, name, len);
-	return buf;
+	return kstrdup(name, GFP_KERNEL);
 }
 
 /*


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [-mm patch] inotify: fsnotify.h: use kstrdup
  2005-07-01 22:55 [-mm patch] inotify: fsnotify.h: use kstrdup Adrian Bunk
@ 2005-07-01 23:20 ` Roland Dreier
  2005-07-01 23:28   ` Adrian Bunk
  2005-07-01 23:36   ` Robert Love
  2005-07-01 23:36 ` Robert Love
  1 sibling, 2 replies; 5+ messages in thread
From: Roland Dreier @ 2005-07-01 23:20 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Robert Love, linux-kernel

Why not just convert all calls of fsnotify_oldname_init() to kstrdup()
and delete the inline function?  The wrapper isn't adding much beyond
hard-coding GFP_KERNEL.

 - R.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [-mm patch] inotify: fsnotify.h: use kstrdup
  2005-07-01 23:20 ` Roland Dreier
@ 2005-07-01 23:28   ` Adrian Bunk
  2005-07-01 23:36   ` Robert Love
  1 sibling, 0 replies; 5+ messages in thread
From: Adrian Bunk @ 2005-07-01 23:28 UTC (permalink / raw)
  To: Roland Dreier; +Cc: Robert Love, linux-kernel

On Fri, Jul 01, 2005 at 04:20:49PM -0700, Roland Dreier wrote:

> Why not just convert all calls of fsnotify_oldname_init() to kstrdup()
> and delete the inline function?  The wrapper isn't adding much beyond
> hard-coding GFP_KERNEL.

There's a different wrapper for CONFIG_INOTIFY=n.

>  - R.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [-mm patch] inotify: fsnotify.h: use kstrdup
  2005-07-01 23:20 ` Roland Dreier
  2005-07-01 23:28   ` Adrian Bunk
@ 2005-07-01 23:36   ` Robert Love
  1 sibling, 0 replies; 5+ messages in thread
From: Robert Love @ 2005-07-01 23:36 UTC (permalink / raw)
  To: Roland Dreier; +Cc: Adrian Bunk, linux-kernel

On Fri, 2005-07-01 at 16:20 -0700, Roland Dreier wrote:
> Why not just convert all calls of fsnotify_oldname_init() to kstrdup()
> and delete the inline function?  The wrapper isn't adding much beyond
> hard-coding GFP_KERNEL.

Good idea, but the function is different if !CONFIG_INOTIFY.  It exists
to save us some ugly ifdefs in the source.

	Robert Love



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [-mm patch] inotify: fsnotify.h: use kstrdup
  2005-07-01 22:55 [-mm patch] inotify: fsnotify.h: use kstrdup Adrian Bunk
  2005-07-01 23:20 ` Roland Dreier
@ 2005-07-01 23:36 ` Robert Love
  1 sibling, 0 replies; 5+ messages in thread
From: Robert Love @ 2005-07-01 23:36 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-kernel

On Sat, 2005-07-02 at 00:55 +0200, Adrian Bunk wrote:

> kstrdup was added in 2.6.13-rc1.
> 
> Signed-off-by: Adrian Bunk <bunk@stusta.de>

Thanks.  I'll put this in the next release.

Andrew, you can merge this before then, if you want.

Signed-off-by: Robert Love <rml@novell.com>

	Robert Love



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-07-01 23:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-01 22:55 [-mm patch] inotify: fsnotify.h: use kstrdup Adrian Bunk
2005-07-01 23:20 ` Roland Dreier
2005-07-01 23:28   ` Adrian Bunk
2005-07-01 23:36   ` Robert Love
2005-07-01 23:36 ` Robert Love

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.