hostfs: simplify locking
[linux-block.git] / fs / dcache.c
index 6f59f375ed9d812dab8750ac8cfe54199d9e3e9c..61beb40dd6bf31c37d70fc5286ea94a32162c334 100644 (file)
@@ -2171,7 +2171,7 @@ char *dynamic_dname(struct dentry *dentry, char *buffer, int buflen,
 /*
  * Write full pathname from the root of the filesystem into the buffer.
  */
-char *__dentry_path(struct dentry *dentry, char *buf, int buflen)
+static char *__dentry_path(struct dentry *dentry, char *buf, int buflen)
 {
        char *end = buf + buflen;
        char *retval;
@@ -2198,7 +2198,18 @@ char *__dentry_path(struct dentry *dentry, char *buf, int buflen)
 Elong:
        return ERR_PTR(-ENAMETOOLONG);
 }
-EXPORT_SYMBOL(__dentry_path);
+
+char *dentry_path_raw(struct dentry *dentry, char *buf, int buflen)
+{
+       char *retval;
+
+       spin_lock(&dcache_lock);
+       retval = __dentry_path(dentry, buf, buflen);
+       spin_unlock(&dcache_lock);
+
+       return retval;
+}
+EXPORT_SYMBOL(dentry_path_raw);
 
 char *dentry_path(struct dentry *dentry, char *buf, int buflen)
 {