At Tue, 12 Jul 2005 00:20:05 +0200,
Marcus [EMAIL PROTECTED] de wrote:
> 
> Below is a temporary patch for ext2fs to support the bit used for
> nattch.  Only few programs will require this, though.

groan.

2005-03-09  Marcus Brinkmann  <[EMAIL PROTECTED]>
        
        * pager.c: Include <sys/stat.h>.
        (pager_clear_user_data): Set the S_IMMAP0 flag in the node's stat
        mode.
        (diskfs_get_filemap): Clear the S_IMMAP0 flag in the node's stat
        mode after creating the pager.
        * inode.c (read_node): Set the S_IMMAP0 flag in the node's stat
        mode.

diff -rup cvs/hurd/ext2fs/inode.c work/hurd/ext2fs/inode.c
--- cvs/hurd/ext2fs/inode.c     2002-10-08 19:10:09.000000000 -0400
+++ work/hurd/ext2fs/inode.c    2005-03-09 17:27:34.000000000 -0500
@@ -310,6 +312,9 @@ read_node (struct node *np)
       offset = np->allocsize & ((1 << log2_block_size) - 1);
       if (offset > 0)
        np->allocsize += block_size - offset;
+
+      /* We start out with no map users.  */
+      st->st_mode |= S_IMMAP0;
     }
   else
     /* Allocsize should be zero for anything except directories, files, and
diff -rup cvs/hurd/ext2fs/pager.c work/hurd/ext2fs/pager.c
--- cvs/hurd/ext2fs/pager.c     2002-06-11 17:38:01.000000000 -0400
+++ work/hurd/ext2fs/pager.c    2005-03-09 17:45:27.000000000 -0500
@@ -20,6 +20,7 @@
 
 #include <string.h>
 #include <errno.h>
+#include <sys/stat.h>
 #include <hurd/store.h>
 #include "ext2fs.h"
 
@@ -744,6 +745,7 @@ pager_clear_user_data (struct user_pager
   if (upi->type == FILE_DATA)
     {
       struct pager *pager;
+      struct node *np;
 
       spin_lock (&node_to_page_lock);
       pager = upi->node->dn->pager;
@@ -751,6 +753,11 @@ pager_clear_user_data (struct user_pager
        upi->node->dn->pager = 0;
       spin_unlock (&node_to_page_lock);
 
+      np = upi->node;
+      mutex_lock (&np->lock);
+      np->dn_stat.st_mode |= S_IMMAP0;
+      mutex_unlock (&np->lock);
+
       diskfs_nrele_light (upi->node);
     }
 
@@ -824,6 +831,8 @@ diskfs_get_filemap (struct node *node, v
              return MACH_PORT_NULL;
            }
 
+         node->dn_stat.st_mode &= ~S_IMMAP0;
+
          right = pager_get_port (node->dn->pager);
          ports_port_deref (node->dn->pager);
        }



_______________________________________________
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd

Reply via email to