* mds_id might be 0, so +1 when calculating hash.
* link new capa into its hash list head, not the capa_hash.
- CDEBUG(D_INFO, "wrote capa keyid %u\n", keyid);
-
spin_lock(&mds_capa_lock);
list_del_init(&CUR_CAPA_KEY_LIST(mds));
mds->mds_capa_key_idx = to_update;
spin_lock(&mds_capa_lock);
list_del_init(&CUR_CAPA_KEY_LIST(mds));
mds->mds_capa_key_idx = to_update;
if (time_before(expiry, mds_eck_timer.expires) ||
!timer_pending(&mds_eck_timer)) {
mod_timer(&mds_eck_timer, expiry);
if (time_before(expiry, mds_eck_timer.expires) ||
!timer_pending(&mds_eck_timer)) {
mod_timer(&mds_eck_timer, expiry);
- CDEBUG(D_INFO, "mds_eck_timer %lu", expiry);
+ CDEBUG(D_INFO, "mds_eck_timer %lu\n", expiry);
}
spin_unlock(&mds_capa_lock);
}
spin_unlock(&mds_capa_lock);
if (local)
RETURN(mds->mds_num);
if (local)
RETURN(mds->mds_num);
if (flags & REC_REINT_CREATE) {
i = mds->mds_num;
} else if (mds->mds_md_exp != NULL && peer != NULL) {
if (flags & REC_REINT_CREATE) {
i = mds->mds_num;
} else if (mds->mds_md_exp != NULL && peer != NULL) {
static inline int const
capa_hashfn(unsigned int uid, int capa_op, __u64 mdsid, unsigned long ino)
{
static inline int const
capa_hashfn(unsigned int uid, int capa_op, __u64 mdsid, unsigned long ino)
{
- return (ino ^ uid) * (unsigned long)capa_op * (unsigned long)mdsid %
- NR_CAPAHASH;
+ return (ino ^ uid) * (unsigned long)capa_op * (unsigned long)(mdsid + 1)
+ % NR_CAPAHASH;
void capa_cache_cleanup(void)
{
void capa_cache_cleanup(void)
{
- struct obd_capa *ocapa;
- struct hlist_node *pos, *n;
+ struct obd_capa *ocapa, *tmp;
+ int i;
- hlist_for_each_entry_safe(ocapa, pos, n, capa_hash, c_hash) {
- LASSERT(ocapa->c_type != CLIENT_CAPA);
- __capa_put(ocapa);
- destroy_capa(ocapa);
+ for (i = MDS_CAPA; i <= FILTER_CAPA; i++) {
+ list_for_each_entry_safe(ocapa, tmp, &capa_list[i], c_list) {
+ __capa_put(ocapa);
+ destroy_capa(ocapa);
+ }
}
OBD_FREE(capa_hash, PAGE_SIZE);
}
OBD_FREE(capa_hash, PAGE_SIZE);
do_update_capa(ocapa, capa);
ocapa->c_type = type;
list_add_capa(ocapa, &capa_list[type]);
do_update_capa(ocapa, capa);
ocapa->c_type = type;
list_add_capa(ocapa, &capa_list[type]);
- hlist_add_head(&ocapa->c_hash, capa_hash);
+ hlist_add_head(&ocapa->c_hash, head);
if (type == CLIENT_CAPA)
INIT_LIST_HEAD(&ocapa->c_lli_list);
if (type == CLIENT_CAPA)
INIT_LIST_HEAD(&ocapa->c_lli_list);