summaryrefslogtreecommitdiff
path: root/debian/patches/sysvshm.patch
blob: 4e21351394e5a6e31335cad66496c3ee1597aced (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
2005-03-09  Marcus Brinkmann  <marcus@flubber>
	
	* 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
--- ext2fs/inode.c	2005-08-28 15:12:07.465246232 +0200
+++ ext2fs/inode.c	2005-08-28 15:12:59.372355152 +0200
@@ -309,7 +309,7 @@
   if (S_ISREG (st->st_mode) || S_ISDIR (st->st_mode)
       || (S_ISLNK (st->st_mode) && st->st_blocks))
     np->allocsize = round_block (np->dn_stat.st_size);
-  else
+  else {
     /* Allocsize should be zero for anything except directories, files, and
        long symlinks.  These are the only things allowed to have any blocks
        allocated as well, although st_size may be zero for any type (cases
@@ -317,6 +317,9 @@
        linux, some devices).  */
     np->allocsize = 0;
 
+    /* We start out with no map users.  */
+    st->st_mode |= S_IMMAP0;
+  }
   return 0;
 }
 
diff -rup cvs/hurd/ext2fs/pager.c work/hurd/ext2fs/pager.c
--- ext2fs/pager.c	2002-06-11 17:38:01.000000000 -0400
+++ 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);
 	}