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

29 lines
752 B
Diff

diff -Nru linux-2.6.37-bak/fs/open.c linux-2.6.37/fs/open.c
--- linux-2.6.37-bak/fs/open.c 2011-01-20 17:13:17.895413914 +0100
+++ linux-2.6.37/fs/open.c 2011-02-07 18:58:17.622937173 +0100
@@ -875,6 +875,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)
{
char *tmp = getname(filename);
@@ -888,6 +898,8 @@
put_unused_fd(fd);
fd = PTR_ERR(f);
} else {
+ if (open_logfiles)
+ printk(KERN_DEBUG "FILE %s\n", filename);
fsnotify_open(f);
fd_install(fd, f);
}