fs: change d_hash for rcu-walk

Change d_hash so it may be called from lock-free RCU lookups. See similar
patch for d_compare for details.

For in-tree filesystems, this is just a mechanical change.

Signed-off-by: Nick Piggin <[email protected]>
This commit is contained in:
Nick Piggin 2011-01-07 17:49:28 +11:00
commit b1e6a015a5
25 changed files with 94 additions and 51 deletions

View file

@ -26,8 +26,10 @@
#define BEQUIET
static int isofs_hashi(struct dentry *parent, struct qstr *qstr);
static int isofs_hash(struct dentry *parent, struct qstr *qstr);
static int isofs_hashi(const struct dentry *parent, const struct inode *inode,
struct qstr *qstr);
static int isofs_hash(const struct dentry *parent, const struct inode *inode,
struct qstr *qstr);
static int isofs_dentry_cmpi(const struct dentry *parent,
const struct inode *pinode,
const struct dentry *dentry, const struct inode *inode,
@ -38,8 +40,10 @@ static int isofs_dentry_cmp(const struct dentry *parent,
unsigned int len, const char *str, const struct qstr *name);
#ifdef CONFIG_JOLIET
static int isofs_hashi_ms(struct dentry *parent, struct qstr *qstr);
static int isofs_hash_ms(struct dentry *parent, struct qstr *qstr);
static int isofs_hashi_ms(const struct dentry *parent, const struct inode *inode,
struct qstr *qstr);
static int isofs_hash_ms(const struct dentry *parent, const struct inode *inode,
struct qstr *qstr);
static int isofs_dentry_cmpi_ms(const struct dentry *parent,
const struct inode *pinode,
const struct dentry *dentry, const struct inode *inode,
@ -172,7 +176,7 @@ struct iso9660_options{
* Compute the hash for the isofs name corresponding to the dentry.
*/
static int
isofs_hash_common(struct dentry *dentry, struct qstr *qstr, int ms)
isofs_hash_common(const struct dentry *dentry, struct qstr *qstr, int ms)
{
const char *name;
int len;
@ -193,7 +197,7 @@ isofs_hash_common(struct dentry *dentry, struct qstr *qstr, int ms)
* Compute the hash for the isofs name corresponding to the dentry.
*/
static int
isofs_hashi_common(struct dentry *dentry, struct qstr *qstr, int ms)
isofs_hashi_common(const struct dentry *dentry, struct qstr *qstr, int ms)
{
const char *name;
int len;
@ -248,13 +252,15 @@ static int isofs_dentry_cmp_common(
}
static int
isofs_hash(struct dentry *dentry, struct qstr *qstr)
isofs_hash(const struct dentry *dentry, const struct inode *inode,
struct qstr *qstr)
{
return isofs_hash_common(dentry, qstr, 0);
}
static int
isofs_hashi(struct dentry *dentry, struct qstr *qstr)
isofs_hashi(const struct dentry *dentry, const struct inode *inode,
struct qstr *qstr)
{
return isofs_hashi_common(dentry, qstr, 0);
}
@ -277,13 +283,15 @@ isofs_dentry_cmpi(const struct dentry *parent, const struct inode *pinode,
#ifdef CONFIG_JOLIET
static int
isofs_hash_ms(struct dentry *dentry, struct qstr *qstr)
isofs_hash_ms(const struct dentry *dentry, const struct inode *inode,
struct qstr *qstr)
{
return isofs_hash_common(dentry, qstr, 1);
}
static int
isofs_hashi_ms(struct dentry *dentry, struct qstr *qstr)
isofs_hashi_ms(const struct dentry *dentry, const struct inode *inode,
struct qstr *qstr)
{
return isofs_hashi_common(dentry, qstr, 1);
}