Package: enlightenment Version: 1:0.16.6-3 Tags: patch Hi!
I recently found out that having one's config dir on a NFS share is a bad idea. Enlightenment names its background-thumbnail-files after inode, m/ctime and _device_ of the original file, which is a little pointless when the device number is in the anonymous range (that is, majors 0 and 144-146): Everytime the share is mounted it is (most probably) assigned a different device number, causing the entire background cache to be rebuilt. Even worse, the old entries in the session config and the thumbnails itself are not deleted, so you accumulate a _LOT_ of redundant data by and by. Simply mapping all anonymous device numbers to a single number in the same range fixes the problem - patch is attached. It modifies code in: - file.c:filedev() - menus.c:MenuCreateFromDirectory() and, as I stumbled across it, two typos (copy&paste errors, to be exact) in the vicinity, namely the EDBUG() function-entry message of - file.c:fileinode() and filedev() The problem exists upstream - I've sent a similar mail to [EMAIL PROTECTED], but am still awaiting list moderator approval; and as that's already a week ago, I'm now also filing against the Debian package to get things fixed for this distro at least. I hope this is helpful and I didn't miss a reason why enlightenment's current behaviour might be intentional... Regards, Jan Nordholz Attachment: Patch for the latest upstream source (0.16.7.2) -- Jan Nordholz <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
diff -Naur e16/src/file.c e16_new/src/file.c --- e16/src/file.c Fri Aug 20 23:35:46 2004 +++ e16_new/src/file.c Mon Jan 24 13:05:44 2005 @@ -300,7 +300,7 @@ { struct stat st; - EDBUG(9, "filesize"); + EDBUG(9, "fileinode"); if ((!s) || (!*s)) EDBUG_RETURN(0); if (stat(s, &st) < 0) @@ -313,11 +313,17 @@ { struct stat st; - EDBUG(9, "filesize"); + EDBUG(9, "filedev"); if ((!s) || (!*s)) EDBUG_RETURN(0); if (stat(s, &st) < 0) EDBUG_RETURN(0); + + /* device numbers in the anonymous range can't be relied + upon, so map them all on a single one */ + if ((st.st_dev>>8)==0 || (st.st_dev>>8)==144 || \ + (st.st_dev>>8)==145 || (st.st_dev>>8)==146) + EDBUG_RETURN(1); EDBUG_RETURN((int)st.st_dev); } diff -Naur e16/src/menus.c e16_new/src/menus.c --- e16/src/menus.c Fri Aug 20 23:35:46 2004 +++ e16_new/src/menus.c Mon Jan 24 12:47:23 2005 @@ -1091,6 +1091,7 @@ aa = (int)st.st_ino; bb = (int)st.st_dev; + if ((bb>>8)==0 || (bb>>8)==144 || (bb>>8)==145 || (bb>>8)==146) bb=(int)1; cc = 0; if (st.st_mtime > st.st_ctime) cc = st.st_mtime; @@ -1215,6 +1216,7 @@ aa = (int)st.st_ino; bb = (int)st.st_dev; + if ((bb>>8)==0 || (bb>>8)==144 || (bb>>8)==145 || (bb>>8)==146) bb=(int)1; cc = 0; if (st.st_mtime > st.st_ctime) cc = st.st_mtime;