inotify: fsnotify.h: use kstrdup
PATCH 1/1 inotify: fsnotify.h: use kstrdup
kstrdup was added in 2.6.13-rc1.
include/linux/fsnotify.h renamed from include/linux/fsnotify.h.old +1 -10
@@ -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 ); }/*
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.
Quoted 3 lines · Roland Dreier
Why not just convert all calls of
fsnotify_oldname_init()tokstrdup()and delete the inline function? The wrapper isn't adding much beyond hard-codingGFP_KERNEL.
There's a different wrapper for CONFIG_INOTIFY=n.
Quoted 1 line
- R.
cu
Adrian
Signature · 4 lines
"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 SeedQuoted 3 lines · Roland Dreier
Why not just convert all calls of
fsnotify_oldname_init()tokstrdup()and delete the inline function? The wrapper isn't adding much beyond hard-codingGFP_KERNEL.
Good idea, but the function is different if !CONFIG_INOTIFY. It exists to save us some ugly ifdefs in the source.
Robert Love
Quoted 3 lines · Adrian Bunk
kstrdup was added in 2.6.13-rc1.
Signed-off-by Adrian Bunk <[email protected]>
Thanks. I'll put this in the next release.
Andrew, you can merge this before then, if you want.
Robert Love