summaryrefslogtreecommitdiffstats
path: root/fs/dcache.c
diff options
context:
space:
mode:
authorNick Piggin <npiggin@kernel.dk>2011-01-07 17:49:29 +1100
committerNick Piggin <npiggin@kernel.dk>2011-01-07 17:50:20 +1100
commitec2447c278ee973d35f38e53ca16ba7f965ae33d (patch)
tree5d17a0523c301b8c71c0f198ffe7782c5e9c0ea9 /fs/dcache.c
parentb1e6a015a580ad145689ad1d6b4aa0e03e6c868b (diff)
downloadop-kernel-dev-ec2447c278ee973d35f38e53ca16ba7f965ae33d.zip
op-kernel-dev-ec2447c278ee973d35f38e53ca16ba7f965ae33d.tar.gz
hostfs: simplify locking
Remove dcache_lock locking from hostfs filesystem, and move it into dcache helpers. All that is required is a coherent path name. Protection from concurrent modification of the namespace after path name generation is not provided in current code, because dcache_lock is dropped before the path is used. Signed-off-by: Nick Piggin <npiggin@kernel.dk>
Diffstat (limited to 'fs/dcache.c')
-rw-r--r--fs/dcache.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index 6f59f37..61beb40 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -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)
{
OpenPOWER on IntegriCloud