patch 5 for dazukofs release 3.0.0

Lino Sanfilippo <[email protected]> Tue, 21 Apr 2009 19:16:20 +0200
Newsgroups gmane.linux.dazuko.devel
Message-ID <[email protected]>

This patch is not a bug fix, but useful to increase performance:

dazukofs reports open events for all kind of files. But this does
mainly make sense for regular files (who wants to check
fifos for malware?).
Thus a simple check ensures that only open events for regular
files are announced to userspace.

(On my system a simple "find" command executed in /usr which was
mounted with dazukofs resulted in over 90000 context switches -
only caused by opening directories..)


GeschÀftsfÌhrender Gesellschafter: Tjark Auerbach
Sitz der Gesellschaft: Tettnang
Handelsregister: Amtsgericht Ulm, HRB 630992
ALLGEMEINE GESCHÄFTSBEDINGUNGEN
Es gelten unsere Allgemeinen GeschÀftsbedingungen
(AGB). Sie finden sie in der jeweils gÃŒltigen Fassung
im Internet unter http://www.avira.de/agb
***************************************************

_______________________________________________
Dazuko-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/dazuko-devel
patch5 (text/plain, 611 B)
diff -rup dazukofs-3.0.0-p4/file.c dazukofs-3.0.0-p5/file.c
--- dazukofs-3.0.0-p4/file.c	2009-03-15 19:07:06.000000000 +0100
+++ dazukofs-3.0.0-p5/file.c	2009-03-15 19:26:14.000000000 +0100
@@ -177,9 +177,11 @@ static int dazukofs_open(struct inode *i
 	struct file *lower_file;
 	int err;
 
-	err = dazukofs_check_access(file->f_dentry, file->f_vfsmnt);
-	if (err)
-		goto error_out1;
+	if (S_ISREG(inode->i_mode)) {
+		err = dazukofs_check_access(file->f_dentry, file->f_vfsmnt);
+		if (err)
+			goto error_out1;
+	}
 
 	SET_FILE_INFO(file, kmem_cache_zalloc(dazukofs_file_info_cachep,
 		      GFP_KERNEL));