John Que (qwejohn@xxxxxxxxxxx) wrote: > Hello, > > I had build linux-2.6.12-rc3 from a tar file. > > It passes successfully. > Now I want to apply the inotify patch of Robert Love. > > I look under: > http://www.kernel.org/pub/linux/kernel/people/rml/inotify/v2.6 > > I see many version theres. > > In 0.23 there are 4 patches which seems relavant: > - > inotify-0.23-rml-2.6.12-rc3-1.patch > inotify-0.23-rml-2.6.12-rc3-2.patch > inotify-0.23-rml-2.6.12-rc3-3.patch > inotify-0.23-rml-2.6.12-rc3-4.patch > > What I do not understand here is this: > Is inotify-0.23-rml-2.6.12-rc3-1.patch can ve applied > on linux-2.6.12-rc3? or should I apply first > a pacth named linux-2.6.12-rc3-1? No. If you read patches is this same directory you will se that it is some enhancement from 0.23 to the next stable : 0.24. So the lastest release is : http://www.kernel.org/pub/linux/kernel/people/rml/inotify/v2.6/0.23/inotify-0.23-rml-2.6.12-rc3-4.patch You could see the diff between inotify-0.23-rml-2.6.12-rc3-3.patch and inotify-0.23-rml-2.6.12-rc3-4.patch with the enclosed diff > The same is for the 3 other paches : how should I apply them ? Only the lastest. > Is this "enumeration" ,so to speak, means that I need to patch first > inotify patch 1 , then inotify patch 2 , > than inotify patch 3 ,and than inotify patch 3 ; or does it mean that the > kernel itself , inux-2.6.12-rc3, > has 4 correspondong patches , and in order to patch inotift I nees to take > an inorify patch number > which is the same as the inux-2.6.12-rc3 patch number ? Correct me if I say some mistakes, ~Christophe
--- inotify-0.23-rml-2.6.12-rc3-3.patch 2005-04-28 22:37:46.000000000 +0200 +++ inotify-0.23-rml-2.6.12-rc3-4.patch 2005-04-29 17:37:25.000000000 +0200 @@ -39,11 +39,11 @@ Signed-off-by: Robert Love <rml@xxxxxxxx fs/read_write.c | 15 fs/xattr.c | 5 include/linux/fs.h | 6 - include/linux/fsnotify.h | 230 ++++++++ + include/linux/fsnotify.h | 232 ++++++++ include/linux/inotify.h | 126 ++++ include/linux/sched.h | 4 kernel/user.c | 4 - 17 files changed, 1530 insertions(+), 56 deletions(-) + 17 files changed, 1532 insertions(+), 56 deletions(-) diff -urN linux-2.6.12-rc3/Documentation/filesystems/inotify.txt linux/Documentation/filesystems/inotify.txt --- linux-2.6.12-rc3/Documentation/filesystems/inotify.txt 1969-12-31 19:00:00.000000000 -0500 @@ -312,7 +312,7 @@ diff -urN linux-2.6.12-rc3/fs/inode.c li diff -urN linux-2.6.12-rc3/fs/inotify.c linux/fs/inotify.c --- linux-2.6.12-rc3/fs/inotify.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux/fs/inotify.c 2005-04-28 16:31:13.000000000 -0400 ++++ linux/fs/inotify.c 2005-04-29 11:34:17.000000000 -0400 @@ -0,0 +1,971 @@ +/* + * fs/inotify.c - inode-based file event notifications @@ -1261,9 +1261,9 @@ diff -urN linux-2.6.12-rc3/fs/inotify.c + if (unlikely(ret)) + panic("inotify: misc_register returned %d\n", ret); + -+ max_queued_events = 512; -+ max_user_devices = 64; -+ max_user_watches = 16384; ++ max_queued_events = 8192; ++ max_user_devices = 128; ++ max_user_watches = 8192; + + class = inotify_device.class; + class_device_create_file(class, &class_device_attr_max_queued_events); @@ -1321,7 +1321,7 @@ diff -urN linux-2.6.12-rc3/fs/Makefile l diff -urN linux-2.6.12-rc3/fs/namei.c linux/fs/namei.c --- linux-2.6.12-rc3/fs/namei.c 2005-04-27 11:49:46.000000000 -0400 -+++ linux/fs/namei.c 2005-04-27 11:50:41.000000000 -0400 ++++ linux/fs/namei.c 2005-04-28 17:15:42.000000000 -0400 @@ -21,7 +21,7 @@ #include <linux/namei.h> #include <linux/quotaops.h> @@ -1409,7 +1409,7 @@ diff -urN linux-2.6.12-rc3/fs/namei.c li DQUOT_INIT(old_dir); DQUOT_INIT(new_dir); -+ old_name = fsnotify_oldname_init(old_dentry); ++ old_name = fsnotify_oldname_init(old_dentry->d_name.name); + if (is_dir) error = vfs_rename_dir(old_dir,old_dentry,new_dir,new_dentry); @@ -1548,13 +1548,13 @@ diff -urN linux-2.6.12-rc3/include/linux extern int generic_permission(struct inode *, int, diff -urN linux-2.6.12-rc3/include/linux/fsnotify.h linux/include/linux/fsnotify.h --- linux-2.6.12-rc3/include/linux/fsnotify.h 1969-12-31 19:00:00.000000000 -0500 -+++ linux/include/linux/fsnotify.h 2005-04-27 11:50:41.000000000 -0400 -@@ -0,0 +1,230 @@ ++++ linux/include/linux/fsnotify.h 2005-04-28 17:21:29.000000000 -0400 +@@ -0,0 +1,232 @@ +#ifndef _LINUX_FS_NOTIFY_H +#define _LINUX_FS_NOTIFY_H + +/* -+ * include/linux/fs_notify.h - generic hooks for filesystem notification, to ++ * include/linux/fsnotify.h - generic hooks for filesystem notification, to + * reduce in-source duplication from both dnotify and inotify. + * + * We don't compile any of this away in some complicated menagerie of ifdefs. @@ -1744,16 +1744,18 @@ diff -urN linux-2.6.12-rc3/include/linux +/* + * fsnotify_oldname_init - save off the old filename before we change it + * -+ * this could be kstrdup if only we could add that to lib/string.c ++ * XXX: This could be kstrdup if only we could add that to lib/string.c + */ -+static inline char *fsnotify_oldname_init(struct dentry *old_dentry) ++static inline char *fsnotify_oldname_init(const char *name) +{ -+ char *old_name; ++ size_t len; ++ char *buf; + -+ old_name = kmalloc(strlen(old_dentry->d_name.name) + 1, GFP_KERNEL); -+ if (old_name) -+ strcpy(old_name, old_dentry->d_name.name); -+ return old_name; ++ len = strlen(name) + 1; ++ buf = kmalloc(len, GFP_KERNEL); ++ if (likely(buf)) ++ memcpy(buf, name, len); ++ return buf; +} + +/*