libdiskfs locking, read side

Marcus Brinkmann <[email protected]> Tue, 09 Mar 2004 00:34:26 +0100
Newsgroups gmane.os.hurd.devel.readers
Message-ID <[email protected]>
Hi,

marco prepared and tested this patch to fix the read side of the
diskfs locking issue, and it seems to be ok to me.  It also uses the
same syntax as Roland's change, I think.

So, if you don't object, I would let him check it in at the end of the
week.

The write side has more changes, all equally dull.  We could also wait
for that patch and check them in at the same time, if you prefer that.

Thanks,
Marcus

_______________________________________________
Hurd-devel-readers mailing list
[email protected]
http://mail.gnu.org/mailman/listinfo/hurd-devel-readers
locking.patch (application/octet-stream, 20.3 KB)
2004-03-08  Marco Gerards  <[email protected]>

	* diskfs.h (diskfs_cached_lookup): Add DIR argument.
	* fsys-getfile.c (diskfs_S_fsys_getfile): Use the DIR argument of
	diskfs_cached_lookup.
	* name-cache.c (diskfs_check_lookup_cache): Likewise.


===================================================================
RCS file: /cvsroot/hurd/hurd/libdiskfs/diskfs.h,v
retrieving revision 1.98
diff -u -p -r1.98 diskfs.h
--- diskfs.h	27 Jun 2002 19:19:13 -0000	1.98
+++ diskfs.h	8 Mar 2004 22:16:04 -0000
@@ -1,5 +1,5 @@
 /* Definitions for fileserver helper functions
-   Copyright (C) 1994,95,96,97,98,99,2001,02 Free Software Foundation, Inc.
+   Copyright (C) 1994,95,96,97,98,99,2001,02,2004 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -751,8 +751,10 @@ error_t diskfs_dirrewrite (struct node *
 error_t diskfs_dirremove (struct node *dp, struct node *np,
 			  const char *name, struct dirstat *ds);
 
-/* Return the node corresponding to CACHE_ID in *NPP. */
-error_t diskfs_cached_lookup (ino64_t cache_id, struct node **npp);
+/* Return the node corresponding to CACHE_ID in *NPP.  If the
+   directory containing the node is locked, DIR is set to its node.  */
+error_t diskfs_cached_lookup (ino64_t cache_id, struct node **npp,
+			      struct node *dir);
 
 /* Create a new node. Give it MODE; if that includes IFDIR, also
    initialize `.' and `..' in the new directory.  Return the node in NPP.
Index: fsys-getfile.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libdiskfs/fsys-getfile.c,v
retrieving revision 1.9
diff -u -p -r1.9 fsys-getfile.c
--- fsys-getfile.c	26 Mar 2002 14:59:52 -0000	1.9
+++ fsys-getfile.c	8 Mar 2004 22:16:06 -0000
@@ -1,6 +1,6 @@
 /* Return the file for a given handle (for nfs server support)
 
-   Copyright (C) 1997,99,2001,02 Free Software Foundation, Inc.
+   Copyright (C) 1997,99,2001,02,2004 Free Software Foundation, Inc.
 
    This file is part of the GNU Hurd.
 
@@ -55,7 +55,7 @@ diskfs_S_fsys_getfile (mach_port_t fsys,
 
   f = (const union diskfs_fhandle *) handle;
 
-  err = diskfs_cached_lookup (f->data.cache_id, &node);
+  err = diskfs_cached_lookup (f->data.cache_id, &node, NULL);
   if (err)
     {
       ports_port_deref (pt);
Index: name-cache.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libdiskfs/name-cache.c,v
retrieving revision 1.12
diff -u -p -r1.12 name-cache.c
--- name-cache.c	24 Oct 1998 07:50:11 -0000	1.12
+++ name-cache.c	8 Mar 2004 22:16:06 -0000
@@ -1,6 +1,6 @@
 /* Directory name lookup caching
 
-   Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 2004 Free Software Foundation, Inc.
    Written by Michael I. Bushnell, p/BSG, & Miles Bader.
 
    This file is part of the GNU Hurd.
@@ -238,7 +238,7 @@ diskfs_check_lookup_cache (struct node *
 	  if (name[0] == '.' && name[1] == '.' && name[2] == '\0')
 	    {
 	      mutex_unlock (&dir->lock);
-	      err = diskfs_cached_lookup (id, &np);
+	      err = diskfs_cached_lookup (id, &np, NULL);
 	      mutex_lock (&dir->lock);
 
 	      /* In the window where DP was unlocked, we might
@@ -253,7 +253,7 @@ diskfs_check_lookup_cache (struct node *
 		}
 	    }
 	  else
-	    err = diskfs_cached_lookup (id, &np);
+	    err = diskfs_cached_lookup (id, &np, dir);
 	  return err ? 0 : np;
 	}
     }







2004-03-09  Marco Gerards  <[email protected]>

	* hurd.texi (Diskfs Callbacks): Added argument to
	diskfs_cached_lookup.


Index: hurd.texi
===================================================================
RCS file: /cvsroot/hurd/hurd/doc/hurd.texi,v
retrieving revision 1.26
diff -u -p -r1.26 hurd.texi
--- hurd.texi	1 Feb 2004 22:04:51 -0000	1.26
+++ hurd.texi	8 Mar 2004 22:17:40 -0000
@@ -98,7 +98,7 @@
 @end direntry
 
 @ifinfo
-Copyright @copyright{} 1994-2002  Free Software Foundation, Inc.
+Copyright @copyright{} 1994-2004  Free Software Foundation, Inc.
 
 Permission is granted to make and distribute verbatim copies of
 this manual provided the copyright notice and this permission notice
@@ -3969,8 +3969,9 @@ not exist, then return -1.  Otherwise, r
 with a newly-allocated reference.
 @end deftypefun
 
-@deftypefun error_t diskfs_cached_lookup (@w{int @var{cache_id}}, @w{struct node **@var{npp}})
+@deftypefun error_t diskfs_cached_lookup (@w{int @var{cache_id}}, @w{struct node **@var{npp}}, @w{struct node *@var{dir}})
 Return the node corresponding to @var{cache_id} in @code{*@var{npp}}.
+If the directory containing the node is locked, @code{*@var{dir}} is set to its node.
 @end deftypefun
 
 @deftypefun void diskfs_enter_lookup_cache (@w{struct node *@var{dir}}, @w{struct node *@var{np}}, @w{char *@var{name}})






2004-03-09  Marco Gerards  <[email protected]>

	* inode.c (read_node): Add DIR argument to prototype.
	(diskfs_cached_lookup): Add DIR argument, change all callers.
	(read_node): Add DIR argument and change all callers.  Do not
	lookup the directory when DIR already holds it, in that case don't
	call diskfs_nput before returning.


Index: inode.c
===================================================================
RCS file: /cvsroot/hurd/hurd/fatfs/inode.c,v
retrieving revision 1.5
diff -u -p -r1.5 inode.c
--- inode.c	6 Aug 2003 21:47:57 -0000	1.5
+++ inode.c	8 Mar 2004 22:30:39 -0000
@@ -1,5 +1,5 @@
 /* inode.c - Inode management routines.
-   Copyright (C) 1994,95,96,97,98,99,2000,02,03 Free Software Foundation, Inc.
+   Copyright (C) 1994,95,96,97,98,99,2000,02,03,2004 Free Software Foundation, Inc.
    Modified for fatfs by Marcus Brinkmann <[email protected]>
 
    This file is part of the GNU Hurd.
@@ -42,7 +42,7 @@
 
 static struct node *nodehash[INOHSZ];
 
-static error_t read_node (struct node *np, vm_address_t buf);
+static error_t read_node (struct node *np, vm_address_t buf, struct node *dir);
 
 /* Initialize the inode hash table.  */
 void
@@ -54,9 +54,10 @@ inode_init ()
 }
 
 /* Fetch inode INUM, set *NPP to the node structure; gain one user
-   reference and lock the node.  */
+   reference and lock the node.  If the directory containing the node
+   is locked, DIR is set to its node.  */
 error_t
-diskfs_cached_lookup (ino64_t inum, struct node **npp)
+diskfs_cached_lookup (ino64_t inum, struct node **npp, struct node *dir)
 {
   error_t err;
   struct node *np;
@@ -106,7 +107,7 @@ diskfs_cached_lookup (ino64_t inum, stru
   spin_unlock (&diskfs_node_refcnt_lock);
   
   /* Get the contents of NP off disk.  */
-  err = read_node (np, 0);
+  err = read_node (np, 0, dir);
 
   if (err)
     return err;
@@ -171,7 +172,7 @@ diskfs_cached_lookup_in_dirbuf (int inum
   spin_unlock (&diskfs_node_refcnt_lock);
   
   /* Get the contents of NP off disk.  */
-  err = read_node (np, buf);
+  err = read_node (np, buf, NULL);
 
   if (err)
     return err;
@@ -262,14 +263,14 @@ diskfs_new_hardrefs (struct node *np)
 
 /* Read stat information out of the directory entry. */
 static error_t
-read_node (struct node *np, vm_address_t buf)
+read_node (struct node *np, vm_address_t buf, struct node *dir)
 {
   /* XXX This needs careful investigation.  */
   error_t err;
   struct stat *st = &np->dn_stat;
   struct disknode *dn = np->dn;
   struct dirrect *dr;
-  struct node *dp = 0;
+  struct node *dp = dir;
   struct vi_key vk = vi_key(np->dn->inode);
   vm_prot_t prot = VM_PROT_READ;
   memory_object_t memobj;
@@ -306,17 +307,22 @@ read_node (struct node *np, vm_address_t
     {
       if (buf == 0)
 	{
-	  /* FIXME: We know intimately that the parent dir is locked
-	     by libdiskfs.  The only case it is not locked is for NFS
-	     (fsys_getfile) and we disabled that.  */
-	  dp = ifind (vk.dir_inode);
-	  assert (dp);
-      
+	  if (!dp)
+	    {
+	      err = diskfs_cached_lookup (vk.dir_inode, &dp, NULL);
+	      if (err)
+		return err;
+	    }
+
 	  /* Map in the directory contents. */
 	  memobj = diskfs_get_filemap (dp, prot);
       
 	  if (memobj == MACH_PORT_NULL)
-	    return errno;
+	    {
+	      if (!dir)
+		diskfs_nput (dp);
+	      return errno;
+	    }
 
 	  buflen = round_page (dp->dn_stat.st_size);
 	  err = vm_map (mach_task_self (),
@@ -359,6 +365,8 @@ read_node (struct node *np, vm_address_t
 	    {
 	      if (our_buf && buf)
 		munmap ((caddr_t) buf, buflen);
+	      if (dp && !dir)
+		diskfs_nput (np);
 	      return err;
 	    }
 	  st->st_size = np->allocsize;
@@ -394,6 +402,8 @@ read_node (struct node *np, vm_address_t
 
   if (our_buf && buf)
     munmap ((caddr_t) buf, buflen);
+  if (dp && !dir)
+    diskfs_nput (dp);
   return 0;
 }
 
@@ -532,7 +542,7 @@ diskfs_node_reload (struct node *node)
       last = next;
     }
   flush_node_pager (node);
-  read_node (node, 0);
+  read_node (node, 0, NULL);
 
   return 0;
 }
@@ -770,7 +780,7 @@ diskfs_alloc_node (struct node *dir, mod
   if (err)
     return err;
 
-  err = diskfs_cached_lookup (inum, &np);
+  err = diskfs_cached_lookup (inum, &np, NULL);
   if (err)
     return err;
 
Index: main.c
===================================================================
RCS file: /cvsroot/hurd/hurd/fatfs/main.c,v
retrieving revision 1.3
diff -u -p -r1.3 main.c
--- main.c	2 Aug 2003 21:32:52 -0000	1.3
+++ main.c	8 Mar 2004 22:30:39 -0000
@@ -201,8 +201,8 @@ fetch_root ()
   /* Allocate a node for the root directory disknode in
      diskfs_root_node.  */
   if (!err)
-    err = diskfs_cached_lookup (inum, &diskfs_root_node);
+    err = diskfs_cached_lookup (inum, &diskfs_root_node, NULL);
 
   assert_perror (err);
 
 




2004-03-09  Marco Gerards  <[email protected]>

	* node.c (diskfs_cached_lookup): Added DIR argument and changed
	all callers.


Index: alloc.c
===================================================================
RCS file: /cvsroot/hurd/hurd/ufs/alloc.c,v
retrieving revision 1.24
diff -u -p -r1.24 alloc.c
--- alloc.c	11 Jun 2002 21:41:03 -0000	1.24
+++ alloc.c	8 Mar 2004 22:10:15 -0000
@@ -1,5 +1,5 @@
 /* Disk allocation routines
-   Copyright (C) 1993,94,95,96,98,2002 Free Software Foundation, Inc.
+   Copyright (C) 1993,94,95,96,98,2002,2004 Free Software Foundation, Inc.
 
 This file is part of the GNU Hurd.
 
@@ -681,7 +681,7 @@ diskfs_alloc_node (struct node *dir,
 	spin_unlock (&alloclock);
 	if (ino == 0)
 		goto noinodes;
-	error = diskfs_cached_lookup (ino, &np);
+	error = diskfs_cached_lookup (ino, &np, NULL);
 	assert ("duplicate allocation" && !np->dn_stat.st_mode);
 	assert (! (np->dn_stat.st_mode & S_IPTRANS));
 	if (np->dn_stat.st_blocks) {
Index: dir.c
===================================================================
RCS file: /cvsroot/hurd/hurd/ufs/dir.c,v
retrieving revision 1.45
diff -u -p -r1.45 dir.c
--- dir.c	1 Aug 2002 00:59:18 -0000	1.45
+++ dir.c	8 Mar 2004 22:10:21 -0000
@@ -220,7 +220,7 @@ diskfs_lookup_hard (struct node *dp, con
 	    }
 	  else
 	    {
-	      err = diskfs_cached_lookup (inum, &np);
+	      err = diskfs_cached_lookup (inum, &np, NULL);
 	      if (err)
 		goto out;
 	    }
@@ -245,7 +245,7 @@ diskfs_lookup_hard (struct node *dp, con
 		 try *again*. */
 	      diskfs_nput (np);
 	      mutex_unlock (&dp->lock);
-	      err = diskfs_cached_lookup (inum, &np);
+	      err = diskfs_cached_lookup (inum, &np, NULL);
 	      mutex_lock (&dp->lock);
 	      if (err)
 		goto out;
@@ -260,7 +260,7 @@ diskfs_lookup_hard (struct node *dp, con
 	     repeat the directory scan to see if this is still
 	     right.  */
 	  mutex_unlock (&dp->lock);
-	  err = diskfs_cached_lookup (inum, &np);
+	  err = diskfs_cached_lookup (inum, &np, NULL);
 	  mutex_lock (&dp->lock);
 	  if (err)
 	    goto out;
@@ -275,7 +275,7 @@ diskfs_lookup_hard (struct node *dp, con
       else if (type == LOOKUP)
 	{
 	  diskfs_nput (dp);
-	  err = diskfs_cached_lookup (inum, &np);
+	  err = diskfs_cached_lookup (inum, &np, NULL);
 	  if (err)
 	    goto out;
 	}
Index: inode.c
===================================================================
RCS file: /cvsroot/hurd/hurd/ufs/inode.c,v
retrieving revision 1.59
diff -u -p -r1.59 inode.c
--- inode.c	11 Jun 2002 21:41:06 -0000	1.59
+++ inode.c	8 Mar 2004 22:10:21 -0000
@@ -1,5 +1,5 @@
 /* Inode management routines
-   Copyright (C) 1994,95,96,97,98,2000,01,02 Free Software Foundation, Inc.
+   Copyright (C) 1994,95,96,97,98,2000,01,02,2004 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -44,10 +44,11 @@ inode_init ()
     nodehash[n] = 0;
 }
 
-/* Fetch inode INUM, set *NPP to the node structure;
-   gain one user reference and lock the node.  */
+/* Fetch inode INUM, set *NPP to the node structure; gain one user
+   reference and lock the node.  If the directory containing the node
+   is locked, DIR is set to its node.  */
 error_t
-diskfs_cached_lookup (ino_t inum, struct node **npp)
+diskfs_cached_lookup (ino_t inum, struct node **npp, struct node *dir)
 {
   struct disknode *dn;
   struct node *np;
Index: main.c
===================================================================
RCS file: /cvsroot/hurd/hurd/ufs/main.c,v
retrieving revision 1.50
diff -u -p -r1.50 main.c
--- main.c	8 May 2002 09:59:52 -0000	1.50
+++ main.c	8 Mar 2004 22:10:21 -0000
@@ -44,7 +44,7 @@ static void
 warp_root (void)
 {
   error_t err;
-  err = diskfs_cached_lookup (2, &diskfs_root_node);
+  err = diskfs_cached_lookup (2, &diskfs_root_node, NULL);
   assert (!err);
   mutex_unlock (&diskfs_root_node->lock);
 }








2004-03-09  Marco Gerards  <[email protected]>

	* node.c (diskfs_cached_lookup): Added DIR argument and changed
	all callers.

Index: dir.c
===================================================================
RCS file: /cvsroot/hurd/hurd/tmpfs/dir.c,v
retrieving revision 1.12
diff -u -p -r1.12 dir.c
--- dir.c	13 Jun 2002 21:27:13 -0000	1.12
+++ dir.c	8 Mar 2004 22:13:14 -0000
@@ -198,7 +198,7 @@ diskfs_lookup_hard (struct node *dp,
       else
         {
 	  mutex_unlock (&dp->lock);
-          err = diskfs_cached_lookup ((ino_t) (intptr_t) dddn, np);
+          err = diskfs_cached_lookup ((ino_t) (intptr_t) dddn, np, NULL);
 
 	  if (type == (LOOKUP|SPEC_DOTDOT))
 	    diskfs_nrele (dp);
@@ -220,7 +220,7 @@ diskfs_lookup_hard (struct node *dp,
 	  ds->prevp = prevp;
 
 	if (np)
-	  return diskfs_cached_lookup ((ino_t) (uintptr_t) d->dn, np);
+	  return diskfs_cached_lookup ((ino_t) (uintptr_t) d->dn, np, NULL);
 	else
 	  return 0;
       }
Index: node.c
===================================================================
RCS file: /cvsroot/hurd/hurd/tmpfs/node.c,v
retrieving revision 1.12
diff -u -p -r1.12 node.c
--- node.c	11 Jun 2002 21:40:50 -0000	1.12
+++ node.c	8 Mar 2004 22:13:14 -0000
@@ -1,5 +1,5 @@
 /* Node state and file contents for tmpfs.
-   Copyright (C) 2000,01,02 Free Software Foundation, Inc.
+   Copyright (C) 2000,01,02,2004 Free Software Foundation, Inc.
 
 This file is part of the GNU Hurd.
 
@@ -52,7 +52,7 @@ diskfs_alloc_node (struct node *dp, mode
   spin_unlock (&diskfs_node_refcnt_lock);
 
   dn->type = IFTODT (mode & S_IFMT);
-  return diskfs_cached_lookup ((ino_t) (uintptr_t) dn, npp);
+  return diskfs_cached_lookup ((ino_t) (uintptr_t) dn, npp, NULL);
 }
 
 void
@@ -151,10 +151,11 @@ recompute_blocks (struct node *np)
   st->st_blocks = (st->st_blocks + 511) / 512;
 }
 
-/* Fetch inode INUM, set *NPP to the node structure;
-   gain one user reference and lock the node.  */
+/* Fetch inode INUM, set *NPP to the node structure; gain one user
+   reference and lock the node.  If the directory containing the node
+   is locked, DIR is set to its node.  */
 error_t
-diskfs_cached_lookup (ino_t inum, struct node **npp)
+diskfs_cached_lookup (ino_t inum, struct node **npp, struct node *dir)
 {
   struct disknode *dn = (void *) (uintptr_t) inum;
   struct node *np;






2004-03-09  Marco Gerards  <[email protected]>

	* node.c (diskfs_cached_lookup): Added DIR argument and changed
	all callers.



Index: dir.c
===================================================================
RCS file: /cvsroot/hurd/hurd/ext2fs/dir.c,v
retrieving revision 1.45
diff -u -p -r1.45 dir.c
--- dir.c	10 Jan 2004 22:08:58 -0000	1.45
+++ dir.c	8 Mar 2004 22:09:23 -0000
@@ -254,7 +254,7 @@ diskfs_lookup_hard (struct node *dp, con
 	    }
 	  else
 	    {
-	      err = diskfs_cached_lookup (inum, &np);
+	      err = diskfs_cached_lookup (inum, &np, NULL);
 	      if (err)
 		goto out;
 	    }
@@ -279,7 +279,7 @@ diskfs_lookup_hard (struct node *dp, con
 		 try *again*. */
 	      diskfs_nput (np);
 	      mutex_unlock (&dp->lock);
-	      err = diskfs_cached_lookup (inum, &np);
+	      err = diskfs_cached_lookup (inum, &np, NULL);
 	      mutex_lock (&dp->lock);
 	      if (err)
 		goto out;
@@ -294,7 +294,7 @@ diskfs_lookup_hard (struct node *dp, con
 	     repeat the directory scan to see if this is still
 	     right.  */
 	  mutex_unlock (&dp->lock);
-	  err = diskfs_cached_lookup (inum, &np);
+	  err = diskfs_cached_lookup (inum, &np, NULL);
 	  mutex_lock (&dp->lock);
 	  if (err)
 	    goto out;
@@ -309,7 +309,7 @@ diskfs_lookup_hard (struct node *dp, con
       else if (type == LOOKUP)
 	{
 	  diskfs_nput (dp);
-	  err = diskfs_cached_lookup (inum, &np);
+	  err = diskfs_cached_lookup (inum, &np, NULL);
 	  if (err)
 	    goto out;
 	}
Index: ext2fs.c
===================================================================
RCS file: /cvsroot/hurd/hurd/ext2fs/ext2fs.c,v
retrieving revision 1.55
diff -u -p -r1.55 ext2fs.c
--- ext2fs.c	2 Jun 2002 21:40:56 -0000	1.55
+++ ext2fs.c	8 Mar 2004 22:09:26 -0000
@@ -188,7 +188,7 @@ main (int argc, char **argv)
   inode_init ();
 
   /* Set diskfs_root_node to the root inode. */
-  err = diskfs_cached_lookup (EXT2_ROOT_INO, &diskfs_root_node);
+  err = diskfs_cached_lookup (EXT2_ROOT_INO, &diskfs_root_node, NULL);
   if (err)
     ext2_panic ("can't get root: %s", strerror (err));
   else if ((diskfs_root_node->dn_stat.st_mode & S_IFMT) == 0)
Index: ialloc.c
===================================================================
RCS file: /cvsroot/hurd/hurd/ext2fs/ialloc.c,v
retrieving revision 1.38
diff -u -p -r1.38 ialloc.c
--- ialloc.c	8 Oct 2002 23:10:09 -0000	1.38
+++ ialloc.c	8 Mar 2004 22:09:26 -0000
@@ -283,7 +283,7 @@ diskfs_alloc_node (struct node *dir, mod
   if (inum == 0)
     return ENOSPC;
 
-  err = diskfs_cached_lookup (inum, &np);
+  err = diskfs_cached_lookup (inum, &np, NULL);
   if (err)
     return err;
 
Index: inode.c
===================================================================
RCS file: /cvsroot/hurd/hurd/ext2fs/inode.c,v
retrieving revision 1.62
diff -u -p -r1.62 inode.c
--- inode.c	8 Oct 2002 23:10:09 -0000	1.62
+++ inode.c	8 Mar 2004 22:09:28 -0000
@@ -1,6 +1,6 @@
 /* Inode management routines
 
-   Copyright (C) 1994,95,96,97,98,99,2000,01,02 Free Software Foundation, Inc.
+   Copyright (C) 1994,95,96,97,98,99,2000,01,02,04 Free Software Foundation, Inc.
 
    Converted for ext2fs by Miles Bader <[email protected]>
 
@@ -60,10 +60,11 @@ inode_init ()
     nodehash[n] = 0;
 }
 
-/* Fetch inode INUM, set *NPP to the node structure;
-   gain one user reference and lock the node.  */
+/* Fetch inode INUM, set *NPP to the node structure; gain one user
+   reference and lock the node.  If the directory containing the node
+   is locked, DIR is set to its node.  */
 error_t
-diskfs_cached_lookup (ino_t inum, struct node **npp)
+diskfs_cached_lookup (ino_t inum, struct node **npp, struct node *dir)
 {
   error_t err;
   struct node *np;







2004-03-09  Marco Gerards  <[email protected]>

	* inode.c (diskfs_cached_lookup): Added DIR argument.



Index: inode.c
===================================================================
RCS file: /cvsroot/hurd/hurd/isofs/inode.c,v
retrieving revision 1.16
diff -u -p -r1.16 inode.c
--- inode.c	6 Aug 2002 12:33:17 -0000	1.16
+++ inode.c	8 Mar 2004 22:14:28 -0000
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 1997,98,2002 Free Software Foundation, Inc.
+   Copyright (C) 1997,98,2002,2004 Free Software Foundation, Inc.
    Written by Thomas Bushnell, n/BSG.
 
    This file is part of the GNU Hurd.
@@ -142,10 +142,11 @@ cache_inode (struct node *np, struct dir
   np->cache_id = i + 1;
 }
 
-/* Fetch inode with cache id ID; set *NPP to the node structure;
-   gain one user reference and lock the node. */
+/* Fetch inode with cache id ID; set *NPP to the node structure; gain
+   one user reference and lock the node.  If the directory containing
+   the node is locked, DIR is set to its node.  */
 error_t
-diskfs_cached_lookup (ino_t id, struct node **npp)
+diskfs_cached_lookup (ino_t id, struct node **npp, struct node *dir)
 {
   struct node *np;
   error_t err;