/[hurd]/hurd/libtreefs/treefs.h
ViewVC logotype

Diff of /hurd/libtreefs/treefs.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by mib, Thu Jul 18 04:32:22 1996 UTC revision 1.2 by roland, Tue Jun 11 21:41:42 2002 UTC
# Line 1  Line 1 
1  /* Hierarchial filesystem support  /* Hierarchial filesystem support
2    
3     Copyright (C) 1995 Free Software Foundation, Inc.     Copyright (C) 1995, 2002 Free Software Foundation, Inc.
4    
5     Written by Miles Bader <miles@gnu.ai.mit.edu>     Written by Miles Bader <miles@gnu.org>
6    
7     This file is part of the GNU Hurd.     This file is part of the GNU Hurd.
8    
# Line 84  struct treefs_peropen Line 84  struct treefs_peropen
84  };  };
85    
86  /* A filesystem node in the tree.  */  /* A filesystem node in the tree.  */
87  struct treefs_node  struct treefs_node
88  {  {
89    struct stat stat;    io_statbuf_t stat;
90    struct treefs_fsys *fsys;    struct treefs_fsys *fsys;
91    
92    struct trans_link active_trans;    struct trans_link active_trans;
# Line 124  struct treefs_fsys Line 124  struct treefs_fsys
124    /* The port for the node which this filesystem is translating.  */    /* The port for the node which this filesystem is translating.  */
125    mach_port_t underlying_port;    mach_port_t underlying_port;
126    /* And stat info for it.  */    /* And stat info for it.  */
127    struct stat underlying_stat;    io_statbuf_t underlying_stat;
128    
129    /* Flags from the TREEFS_FSYS_ set.  */    /* Flags from the TREEFS_FSYS_ set.  */
130    int flags;    int flags;
# Line 237  void treefs_hooks_set (treefs_hook_vecto Line 237  void treefs_hooks_set (treefs_hook_vecto
237    
238  extern spin_lock_t treefs_node_refcnt_lock;  extern spin_lock_t treefs_node_refcnt_lock;
239    
240  /* Add a hard reference to a node.  If there were no hard  /* Add a hard reference to a node.  If there were no hard
241     references previously, then the node cannot be locked     references previously, then the node cannot be locked
242     (because you must hold a hard reference to hold the lock). */     (because you must hold a hard reference to hold the lock). */
243  extern inline void  extern inline void
244  treefs_node_ref (struct treefs_node *node)  treefs_node_ref (struct treefs_node *node)
# Line 263  extern inline void Line 263  extern inline void
263  treefs_node_release (struct treefs_node *node)  treefs_node_release (struct treefs_node *node)
264  {  {
265    int tried_drop_weak_refs = 0;    int tried_drop_weak_refs = 0;
266      
267   loop:   loop:
268    spin_lock (&treefs_node_refcnt_lock);    spin_lock (&treefs_node_refcnt_lock);
269    assert (node->refs);    assert (node->refs);
# Line 310  extern inline void Line 310  extern inline void
310  treefs_node_unref (struct treefs_node *node)  treefs_node_unref (struct treefs_node *node)
311  {  {
312    int tried_drop_weak_refs = 0;    int tried_drop_weak_refs = 0;
313      
314   loop:   loop:
315    spin_lock (&treefs_node_refcnt_lock);    spin_lock (&treefs_node_refcnt_lock);
316    assert (node->refs);    assert (node->refs);
# Line 331  treefs_node_unref (struct treefs_node *n Line 331  treefs_node_unref (struct treefs_node *n
331            spin_unlock (&treefs_node_refcnt_lock);            spin_unlock (&treefs_node_refcnt_lock);
332            node->refs++;            node->refs++;
333            spin_unlock (&treefs_node_refcnt_lock);            spin_unlock (&treefs_node_refcnt_lock);
334              
335            treefs_node_try_dropping_weak_refs (node);            treefs_node_try_dropping_weak_refs (node);
336            tried_drop_weak_refs = 1;            tried_drop_weak_refs = 1;
337    
# Line 372  treefs_node_release_weak (struct treefs_ Line 372  treefs_node_release_weak (struct treefs_
372    
373  /* Release a weak reference on NODE.  If NODE is locked by anyone, then  /* Release a weak reference on NODE.  If NODE is locked by anyone, then
374     this cannot be the last reference (because you must hold a     this cannot be the last reference (because you must hold a
375     hard reference in order to hold the lock).  */       hard reference in order to hold the lock).  */
376  extern inline void  extern inline void
377  treefs_node_unref_weak (struct treefs_node *node)  treefs_node_unref_weak (struct treefs_node *node)
378  {  {

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26