pentoo-overlay/sys-kernel/pentoo-sources/files/openfile_log.patch

29 lines
732 B
Diff

diff -Naur linux-2.6.31.orig/fs/open.c linux-2.6.31/fs/open.c
--- linux-2.6.31.orig/fs/open.c 2009-09-10 00:13:59.000000000 +0200
+++ linux-2.6.31/fs/open.c 2009-10-28 14:22:13.987297948 +0100
@@ -1024,6 +1024,16 @@
}
EXPORT_SYMBOL(fd_install);
+static unsigned int open_logfiles;
+
+static int __init setup_logfiles(char *str)
+{
+ get_option(&str, &open_logfiles);
+ return 1;
+}
+
+__setup("logfiles=", setup_logfiles);
+
long do_sys_open(int dfd, const char __user *filename, int flags, int mode)
{
@@ -1038,6 +1048,8 @@
put_unused_fd(fd);
fd = PTR_ERR(f);
} else {
+ if (open_logfiles)
+ printk(KERN_DEBUG "FILE %s\n", filename);
fsnotify_open(f->f_path.dentry);
fd_install(fd, f);
}