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 |
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 |
{ |
{ |
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 |
|
|