diff options
author | Nick Piggin <npiggin@kernel.dk> | 2011-01-07 01:49:27 -0500 |
---|---|---|
committer | Nick Piggin <npiggin@kernel.dk> | 2011-01-07 01:50:19 -0500 |
commit | 621e155a3591962420eacdd39f6f0aa29ceb221e (patch) | |
tree | 387a9fb396f1bf24514b712c294182e36ba51076 /fs/jfs/namei.c | |
parent | fb2d5b86aff355a27ebfc132d3c99f4a940cc3fe (diff) |
fs: change d_compare for rcu-walk
Change d_compare so it may be called from lock-free RCU lookups. This
does put significant restrictions on what may be done from the callback,
however there don't seem to have been any problems with in-tree fses.
If some strange use case pops up that _really_ cannot cope with the
rcu-walk rules, we can just add new rcu-unaware callbacks, which would
cause name lookup to drop out of rcu-walk mode.
For in-tree filesystems, this is just a mechanical change.
Signed-off-by: Nick Piggin <npiggin@kernel.dk>
Diffstat (limited to 'fs/jfs/namei.c')
-rw-r--r-- | fs/jfs/namei.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c index 2da1546161fa..92129016cd79 100644 --- a/fs/jfs/namei.c +++ b/fs/jfs/namei.c | |||
@@ -1587,14 +1587,17 @@ static int jfs_ci_hash(struct dentry *dir, struct qstr *this) | |||
1587 | return 0; | 1587 | return 0; |
1588 | } | 1588 | } |
1589 | 1589 | ||
1590 | static int jfs_ci_compare(struct dentry *dir, struct qstr *a, struct qstr *b) | 1590 | static int jfs_ci_compare(const struct dentry *parent, |
1591 | const struct inode *pinode, | ||
1592 | const struct dentry *dentry, const struct inode *inode, | ||
1593 | unsigned int len, const char *str, const struct qstr *name) | ||
1591 | { | 1594 | { |
1592 | int i, result = 1; | 1595 | int i, result = 1; |
1593 | 1596 | ||
1594 | if (a->len != b->len) | 1597 | if (len != name->len) |
1595 | goto out; | 1598 | goto out; |
1596 | for (i=0; i < a->len; i++) { | 1599 | for (i=0; i < len; i++) { |
1597 | if (tolower(a->name[i]) != tolower(b->name[i])) | 1600 | if (tolower(str[i]) != tolower(name->name[i])) |
1598 | goto out; | 1601 | goto out; |
1599 | } | 1602 | } |
1600 | result = 0; | 1603 | result = 0; |