/[hurd]/hurd/libdiskfs/dir-renamed.c
ViewVC logotype

Diff of /hurd/libdiskfs/dir-renamed.c

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

revision 1.22 by roland, Fri Oct 12 02:49:17 2001 UTC revision 1.23 by jbailey, Mon Jul 28 22:37:24 2003 UTC
# Line 1  Line 1 
1  /*  /*
2     Copyright (C) 1994,95,96,97,98,99,2001 Free Software Foundation, Inc.     Copyright (C) 1994,95,96,97,98,99,2001,2003 Free Software Foundation, Inc.
3    
4     This program is free software; you can redistribute it and/or     This program is free software; you can redistribute it and/or
5     modify it under the terms of the GNU General Public License as     modify it under the terms of the GNU General Public License as
# Line 106  diskfs_rename_dir (struct node *fdp, str Line 106  diskfs_rename_dir (struct node *fdp, str
106        return 0;        return 0;
107      }      }
108    
109    /* Now we can safely lock fnp */    /* Check permissions to remove FROMNAME and lock FNP.  */
110    mutex_lock (&fnp->lock);    tmpds = alloca (diskfs_dirstat_size);
111      err = diskfs_lookup (fdp, fromname, REMOVE, &tmpnp, tmpds, fromcred);
112      assert (!tmpnp || tmpnp == fnp);
113      if (tmpnp)
114        diskfs_nrele (tmpnp);
115      diskfs_drop_dirstat (fdp, tmpds);
116      if (err)
117        goto out;
118    
119    if (tnp)    if (tnp)
120      {      {
# Line 199  diskfs_rename_dir (struct node *fdp, str Line 206  diskfs_rename_dir (struct node *fdp, str
206    ds = buf;    ds = buf;
207    mutex_unlock (&fnp->lock);    mutex_unlock (&fnp->lock);
208    err = diskfs_lookup (fdp, fromname, REMOVE, &tmpnp, ds, fromcred);    err = diskfs_lookup (fdp, fromname, REMOVE, &tmpnp, ds, fromcred);
209    assert (tmpnp == fnp);    assert (!tmpnp || tmpnp == fnp);
210    diskfs_nrele (tmpnp);    if (tmpnp)
211        diskfs_nrele (tmpnp);
212    if (err)    if (err)
213      goto out;      goto out;
214    

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

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