patch-2.2.14 linux/fs/namei.c
Next file: linux/fs/ncpfs/inode.c
Previous file: linux/fs/msdos/namei.c
Back to the patch index
Back to the overall index
- Lines: 29
- Date:
Tue Jan 4 10:12:23 2000
- Orig file:
v2.2.13/linux/fs/namei.c
- Orig date:
Tue Jan 4 11:10:40 2000
diff -u --recursive --new-file v2.2.13/linux/fs/namei.c linux/fs/namei.c
@@ -246,7 +246,7 @@
* FIXME! This could use version numbering or similar to
* avoid unnecessary cache lookups.
*/
- result = cached_lookup(parent, name, flags);
+ result = d_lookup(parent, name);
if (!result) {
struct dentry * dentry = d_alloc(parent, name);
result = ERR_PTR(-ENOMEM);
@@ -257,8 +257,19 @@
else
result = dentry;
}
+ up(&dir->i_sem);
+ return result;
}
+
+ /*
+ * Uhhuh! Nasty case: the cache was re-populated while
+ * we waited on the semaphore. Need to revalidate, but
+ * we're going to return this entry regardless (same
+ * as if it was busy).
+ */
up(&dir->i_sem);
+ if (result->d_op && result->d_op->d_revalidate)
+ result->d_op->d_revalidate(result, flags);
return result;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)