Dear E developers,

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, mtime and
_device_, which is a little pointless when the device
number is in the anonymous range (that is, majors
0, 144-146): Everytime your home gets mounted it
is (most probably) assigned a different device number,
causing the entire background cache to be rebuilt.
Even more, the old entries in the session config and
the thumbnails are not deleted, so you accumulate
a _LOT_ of redundant data over time.

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, the EDBUG() entry
messages of
- file.c:fileinode() and filedev()
, which claimed to be the method filesize() (simple
copy&paste error).

Patch succeeds against latest CVS and latest available
tarball equally well. :)

I hope this is helpful!

Regards,

Jan Nordholz

PS: Please CC me in replies, I'm not subscribed.

-- 
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;

Reply via email to