return hash_ptr(ino, FILE_HASH_BITS);
}
-static unsigned int stateid_hashval(u32 owner_id, u32 file_id)
+static unsigned int stateid_hashval(stateid_t *s)
{
- return (owner_id + file_id) & STATEID_HASH_MASK;
+ return opaque_hashval(&s->si_opaque, sizeof(stateid_opaque_t)) & STATEID_HASH_MASK;
}
static struct list_head file_hashtbl[FILE_HASH_SIZE];
stateid_t *s = &stid->sc_stateid;
unsigned int hashval;
- hashval = stateid_hashval(s->si_stateownerid, s->si_fileid);
+ hashval = stateid_hashval(s);
list_add(&stid->sc_hash, &stateid_hashtbl[hashval]);
}
struct nfs4_stid *s;
unsigned int hashval;
- hashval = stateid_hashval(t->si_stateownerid, t->si_fileid);
+ hashval = stateid_hashval(t);
list_for_each_entry(s, &stateid_hashtbl[hashval], sc_hash)
if (same_stateid(&s->sc_stateid, t))
return s;